2019-02-04 20:08:30 +00:00
.class public abstract L androidx/work/impl/WorkDatabase ;
.super L androidx/room/RoomDatabase ;
2019-02-04 20:29:01 +00:00
.source "WorkDatabase.java"
2019-02-04 20:08:30 +00:00
# annotations
.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/room/Database ;
entities = {
L androidx/work/impl/model/Dependency ;,
L androidx/work/impl/model/WorkSpec ;,
L androidx/work/impl/model/WorkTag ;,
L androidx/work/impl/model/SystemIdInfo ;,
L androidx/work/impl/model/WorkName ;
}
2019-02-04 20:32:01 +00:00
version = 0x5
2019-02-04 20:08:30 +00:00
.end annotation
.annotation build L androidx/room/TypeConverters ;
value = {
L androidx/work/Data ;,
L androidx/work/impl/model/WorkTypeConverters ;
}
.end annotation
# static fields
.field private static final CLEANUP_SQL : L java/lang/String ; = "UPDATE workspec SET state=0, schedule_requested_at=-1 WHERE state=1"
.field private static final DB_NAME : L java/lang/String ; = "androidx.work.workdb"
.field private static final PRUNE_SQL_FORMAT_PREFIX : L java/lang/String ; = "DELETE FROM workspec WHERE state IN (2, 3, 5) AND (period_start_time + minimum_retention_duration) < "
.field private static final PRUNE_SQL_FORMAT_SUFFIX : L java/lang/String ; = " AND (SELECT COUNT(*)=0 FROM dependency WHERE prerequisite_id=id AND work_spec_id NOT IN (SELECT id FROM workspec WHERE state IN (2, 3, 5)))"
.field private static final PRUNE_THRESHOLD_MILLIS : J
# direct methods
.method static constructor <clinit> ( ) V
.locals 3
sget-object v0 , L java/util/concurrent/TimeUnit ;-> DAYS : L java/util/concurrent/TimeUnit ;
const-wide/16 v1 , 0x7
invoke-virtual { v0 , v1 , v2 } , L java/util/concurrent/TimeUnit ;-> toMillis ( J ) J
move-result-wide v0
sput-wide v0 , L androidx/work/impl/WorkDatabase ;-> PRUNE_THRESHOLD_MILLIS : J
return-void
.end method
.method public constructor <init> ( ) V
.locals 0
invoke-direct { p0 } , L androidx/room/RoomDatabase ;-> <init> ( ) V
return-void
.end method
.method public static create ( L android/content/Context ;Z ) L androidx/work/impl/WorkDatabase ;
.locals 6
if-eqz p1 , :cond_0
const-class p1 , L androidx/work/impl/WorkDatabase ;
invoke-static { p0 , p1 } , L androidx/room/Room ;-> inMemoryDatabaseBuilder ( L android/content/Context ;L java/lang/Class ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p1
invoke-virtual { p1 } , L androidx/room/RoomDatabase$Builder ;-> allowMainThreadQueries ( ) L androidx/room/RoomDatabase$Builder ;
move-result-object p1
goto :goto_0
:cond_0
const-class p1 , L androidx/work/impl/WorkDatabase ;
const-string v0 , "androidx.work.workdb"
invoke-static { p0 , p1 , v0 } , L androidx/room/Room ;-> databaseBuilder ( L android/content/Context ;L java/lang/Class ;L java/lang/String ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p1
:goto_0
invoke-static { } , L androidx/work/impl/WorkDatabase ;-> generateCleanupCallback ( ) L androidx/room/RoomDatabase$Callback ;
move-result-object v0
invoke-virtual { p1 , v0 } , L androidx/room/RoomDatabase$Builder ;-> addCallback ( L androidx/room/RoomDatabase$Callback ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p1
const/4 v0 , 0x1
new-array v1 , v0 , [ L androidx/room/migration/Migration ;
sget-object v2 , L androidx/work/impl/WorkDatabaseMigrations ;-> MIGRATION_1_2 : L androidx/room/migration/Migration ;
const/4 v3 , 0x0
aput-object v2 , v1 , v3
invoke-virtual { p1 , v1 } , L androidx/room/RoomDatabase$Builder ;-> addMigrations ( [ L androidx/room/migration/Migration ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p1
new-array v1 , v0 , [ L androidx/room/migration/Migration ;
new-instance v2 , L androidx/work/impl/WorkDatabaseMigrations$WorkMigration ;
const/4 v4 , 0x2
const/4 v5 , 0x3
invoke-direct { v2 , p0 , v4 , v5 } , L androidx/work/impl/WorkDatabaseMigrations$WorkMigration ;-> <init> ( L android/content/Context ;II ) V
aput-object v2 , v1 , v3
invoke-virtual { p1 , v1 } , L androidx/room/RoomDatabase$Builder ;-> addMigrations ( [ L androidx/room/migration/Migration ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p0
new-array p1 , v0 , [ L androidx/room/migration/Migration ;
2019-02-04 20:32:01 +00:00
sget-object v1 , L androidx/work/impl/WorkDatabaseMigrations ;-> MIGRATION_3_4 : L androidx/room/migration/Migration ;
aput-object v1 , p1 , v3
invoke-virtual { p0 , p1 } , L androidx/room/RoomDatabase$Builder ;-> addMigrations ( [ L androidx/room/migration/Migration ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p0
new-array p1 , v0 , [ L androidx/room/migration/Migration ;
sget-object v0 , L androidx/work/impl/WorkDatabaseMigrations ;-> MIGRATION_4_5 : L androidx/room/migration/Migration ;
2019-02-04 20:08:30 +00:00
aput-object v0 , p1 , v3
invoke-virtual { p0 , p1 } , L androidx/room/RoomDatabase$Builder ;-> addMigrations ( [ L androidx/room/migration/Migration ;) L androidx/room/RoomDatabase$Builder ;
move-result-object p0
invoke-virtual { p0 } , L androidx/room/RoomDatabase$Builder ;-> fallbackToDestructiveMigration ( ) L androidx/room/RoomDatabase$Builder ;
move-result-object p0
invoke-virtual { p0 } , L androidx/room/RoomDatabase$Builder ;-> build ( ) L androidx/room/RoomDatabase ;
move-result-object p0
check-cast p0 , L androidx/work/impl/WorkDatabase ;
return-object p0
.end method
.method static generateCleanupCallback ( ) L androidx/room/RoomDatabase$Callback ;
.locals 1
new-instance v0 , L androidx/work/impl/WorkDatabase$1 ;
invoke-direct { v0 } , L androidx/work/impl/WorkDatabase$1 ;-> <init> ( ) V
return-object v0
.end method
.method static getPruneDate ( ) J
.locals 4
invoke-static { } , L java/lang/System ;-> currentTimeMillis ( ) J
move-result-wide v0
sget-wide v2 , L androidx/work/impl/WorkDatabase ;-> PRUNE_THRESHOLD_MILLIS : J
sub-long/2addr v0 , v2
return-wide v0
.end method
.method static getPruneSQL ( ) L java/lang/String ;
.locals 3
new-instance v0 , L java/lang/StringBuilder ;
const-string v1 , "DELETE FROM workspec WHERE state IN (2, 3, 5) AND (period_start_time + minimum_retention_duration) < "
invoke-direct { v0 , v1 } , L java/lang/StringBuilder ;-> <init> ( L java/lang/String ;) V
invoke-static { } , L androidx/work/impl/WorkDatabase ;-> getPruneDate ( ) J
move-result-wide v1
invoke-virtual { v0 , v1 , v2 } , L java/lang/StringBuilder ;-> append ( J ) L java/lang/StringBuilder ;
const-string v1 , " AND (SELECT COUNT(*)=0 FROM dependency WHERE prerequisite_id=id AND work_spec_id NOT IN (SELECT id FROM workspec WHERE state IN (2, 3, 5)))"
invoke-virtual { v0 , v1 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v0 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object v0
return-object v0
.end method
# virtual methods
.method public abstract dependencyDao ( ) L androidx/work/impl/model/DependencyDao ;
.end method
.method public abstract systemIdInfoDao ( ) L androidx/work/impl/model/SystemIdInfoDao ;
.end method
.method public abstract workNameDao ( ) L androidx/work/impl/model/WorkNameDao ;
.end method
.method public abstract workSpecDao ( ) L androidx/work/impl/model/WorkSpecDao ;
.end method
.method public abstract workTagDao ( ) L androidx/work/impl/model/WorkTagDao ;
.end method