room/runtime/src/main/java/androidx/room/RoomDatabase.java
@SuppressWarnings("WeakerAccess")
    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    // used in generated code
    public void assertNotMainThread() {
        if (mAllowMainThreadQueries) {
            return;
        }
        if (ArchTaskExecutor.getInstance().isMainThread()) {
            throw new IllegalStateException("Cannot access database on the main thread since"
                    + " it may potentially lock the UI for a long period of time.");
        }
    }
/**
     * Asserts that we are not on the main thread.
     *
     * @hide
     */
Asserts that we are not on the main thread.
@hide
Asserts that we are not on the main thread . @hide
@SuppressWarnings("WeakerAccess")
    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public void assertNotMainThread() {
        if (mAllowMainThreadQueries) {
            return;
        }
        if (ArchTaskExecutor.getInstance().isMainThread()) {
            throw new IllegalStateException("Cannot access database on the main thread since"
                    + " it may potentially lock the UI for a long period of time.");
        }
    }
@ SuppressWarnings ( "WeakerAccess" ) @ RestrictTo ( RestrictTo . Scope . LIBRARY_GROUP ) public void assertNotMainThread ( ) { if ( mAllowMainThreadQueries ) { return ; } if ( ArchTaskExecutor . getInstance ( ) . isMainThread ( ) ) { throw new IllegalStateException ( "Cannot access database on the main thread since" + " it may potentially lock the UI for a long period of time." ) ; } }
Asserts that we are not on the main thread.
Asserts that we are not on the main thread .
// used in generated code