/**
* Asserts that we are not on the main thread.
*
* @hide
*/
@SuppressLint("RestrictedApi")
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public void assertNotMainThread() {
if (mAllowMainThreadQueries) {
return;
}
if (AppToolkitTaskExecutor.getInstance().isMainThread()) {
throw new IllegalStateException("Cannot access database on the main thread since"
+ " it may potentially lock the UI for a long periods of time.");
}
}
RoomDatabase.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:AndroidLife
作者:
评论列表
文章目录