@Test public void refreshCheckTasks() throws Exception { when(mRoomDatabase.query(anyString(), any(Object[].class))) .thenReturn(mock(Cursor.class)); mTracker.refreshVersionsAsync(); mTracker.refreshVersionsAsync(); verify(mTaskExecutorRule.getTaskExecutor()).executeOnDiskIO(mTracker.mRefreshRunnable); drainTasks(); reset(mTaskExecutorRule.getTaskExecutor()); mTracker.refreshVersionsAsync(); verify(mTaskExecutorRule.getTaskExecutor()).executeOnDiskIO(mTracker.mRefreshRunnable); }
@SuppressWarnings("WeakerAccess") public void refreshVersionsAsync() { if (mPendingRefresh.compareAndSet(false, true)) { ArchTaskExecutor.getInstance().executeOnDiskIO(mRefreshRunnable); } }
InvalidationTracker { @SuppressWarnings("WeakerAccess") public void refreshVersionsAsync() { if (mPendingRefresh.compareAndSet(false, true)) { ArchTaskExecutor.getInstance().executeOnDiskIO(mRefreshRunnable); } } }
InvalidationTracker { @SuppressWarnings("WeakerAccess") public void refreshVersionsAsync() { if (mPendingRefresh.compareAndSet(false, true)) { ArchTaskExecutor.getInstance().executeOnDiskIO(mRefreshRunnable); } } @SuppressWarnings("WeakerAccess") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  InvalidationTracker(RoomDatabase database, String... tableNames); }
InvalidationTracker { @SuppressWarnings("WeakerAccess") public void refreshVersionsAsync() { if (mPendingRefresh.compareAndSet(false, true)) { ArchTaskExecutor.getInstance().executeOnDiskIO(mRefreshRunnable); } } @SuppressWarnings("WeakerAccess") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  InvalidationTracker(RoomDatabase database, String... tableNames); @WorkerThread void addObserver(@NonNull Observer observer); @SuppressWarnings("unused") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void addWeakObserver(Observer observer); @SuppressWarnings("WeakerAccess") @WorkerThread void removeObserver(@NonNull final Observer observer); @SuppressWarnings("WeakerAccess") void refreshVersionsAsync(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread void refreshVersionsSync(); }
InvalidationTracker { @SuppressWarnings("WeakerAccess") public void refreshVersionsAsync() { if (mPendingRefresh.compareAndSet(false, true)) { ArchTaskExecutor.getInstance().executeOnDiskIO(mRefreshRunnable); } } @SuppressWarnings("WeakerAccess") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  InvalidationTracker(RoomDatabase database, String... tableNames); @WorkerThread void addObserver(@NonNull Observer observer); @SuppressWarnings("unused") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void addWeakObserver(Observer observer); @SuppressWarnings("WeakerAccess") @WorkerThread void removeObserver(@NonNull final Observer observer); @SuppressWarnings("WeakerAccess") void refreshVersionsAsync(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread void refreshVersionsSync();  }