granularity level: instruction
.class public Landroidx/core/content/ContextCompat;
.super Ljava/lang/Object;
.source "ContextCompat.java"
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/core/content/ContextCompat$LegacyServiceMapHolder;,
Landroidx/core/content/ContextCompat$MainHandlerExecutor;
}
.end annotation
.field private static final TAG:Ljava/lang/String; = "ContextCompat"
.field private static final sLock:Ljava/lang/Object;
.field private static sTempValue:Landroid/util/TypedValue;
.method static constructor <clinit>()V
.locals 1
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
sput-object v0, Landroidx/core/content/ContextCompat;->sLock:Ljava/lang/Object;
return-void
.end method
.method protected constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I
.locals 2
if-eqz p1, :cond_0
invoke-static {}, Landroid/os/Process;->myPid()I
move-result v0
invoke-static {}, Landroid/os/Process;->myUid()I
move-result v1
invoke-virtual {p0, p1, v0, v1}, Landroid/content/Context;->checkPermission(Ljava/lang/String;II)I
move-result p0
return p0
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "permission is null"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static createDeviceProtectedStorageContext(Landroid/content/Context;)Landroid/content/Context;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->createDeviceProtectedStorageContext()Landroid/content/Context;
move-result-object p0
return-object p0
:cond_0
const/4 p0, 0x0
return-object p0
.end method
.method private static declared-synchronized createFilesDir(Ljava/io/File;)Ljava/io/File;
.locals 4
const-class v0, Landroidx/core/content/ContextCompat;
monitor-enter v0
:try_start_0
invoke-virtual {p0}, Ljava/io/File;->exists()Z
move-result v1
if-nez v1, :cond_1
invoke-virtual {p0}, Ljava/io/File;->mkdirs()Z
move-result v1
if-nez v1, :cond_1
invoke-virtual {p0}, Ljava/io/File;->exists()Z
move-result v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v1, :cond_0
monitor-exit v0
return-object p0
:try_start_1
:cond_0
const-string v1, "ContextCompat"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Unable to create files subdir "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p0}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object p0
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-static {v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const/4 p0, 0x0
monitor-exit v0
return-object p0
:cond_1
monitor-exit v0
return-object p0
:catchall_0
move-exception p0
monitor-exit v0
throw p0
.end method
.method public static getCodeCacheDir(Landroid/content/Context;)Ljava/io/File;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getCodeCacheDir()Ljava/io/File;
move-result-object p0
return-object p0
:cond_0
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object p0
new-instance v0, Ljava/io/File;
iget-object p0, p0, Landroid/content/pm/ApplicationInfo;->dataDir:Ljava/lang/String;
const-string v1, "code_cache"
invoke-direct {v0, p0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-static {v0}, Landroidx/core/content/ContextCompat;->createFilesDir(Ljava/io/File;)Ljava/io/File;
move-result-object p0
return-object p0
.end method
.method public static getColor(Landroid/content/Context;I)I
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->getColor(I)I
move-result p0
return p0
:cond_0
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object p0
invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getColor(I)I
move-result p0
return p0
.end method
.method public static getColorStateList(Landroid/content/Context;I)Landroid/content/res/ColorStateList;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object p0
return-object p0
:cond_0
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object p0
invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object p0
return-object p0
.end method
.method public static getDataDir(Landroid/content/Context;)Ljava/io/File;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getDataDir()Ljava/io/File;
move-result-object p0
return-object p0
:cond_0
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object p0
iget-object p0, p0, Landroid/content/pm/ApplicationInfo;->dataDir:Ljava/lang/String;
if-eqz p0, :cond_1
new-instance v0, Ljava/io/File;
invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
goto :goto_0
:cond_1
const/4 v0, 0x0
:goto_0
return-object v0
.end method
.method public static getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
.locals 4
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object p0
return-object p0
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x10
if-lt v0, v1, :cond_1
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object p0
invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object p0
return-object p0
:cond_1
sget-object v0, Landroidx/core/content/ContextCompat;->sLock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
sget-object v1, Landroidx/core/content/ContextCompat;->sTempValue:Landroid/util/TypedValue;
if-nez v1, :cond_2
new-instance v1, Landroid/util/TypedValue;
invoke-direct {v1}, Landroid/util/TypedValue;-><init>()V
sput-object v1, Landroidx/core/content/ContextCompat;->sTempValue:Landroid/util/TypedValue;
:cond_2
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
sget-object v2, Landroidx/core/content/ContextCompat;->sTempValue:Landroid/util/TypedValue;
const/4 v3, 0x1
invoke-virtual {v1, p1, v2, v3}, Landroid/content/res/Resources;->getValue(ILandroid/util/TypedValue;Z)V
sget-object p1, Landroidx/core/content/ContextCompat;->sTempValue:Landroid/util/TypedValue;
iget p1, p1, Landroid/util/TypedValue;->resourceId:I
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object p0
invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object p0
return-object p0
:catchall_0
move-exception p0
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p0
.end method
.method public static getExternalCacheDirs(Landroid/content/Context;)[Ljava/io/File;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getExternalCacheDirs()[Ljava/io/File;
move-result-object p0
return-object p0
:cond_0
const/4 v0, 0x1
new-array v0, v0, [Ljava/io/File;
const/4 v1, 0x0
invoke-virtual {p0}, Landroid/content/Context;->getExternalCacheDir()Ljava/io/File;
move-result-object p0
aput-object p0, v0, v1
return-object v0
.end method
.method public static getExternalFilesDirs(Landroid/content/Context;Ljava/lang/String;)[Ljava/io/File;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->getExternalFilesDirs(Ljava/lang/String;)[Ljava/io/File;
move-result-object p0
return-object p0
:cond_0
const/4 v0, 0x1
new-array v0, v0, [Ljava/io/File;
const/4 v1, 0x0
invoke-virtual {p0, p1}, Landroid/content/Context;->getExternalFilesDir(Ljava/lang/String;)Ljava/io/File;
move-result-object p0
aput-object p0, v0, v1
return-object v0
.end method
.method public static getMainExecutor(Landroid/content/Context;)Ljava/util/concurrent/Executor;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x1c
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getMainExecutor()Ljava/util/concurrent/Executor;
move-result-object p0
return-object p0
:cond_0
new-instance v0, Landroidx/core/content/ContextCompat$MainHandlerExecutor;
new-instance v1, Landroid/os/Handler;
invoke-virtual {p0}, Landroid/content/Context;->getMainLooper()Landroid/os/Looper;
move-result-object p0
invoke-direct {v1, p0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
invoke-direct {v0, v1}, Landroidx/core/content/ContextCompat$MainHandlerExecutor;-><init>(Landroid/os/Handler;)V
return-object v0
.end method
.method public static getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getNoBackupFilesDir()Ljava/io/File;
move-result-object p0
return-object p0
:cond_0
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object p0
new-instance v0, Ljava/io/File;
iget-object p0, p0, Landroid/content/pm/ApplicationInfo;->dataDir:Ljava/lang/String;
const-string v1, "no_backup"
invoke-direct {v0, p0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-static {v0}, Landroidx/core/content/ContextCompat;->createFilesDir(Ljava/io/File;)Ljava/io/File;
move-result-object p0
return-object p0
.end method
.method public static getObbDirs(Landroid/content/Context;)[Ljava/io/File;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getObbDirs()[Ljava/io/File;
move-result-object p0
return-object p0
:cond_0
const/4 v0, 0x1
new-array v0, v0, [Ljava/io/File;
const/4 v1, 0x0
invoke-virtual {p0}, Landroid/content/Context;->getObbDir()Ljava/io/File;
move-result-object p0
aput-object p0, v0, v1
return-object v0
.end method
.method public static getSystemService(Landroid/content/Context;Ljava/lang/Class;)Ljava/lang/Object;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Landroid/content/Context;",
"Ljava/lang/Class<",
"TT;>;)TT;"
}
.end annotation
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->getSystemService(Ljava/lang/Class;)Ljava/lang/Object;
move-result-object p0
return-object p0
:cond_0
invoke-static {p0, p1}, Landroidx/core/content/ContextCompat;->getSystemServiceName(Landroid/content/Context;Ljava/lang/Class;)Ljava/lang/String;
move-result-object p1
if-eqz p1, :cond_1
invoke-virtual {p0, p1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
goto :goto_0
:cond_1
const/4 p0, 0x0
:goto_0
return-object p0
.end method
.method public static getSystemServiceName(Landroid/content/Context;Ljava/lang/Class;)Ljava/lang/String;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/lang/Class<",
"*>;)",
"Ljava/lang/String;"
}
.end annotation
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->getSystemServiceName(Ljava/lang/Class;)Ljava/lang/String;
move-result-object p0
return-object p0
:cond_0
sget-object p0, Landroidx/core/content/ContextCompat$LegacyServiceMapHolder;->SERVICES:Ljava/util/HashMap;
invoke-virtual {p0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Ljava/lang/String;
return-object p0
.end method
.method public static isDeviceProtectedStorage(Landroid/content/Context;)Z
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->isDeviceProtectedStorage()Z
move-result p0
return p0
:cond_0
const/4 p0, 0x0
return p0
.end method
.method public static startActivities(Landroid/content/Context;[Landroid/content/Intent;)Z
.locals 1
const/4 v0, 0x0
invoke-static {p0, p1, v0}, Landroidx/core/content/ContextCompat;->startActivities(Landroid/content/Context;[Landroid/content/Intent;Landroid/os/Bundle;)Z
move-result p0
return p0
.end method
.method public static startActivities(Landroid/content/Context;[Landroid/content/Intent;Landroid/os/Bundle;)Z
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x10
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1, p2}, Landroid/content/Context;->startActivities([Landroid/content/Intent;Landroid/os/Bundle;)V
goto :goto_0
:cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->startActivities([Landroid/content/Intent;)V
:goto_0
const/4 p0, 0x1
return p0
.end method
.method public static startActivity(Landroid/content/Context;Landroid/content/Intent;Landroid/os/Bundle;)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x10
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1, p2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;Landroid/os/Bundle;)V
goto :goto_0
:cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
:goto_0
return-void
.end method
.method public static startForegroundService(Landroid/content/Context;Landroid/content/Intent;)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x1a
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->startForegroundService(Landroid/content/Intent;)Landroid/content/ComponentName;
goto :goto_0
:cond_0
invoke-virtual {p0, p1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
:goto_0
return-void
.end method