2019-02-04 20:08:30 +00:00
.class public L androidx/room/InvalidationTracker ;
.super L java/lang/Object ;
2019-02-04 20:29:01 +00:00
.source "InvalidationTracker.java"
2019-02-04 20:08:30 +00:00
# annotations
.annotation system L dalvik/annotation/MemberClasses ;
value = {
L androidx/room/InvalidationTracker$WeakObserver ;,
L androidx/room/InvalidationTracker$ObservedTableTracker ;,
L androidx/room/InvalidationTracker$Observer ;,
L androidx/room/InvalidationTracker$ObserverWrapper ;
}
.end annotation
# static fields
.field static final CLEANUP_SQL : L java/lang/String ; = "DELETE FROM room_table_modification_log WHERE version NOT IN( SELECT MAX(version) FROM room_table_modification_log GROUP BY table_id)"
.annotation build L androidx/annotation/VisibleForTesting ;
.end annotation
.end field
.field private static final CREATE_VERSION_TABLE_SQL : L java/lang/String ; = "CREATE TEMP TABLE room_table_modification_log(version INTEGER PRIMARY KEY AUTOINCREMENT, table_id INTEGER)"
.field static final SELECT_UPDATED_TABLES_SQL : L java/lang/String ; = "SELECT * FROM room_table_modification_log WHERE version > ? ORDER BY version ASC;"
.annotation build L androidx/annotation/VisibleForTesting ;
.end annotation
.end field
.field private static final TABLE_ID_COLUMN_NAME : L java/lang/String ; = "table_id"
.field private static final TRIGGERS : [ L java/lang/String ;
.field private static final UPDATE_TABLE_NAME : L java/lang/String ; = "room_table_modification_log"
.field private static final VERSION_COLUMN_NAME : L java/lang/String ; = "version"
# instance fields
.field volatile mCleanupStatement : L androidx/sqlite/db/SupportSQLiteStatement ;
.field final mDatabase : L androidx/room/RoomDatabase ;
.field private volatile mInitialized : Z
.field mMaxVersion : J
.field private mObservedTableTracker : L androidx/room/InvalidationTracker$ObservedTableTracker ;
.field final mObserverMap : L androidx/arch/core/internal/SafeIterableMap ;
.annotation build L androidx/annotation/VisibleForTesting ;
.end annotation
.annotation system L dalvik/annotation/Signature ;
value = {
"Landroidx/arch/core/internal/SafeIterableMap<" ,
"Landroidx/room/InvalidationTracker$Observer;" ,
"Landroidx/room/InvalidationTracker$ObserverWrapper;" ,
">;"
}
.end annotation
.end field
.field mPendingRefresh : L java/util/concurrent/atomic/AtomicBoolean ;
.field mQueryArgs : [ L java/lang/Object ;
.field mRefreshRunnable : L java/lang/Runnable ;
.annotation build L androidx/annotation/VisibleForTesting ;
.end annotation
.end field
.field mTableIdLookup : L androidx/collection/ArrayMap ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.annotation build L androidx/annotation/VisibleForTesting ;
.end annotation
.annotation system L dalvik/annotation/Signature ;
value = {
"Landroidx/collection/ArrayMap<" ,
"Ljava/lang/String;" ,
"Ljava/lang/Integer;" ,
">;"
}
.end annotation
.end field
.field private mTableNames : [ L java/lang/String ;
.field mTableVersions : [J
.annotation build L androidx/annotation/NonNull ;
.end annotation
.annotation build L androidx/annotation/VisibleForTesting ;
.end annotation
.end field
# direct methods
.method static constructor <clinit> ( ) V
.locals 3
const/4 v0 , 0x3
new-array v0 , v0 , [ L java/lang/String ;
const-string v1 , "UPDATE"
const/4 v2 , 0x0
aput-object v1 , v0 , v2
const-string v1 , "DELETE"
const/4 v2 , 0x1
aput-object v1 , v0 , v2
const-string v1 , "INSERT"
const/4 v2 , 0x2
aput-object v1 , v0 , v2
sput-object v0 , L androidx/room/InvalidationTracker ;-> TRIGGERS : [ L java/lang/String ;
return-void
.end method
.method public varargs constructor <init> ( L androidx/room/RoomDatabase ;[ L java/lang/String ;) V
.locals 6
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
invoke-direct { p0 } , L java/lang/Object ;-> <init> ( ) V
const/4 v0 , 0x1
new-array v0 , v0 , [ L java/lang/Object ;
iput-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mQueryArgs : [ L java/lang/Object ;
const-wide/16 v0 , 0x0
iput-wide v0 , p0 , L androidx/room/InvalidationTracker ;-> mMaxVersion : J
new-instance v2 , L java/util/concurrent/atomic/AtomicBoolean ;
const/4 v3 , 0x0
invoke-direct { v2 , v3 } , L java/util/concurrent/atomic/AtomicBoolean ;-> <init> ( Z ) V
iput-object v2 , p0 , L androidx/room/InvalidationTracker ;-> mPendingRefresh : L java/util/concurrent/atomic/AtomicBoolean ;
iput-boolean v3 , p0 , L androidx/room/InvalidationTracker ;-> mInitialized : Z
new-instance v2 , L androidx/arch/core/internal/SafeIterableMap ;
invoke-direct { v2 } , L androidx/arch/core/internal/SafeIterableMap ;-> <init> ( ) V
iput-object v2 , p0 , L androidx/room/InvalidationTracker ;-> mObserverMap : L androidx/arch/core/internal/SafeIterableMap ;
new-instance v2 , L androidx/room/InvalidationTracker$1 ;
invoke-direct { v2 , p0 } , L androidx/room/InvalidationTracker$1 ;-> <init> ( L androidx/room/InvalidationTracker ;) V
iput-object v2 , p0 , L androidx/room/InvalidationTracker ;-> mRefreshRunnable : L java/lang/Runnable ;
iput-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
new-instance p1 , L androidx/room/InvalidationTracker$ObservedTableTracker ;
array-length v2 , p2
invoke-direct { p1 , v2 } , L androidx/room/InvalidationTracker$ObservedTableTracker ;-> <init> ( I ) V
iput-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mObservedTableTracker : L androidx/room/InvalidationTracker$ObservedTableTracker ;
new-instance p1 , L androidx/collection/ArrayMap ;
invoke-direct { p1 } , L androidx/collection/ArrayMap ;-> <init> ( ) V
iput-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mTableIdLookup : L androidx/collection/ArrayMap ;
array-length p1 , p2
new-array v2 , p1 , [ L java/lang/String ;
iput-object v2 , p0 , L androidx/room/InvalidationTracker ;-> mTableNames : [ L java/lang/String ;
:goto_0
if-ge v3 , p1 , :cond_0
aget-object v2 , p2 , v3
sget-object v4 , L java/util/Locale ;-> US : L java/util/Locale ;
invoke-virtual { v2 , v4 } , L java/lang/String ;-> toLowerCase ( L java/util/Locale ;) L java/lang/String ;
move-result-object v2
iget-object v4 , p0 , L androidx/room/InvalidationTracker ;-> mTableIdLookup : L androidx/collection/ArrayMap ;
invoke-static { v3 } , L java/lang/Integer ;-> valueOf ( I ) L java/lang/Integer ;
move-result-object v5
invoke-virtual { v4 , v2 , v5 } , L androidx/collection/ArrayMap ;-> put ( L java/lang/Object ;L java/lang/Object ;) L java/lang/Object ;
iget-object v4 , p0 , L androidx/room/InvalidationTracker ;-> mTableNames : [ L java/lang/String ;
aput-object v2 , v4 , v3
add-int/lit8 v3 , v3 , 0x1
goto :goto_0
:cond_0
array-length p1 , p2
new-array p1 , p1 , [J
iput-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mTableVersions : [J
iget-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mTableVersions : [J
invoke-static { p1 , v0 , v1 } , L java/util/Arrays ;-> fill ( [JJ ) V
return-void
.end method
.method private static appendTriggerName ( L java/lang/StringBuilder ;L java/lang/String ;L java/lang/String ;) V
.locals 1
const-string v0 , "`room_table_modification_trigger_"
invoke-virtual { p0 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { p0 , p1 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string p1 , "_"
invoke-virtual { p0 , p1 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { p0 , p2 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string p1 , "`"
invoke-virtual { p0 , p1 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
return-void
.end method
.method private startTrackingTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;I ) V
.locals 8
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mTableNames : [ L java/lang/String ;
aget-object v0 , v0 , p2
new-instance v1 , L java/lang/StringBuilder ;
invoke-direct { v1 } , L java/lang/StringBuilder ;-> <init> ( ) V
sget-object v2 , L androidx/room/InvalidationTracker ;-> TRIGGERS : [ L java/lang/String ;
array-length v3 , v2
const/4 v4 , 0x0
const/4 v5 , 0x0
:goto_0
if-ge v5 , v3 , :cond_0
aget-object v6 , v2 , v5
invoke-virtual { v1 , v4 } , L java/lang/StringBuilder ;-> setLength ( I ) V
const-string v7 , "CREATE TEMP TRIGGER IF NOT EXISTS "
invoke-virtual { v1 , v7 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-static { v1 , v0 , v6 } , L androidx/room/InvalidationTracker ;-> appendTriggerName ( L java/lang/StringBuilder ;L java/lang/String ;L java/lang/String ;) V
const-string v7 , " AFTER "
invoke-virtual { v1 , v7 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 , v6 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string v6 , " ON `"
invoke-virtual { v1 , v6 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string v6 , "` BEGIN INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "
invoke-virtual { v1 , v6 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 , p2 } , L java/lang/StringBuilder ;-> append ( I ) L java/lang/StringBuilder ;
const-string v6 , "); END"
invoke-virtual { v1 , v6 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object v6
invoke-interface { p1 , v6 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
add-int/lit8 v5 , v5 , 0x1
goto :goto_0
:cond_0
return-void
.end method
.method private stopTrackingTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;I ) V
.locals 7
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mTableNames : [ L java/lang/String ;
aget-object p2 , v0 , p2
new-instance v0 , L java/lang/StringBuilder ;
invoke-direct { v0 } , L java/lang/StringBuilder ;-> <init> ( ) V
sget-object v1 , L androidx/room/InvalidationTracker ;-> TRIGGERS : [ L java/lang/String ;
array-length v2 , v1
const/4 v3 , 0x0
const/4 v4 , 0x0
:goto_0
if-ge v4 , v2 , :cond_0
aget-object v5 , v1 , v4
invoke-virtual { v0 , v3 } , L java/lang/StringBuilder ;-> setLength ( I ) V
const-string v6 , "DROP TRIGGER IF EXISTS "
invoke-virtual { v0 , v6 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-static { v0 , p2 , v5 } , L androidx/room/InvalidationTracker ;-> appendTriggerName ( L java/lang/StringBuilder ;L java/lang/String ;L java/lang/String ;) V
invoke-virtual { v0 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object v5
invoke-interface { p1 , v5 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
add-int/lit8 v4 , v4 , 0x1
goto :goto_0
:cond_0
return-void
.end method
# virtual methods
.method public addObserver ( L androidx/room/InvalidationTracker$Observer ;) V
.locals 8
. param p1 # Landroidx/room/InvalidationTracker$Observer;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/WorkerThread ;
.end annotation
iget-object v0 , p1 , L androidx/room/InvalidationTracker$Observer ;-> mTables : [ L java/lang/String ;
array-length v1 , v0
new-array v1 , v1 , [I
array-length v2 , v0
array-length v3 , v0
new-array v3 , v3 , [J
const/4 v4 , 0x0
:goto_0
if-ge v4 , v2 , :cond_1
iget-object v5 , p0 , L androidx/room/InvalidationTracker ;-> mTableIdLookup : L androidx/collection/ArrayMap ;
aget-object v6 , v0 , v4
sget-object v7 , L java/util/Locale ;-> US : L java/util/Locale ;
invoke-virtual { v6 , v7 } , L java/lang/String ;-> toLowerCase ( L java/util/Locale ;) L java/lang/String ;
move-result-object v6
invoke-virtual { v5 , v6 } , L androidx/collection/ArrayMap ;-> get ( L java/lang/Object ;) L java/lang/Object ;
move-result-object v5
check-cast v5 , L java/lang/Integer ;
if-eqz v5 , :cond_0
invoke-virtual { v5 } , L java/lang/Integer ;-> intValue ( ) I
move-result v5
aput v5 , v1 , v4
iget-wide v5 , p0 , L androidx/room/InvalidationTracker ;-> mMaxVersion : J
aput-wide v5 , v3 , v4
add-int/lit8 v4 , v4 , 0x1
goto :goto_0
:cond_0
new-instance p1 , L java/lang/IllegalArgumentException ;
new-instance v1 , L java/lang/StringBuilder ;
const-string v2 , "There is no table with name "
invoke-direct { v1 , v2 } , L java/lang/StringBuilder ;-> <init> ( L java/lang/String ;) V
aget-object v0 , v0 , v4
invoke-virtual { v1 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object v0
invoke-direct { p1 , v0 } , L java/lang/IllegalArgumentException ;-> <init> ( L java/lang/String ;) V
throw p1
:cond_1
new-instance v2 , L androidx/room/InvalidationTracker$ObserverWrapper ;
invoke-direct { v2 , p1 , v1 , v0 , v3 } , L androidx/room/InvalidationTracker$ObserverWrapper ;-> <init> ( L androidx/room/InvalidationTracker$Observer ;[I[ L java/lang/String ;[J ) V
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mObserverMap : L androidx/arch/core/internal/SafeIterableMap ;
monitor-enter v0
:try_start_0
iget-object v3 , p0 , L androidx/room/InvalidationTracker ;-> mObserverMap : L androidx/arch/core/internal/SafeIterableMap ;
invoke-virtual { v3 , p1 , v2 } , L androidx/arch/core/internal/SafeIterableMap ;-> putIfAbsent ( L java/lang/Object ;L java/lang/Object ;) L java/lang/Object ;
move-result-object p1
check-cast p1 , L androidx/room/InvalidationTracker$ObserverWrapper ;
monitor-exit v0
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_0
if-nez p1 , :cond_2
iget-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mObservedTableTracker : L androidx/room/InvalidationTracker$ObservedTableTracker ;
invoke-virtual { p1 , v1 } , L androidx/room/InvalidationTracker$ObservedTableTracker ;-> onAdded ( [I ) Z
move-result p1
if-eqz p1 , :cond_2
invoke-virtual { p0 } , L androidx/room/InvalidationTracker ;-> syncTriggers ( ) V
:cond_2
return-void
:catchall_0
move-exception p1
:try_start_1
monitor-exit v0
:try_end_1
.catchall { :try_start_1 . . :try_end_1 } :catchall_0
throw p1
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
.end method
.method public addWeakObserver ( L androidx/room/InvalidationTracker$Observer ;) V
.locals 1
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
new-instance v0 , L androidx/room/InvalidationTracker$WeakObserver ;
invoke-direct { v0 , p0 , p1 } , L androidx/room/InvalidationTracker$WeakObserver ;-> <init> ( L androidx/room/InvalidationTracker ;L androidx/room/InvalidationTracker$Observer ;) V
invoke-virtual { p0 , v0 } , L androidx/room/InvalidationTracker ;-> addObserver ( L androidx/room/InvalidationTracker$Observer ;) V
return-void
.end method
.method ensureInitialization ( ) Z
.locals 3
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
invoke-virtual { v0 } , L androidx/room/RoomDatabase ;-> isOpen ( ) Z
move-result v0
const/4 v1 , 0x0
if-nez v0 , :cond_0
return v1
:cond_0
iget-boolean v0 , p0 , L androidx/room/InvalidationTracker ;-> mInitialized : Z
if-nez v0 , :cond_1
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
invoke-virtual { v0 } , L androidx/room/RoomDatabase ;-> getOpenHelper ( ) L androidx/sqlite/db/SupportSQLiteOpenHelper ;
move-result-object v0
invoke-interface { v0 } , L androidx/sqlite/db/SupportSQLiteOpenHelper ;-> getWritableDatabase ( ) L androidx/sqlite/db/SupportSQLiteDatabase ;
:cond_1
iget-boolean v0 , p0 , L androidx/room/InvalidationTracker ;-> mInitialized : Z
if-nez v0 , :cond_2
const-string v0 , "ROOM"
const-string v2 , "database is not initialized even though it is open"
invoke-static { v0 , v2 } , L android/util/Log ;-> e ( L java/lang/String ;L java/lang/String ;) I
return v1
:cond_2
const/4 v0 , 0x1
return v0
.end method
.method internalInit ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 1
monitor-enter p0
:try_start_0
iget-boolean v0 , p0 , L androidx/room/InvalidationTracker ;-> mInitialized : Z
if-eqz v0 , :cond_0
const-string p1 , "ROOM"
const-string v0 , "Invalidation tracker is initialized twice :/."
invoke-static { p1 , v0 } , L android/util/Log ;-> e ( L java/lang/String ;L java/lang/String ;) I
monitor-exit p0
return-void
:cond_0
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> beginTransaction ( ) V
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_1
:try_start_1
const-string v0 , "PRAGMA temp_store = MEMORY;"
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
const-string v0 , "PRAGMA recursive_triggers=\'ON\';"
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
const-string v0 , "CREATE TEMP TABLE room_table_modification_log(version INTEGER PRIMARY KEY AUTOINCREMENT, table_id INTEGER)"
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> setTransactionSuccessful ( ) V
:try_end_1
.catchall { :try_start_1 . . :try_end_1 } :catchall_0
:try_start_2
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> endTransaction ( ) V
invoke-virtual { p0 , p1 } , L androidx/room/InvalidationTracker ;-> syncTriggers ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
const-string v0 , "DELETE FROM room_table_modification_log WHERE version NOT IN( SELECT MAX(version) FROM room_table_modification_log GROUP BY table_id)"
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> compileStatement ( L java/lang/String ;) L androidx/sqlite/db/SupportSQLiteStatement ;
move-result-object p1
iput-object p1 , p0 , L androidx/room/InvalidationTracker ;-> mCleanupStatement : L androidx/sqlite/db/SupportSQLiteStatement ;
const/4 p1 , 0x1
iput-boolean p1 , p0 , L androidx/room/InvalidationTracker ;-> mInitialized : Z
monitor-exit p0
return-void
:catchall_0
move-exception v0
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> endTransaction ( ) V
throw v0
:catchall_1
move-exception p1
monitor-exit p0
:try_end_2
.catchall { :try_start_2 . . :try_end_2 } :catchall_1
throw p1
.end method
.method public refreshVersionsAsync ( ) V
.locals 3
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mPendingRefresh : L java/util/concurrent/atomic/AtomicBoolean ;
const/4 v1 , 0x0
const/4 v2 , 0x1
invoke-virtual { v0 , v1 , v2 } , L java/util/concurrent/atomic/AtomicBoolean ;-> compareAndSet ( ZZ ) Z
move-result v0
if-eqz v0 , :cond_0
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
invoke-virtual { v0 } , L androidx/room/RoomDatabase ;-> getQueryExecutor ( ) L java/util/concurrent/Executor ;
move-result-object v0
iget-object v1 , p0 , L androidx/room/InvalidationTracker ;-> mRefreshRunnable : L java/lang/Runnable ;
invoke-interface { v0 , v1 } , L java/util/concurrent/Executor ;-> execute ( L java/lang/Runnable ;) V
:cond_0
return-void
.end method
.method public refreshVersionsSync ( ) V
.locals 1
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
.annotation build L androidx/annotation/WorkerThread ;
.end annotation
invoke-virtual { p0 } , L androidx/room/InvalidationTracker ;-> syncTriggers ( ) V
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mRefreshRunnable : L java/lang/Runnable ;
invoke-interface { v0 } , L java/lang/Runnable ;-> run ( ) V
return-void
.end method
.method public removeObserver ( L androidx/room/InvalidationTracker$Observer ;) V
.locals 2
. param p1 # Landroidx/room/InvalidationTracker$Observer;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/WorkerThread ;
.end annotation
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mObserverMap : L androidx/arch/core/internal/SafeIterableMap ;
monitor-enter v0
:try_start_0
iget-object v1 , p0 , L androidx/room/InvalidationTracker ;-> mObserverMap : L androidx/arch/core/internal/SafeIterableMap ;
invoke-virtual { v1 , p1 } , L androidx/arch/core/internal/SafeIterableMap ;-> remove ( L java/lang/Object ;) L java/lang/Object ;
move-result-object p1
check-cast p1 , L androidx/room/InvalidationTracker$ObserverWrapper ;
monitor-exit v0
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_0
if-eqz p1 , :cond_0
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mObservedTableTracker : L androidx/room/InvalidationTracker$ObservedTableTracker ;
iget-object p1 , p1 , L androidx/room/InvalidationTracker$ObserverWrapper ;-> mTableIds : [I
invoke-virtual { v0 , p1 } , L androidx/room/InvalidationTracker$ObservedTableTracker ;-> onRemoved ( [I ) Z
move-result p1
if-eqz p1 , :cond_0
invoke-virtual { p0 } , L androidx/room/InvalidationTracker ;-> syncTriggers ( ) V
:cond_0
return-void
:catchall_0
move-exception p1
:try_start_1
monitor-exit v0
:try_end_1
.catchall { :try_start_1 . . :try_end_1 } :catchall_0
throw p1
.end method
.method syncTriggers ( ) V
.locals 1
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
invoke-virtual { v0 } , L androidx/room/RoomDatabase ;-> isOpen ( ) Z
move-result v0
if-nez v0 , :cond_0
return-void
:cond_0
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
invoke-virtual { v0 } , L androidx/room/RoomDatabase ;-> getOpenHelper ( ) L androidx/sqlite/db/SupportSQLiteOpenHelper ;
move-result-object v0
invoke-interface { v0 } , L androidx/sqlite/db/SupportSQLiteOpenHelper ;-> getWritableDatabase ( ) L androidx/sqlite/db/SupportSQLiteDatabase ;
move-result-object v0
invoke-virtual { p0 , v0 } , L androidx/room/InvalidationTracker ;-> syncTriggers ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
return-void
.end method
.method syncTriggers ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 5
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> inTransaction ( ) Z
move-result v0
if-eqz v0 , :cond_0
return-void
:cond_0
:goto_0
:try_start_0
iget-object v0 , p0 , L androidx/room/InvalidationTracker ;-> mDatabase : L androidx/room/RoomDatabase ;
invoke-virtual { v0 } , L androidx/room/RoomDatabase ;-> getCloseLock ( ) L java/util/concurrent/locks/Lock ;
move-result-object v0
invoke-interface { v0 } , L java/util/concurrent/locks/Lock ;-> lock ( ) V
:try_end_0
2019-02-17 02:24:41 +00:00
.catch L java/lang/IllegalStateException ; { :try_start_0 . . :try_end_0 } :catch_1
2019-02-04 20:08:30 +00:00
.catch L android/database/sqlite/SQLiteException ; { :try_start_0 . . :try_end_0 } :catch_0
:try_start_1
iget-object v1 , p0 , L androidx/room/InvalidationTracker ;-> mObservedTableTracker : L androidx/room/InvalidationTracker$ObservedTableTracker ;
invoke-virtual { v1 } , L androidx/room/InvalidationTracker$ObservedTableTracker ;-> getTablesToSync ( ) [I
move-result-object v1
:try_end_1
.catchall { :try_start_1 . . :try_end_1 } :catchall_1
if-nez v1 , :cond_1
:try_start_2
invoke-interface { v0 } , L java/util/concurrent/locks/Lock ;-> unlock ( ) V
:try_end_2
2019-02-17 02:24:41 +00:00
.catch L java/lang/IllegalStateException ; { :try_start_2 . . :try_end_2 } :catch_1
2019-02-04 20:08:30 +00:00
.catch L android/database/sqlite/SQLiteException ; { :try_start_2 . . :try_end_2 } :catch_0
return-void
:cond_1
:try_start_3
array-length v2 , v1
:try_end_3
.catchall { :try_start_3 . . :try_end_3 } :catchall_1
:try_start_4
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> beginTransaction ( ) V
const/4 v3 , 0x0
:goto_1
if-ge v3 , v2 , :cond_2
aget v4 , v1 , v3
packed-switch v4 , :pswitch_data_0
goto :goto_2
:pswitch_0
invoke-direct { p0 , p1 , v3 } , L androidx/room/InvalidationTracker ;-> stopTrackingTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;I ) V
goto :goto_2
:pswitch_1
invoke-direct { p0 , p1 , v3 } , L androidx/room/InvalidationTracker ;-> startTrackingTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;I ) V
:goto_2
add-int/lit8 v3 , v3 , 0x1
goto :goto_1
:cond_2
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> setTransactionSuccessful ( ) V
:try_end_4
.catchall { :try_start_4 . . :try_end_4 } :catchall_0
:try_start_5
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> endTransaction ( ) V
iget-object v1 , p0 , L androidx/room/InvalidationTracker ;-> mObservedTableTracker : L androidx/room/InvalidationTracker$ObservedTableTracker ;
invoke-virtual { v1 } , L androidx/room/InvalidationTracker$ObservedTableTracker ;-> onSyncCompleted ( ) V
:try_end_5
.catchall { :try_start_5 . . :try_end_5 } :catchall_1
:try_start_6
invoke-interface { v0 } , L java/util/concurrent/locks/Lock ;-> unlock ( ) V
:try_end_6
2019-02-17 02:24:41 +00:00
.catch L java/lang/IllegalStateException ; { :try_start_6 . . :try_end_6 } :catch_1
2019-02-04 20:08:30 +00:00
.catch L android/database/sqlite/SQLiteException ; { :try_start_6 . . :try_end_6 } :catch_0
goto :goto_0
:catchall_0
move-exception v1
:try_start_7
invoke-interface { p1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> endTransaction ( ) V
throw v1
:try_end_7
.catchall { :try_start_7 . . :try_end_7 } :catchall_1
:catchall_1
move-exception p1
:try_start_8
invoke-interface { v0 } , L java/util/concurrent/locks/Lock ;-> unlock ( ) V
throw p1
:try_end_8
2019-02-17 02:24:41 +00:00
.catch L java/lang/IllegalStateException ; { :try_start_8 . . :try_end_8 } :catch_1
2019-02-04 20:08:30 +00:00
.catch L android/database/sqlite/SQLiteException ; { :try_start_8 . . :try_end_8 } :catch_0
:catch_0
move-exception p1
2019-02-17 02:24:41 +00:00
goto :goto_3
:catch_1
move-exception p1
:goto_3
2019-02-04 20:08:30 +00:00
const-string v0 , "ROOM"
const-string v1 , "Cannot run invalidation tracker. Is the db closed?"
invoke-static { v0 , v1 , p1 } , L android/util/Log ;-> e ( L java/lang/String ;L java/lang/String ;L java/lang/Throwable ;) I
return-void
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
.end packed-switch
.end method