2019-07-24 11:27:29 +00:00
|
|
|
.class public Landroidx/work/impl/utils/Preferences;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "Preferences.java"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
2019-12-06 03:29:40 +00:00
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Landroidx/work/impl/utils/Preferences$LastCancelAllLiveData;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final KEY_LAST_CANCEL_ALL_TIME_MS:Ljava/lang/String; = "last_cancel_all_time_ms"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final KEY_RESCHEDULE_NEEDED:Ljava/lang/String; = "reschedule_needed"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final PREFERENCES_FILE_NAME:Ljava/lang/String; = "androidx.work.util.preferences"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mContext:Landroid/content/Context;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mSharedPreferences:Landroid/content/SharedPreferences;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
|
|
.locals 0
|
2019-12-06 03:29:40 +00:00
|
|
|
.param p1 # Landroid/content/Context;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/utils/Preferences;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Landroid/content/SharedPreferences;)V
|
|
|
|
.locals 0
|
2019-12-06 03:29:40 +00:00
|
|
|
.param p1 # Landroid/content/SharedPreferences;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
|
|
.end annotation
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/work/impl/utils/Preferences;->mSharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private getSharedPreferences()Landroid/content/SharedPreferences;
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
const-class v0, Landroidx/work/impl/utils/Preferences;
|
|
|
|
|
|
|
|
monitor-enter v0
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/utils/Preferences;->mSharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/utils/Preferences;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
const-string v2, "androidx.work.util.preferences"
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
iput-object v1, p0, Landroidx/work/impl/utils/Preferences;->mSharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v1, p0, Landroidx/work/impl/utils/Preferences;->mSharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
monitor-exit v0
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:catchall_0
|
|
|
|
move-exception v1
|
|
|
|
|
|
|
|
monitor-exit v0
|
|
|
|
:try_end_0
|
|
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
|
|
|
|
throw v1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public getLastCancelAllTimeMillis()J
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/utils/Preferences;->getSharedPreferences()Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "last_cancel_all_time_ms"
|
|
|
|
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
|
|
|
|
invoke-interface {v0, v1, v2, v3}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
return-wide v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getLastCancelAllTimeMillisLiveData()Landroidx/lifecycle/LiveData;
|
|
|
|
.locals 2
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Landroidx/lifecycle/LiveData<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Landroidx/work/impl/utils/Preferences$LastCancelAllLiveData;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/utils/Preferences;->getSharedPreferences()Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Landroidx/work/impl/utils/Preferences$LastCancelAllLiveData;-><init>(Landroid/content/SharedPreferences;)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public needsReschedule()Z
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/utils/Preferences;->getSharedPreferences()Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "reschedule_needed"
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setLastCancelAllTimeMillis(J)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/utils/Preferences;->getSharedPreferences()Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "last_cancel_all_time_ms"
|
|
|
|
|
|
|
|
invoke-interface {v0, v1, p1, p2}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setNeedsReschedule(Z)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/utils/Preferences;->getSharedPreferences()Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "reschedule_needed"
|
|
|
|
|
|
|
|
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|