Java Code Examples for android.support.annotation.GuardedBy

The following are top voted examples for showing how to use android.support.annotation.GuardedBy. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: android-architecture-components   File: PagingRequestHelper.java   View source code 5 votes vote down vote up
@GuardedBy("mLock")
private StatusReport prepareStatusReportLocked() {
    Throwable[] errors = new Throwable[]{
            mRequestQueues[0].mLastError,
            mRequestQueues[1].mLastError,
            mRequestQueues[2].mLastError
    };
    return new StatusReport(
            getStatusForLocked(RequestType.INITIAL),
            getStatusForLocked(RequestType.BEFORE),
            getStatusForLocked(RequestType.AFTER),
            errors
    );
}
 
Example 2
Project: android-architecture-components   File: PagingRequestHelper.java   View source code 5 votes vote down vote up
@GuardedBy("mLock")
private Status getStatusForLocked(RequestType type) {
    return mRequestQueues[type.ordinal()].mStatus;
}