1205 lines
33 KiB
Smali
1205 lines
33 KiB
Smali
.class public Landroidx/core/provider/FontsContractCompat;
|
|
.super Ljava/lang/Object;
|
|
.source "FontsContractCompat.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/core/provider/FontsContractCompat$FontRequestCallback;,
|
|
Landroidx/core/provider/FontsContractCompat$FontFamilyResult;,
|
|
Landroidx/core/provider/FontsContractCompat$FontInfo;,
|
|
Landroidx/core/provider/FontsContractCompat$TypefaceResult;,
|
|
Landroidx/core/provider/FontsContractCompat$Columns;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final BACKGROUND_THREAD_KEEP_ALIVE_DURATION_MS:I = 0x2710
|
|
|
|
.field public static final PARCEL_FONT_RESULTS:Ljava/lang/String; = "font_results"
|
|
|
|
.field static final RESULT_CODE_PROVIDER_NOT_FOUND:I = -0x1
|
|
|
|
.field static final RESULT_CODE_WRONG_CERTIFICATES:I = -0x2
|
|
|
|
.field private static final sBackgroundThread:Landroidx/core/provider/SelfDestructiveThread;
|
|
|
|
.field private static final sByteArrayComparator:Ljava/util/Comparator;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Comparator<",
|
|
"[B>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field static final sLock:Ljava/lang/Object;
|
|
|
|
.field static final sPendingReplies:Landroidx/collection/SimpleArrayMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/collection/SimpleArrayMap<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/ArrayList<",
|
|
"Landroidx/core/provider/SelfDestructiveThread$ReplyCallback<",
|
|
"Landroidx/core/provider/FontsContractCompat$TypefaceResult;",
|
|
">;>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field static final sTypefaceCache:Landroidx/collection/LruCache;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/collection/LruCache<",
|
|
"Ljava/lang/String;",
|
|
"Landroid/graphics/Typeface;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 4
|
|
|
|
new-instance v0, Landroidx/collection/LruCache;
|
|
|
|
const/16 v1, 0x10
|
|
|
|
invoke-direct {v0, v1}, Landroidx/collection/LruCache;-><init>(I)V
|
|
|
|
sput-object v0, Landroidx/core/provider/FontsContractCompat;->sTypefaceCache:Landroidx/collection/LruCache;
|
|
|
|
new-instance v0, Landroidx/core/provider/SelfDestructiveThread;
|
|
|
|
const-string v1, "fonts"
|
|
|
|
const/16 v2, 0xa
|
|
|
|
const/16 v3, 0x2710
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Landroidx/core/provider/SelfDestructiveThread;-><init>(Ljava/lang/String;II)V
|
|
|
|
sput-object v0, Landroidx/core/provider/FontsContractCompat;->sBackgroundThread:Landroidx/core/provider/SelfDestructiveThread;
|
|
|
|
new-instance v0, Ljava/lang/Object;
|
|
|
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
|
|
|
sput-object v0, Landroidx/core/provider/FontsContractCompat;->sLock:Ljava/lang/Object;
|
|
|
|
new-instance v0, Landroidx/collection/SimpleArrayMap;
|
|
|
|
invoke-direct {v0}, Landroidx/collection/SimpleArrayMap;-><init>()V
|
|
|
|
sput-object v0, Landroidx/core/provider/FontsContractCompat;->sPendingReplies:Landroidx/collection/SimpleArrayMap;
|
|
|
|
new-instance v0, Landroidx/core/provider/FontsContractCompat$5;
|
|
|
|
invoke-direct {v0}, Landroidx/core/provider/FontsContractCompat$5;-><init>()V
|
|
|
|
sput-object v0, Landroidx/core/provider/FontsContractCompat;->sByteArrayComparator:Ljava/util/Comparator;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static buildTypeface(Landroid/content/Context;Landroid/os/CancellationSignal;[Landroidx/core/provider/FontsContractCompat$FontInfo;)Landroid/graphics/Typeface;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, p1, p2, v0}, Landroidx/core/graphics/TypefaceCompat;->createFromFontInfo(Landroid/content/Context;Landroid/os/CancellationSignal;[Landroidx/core/provider/FontsContractCompat$FontInfo;I)Landroid/graphics/Typeface;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static convertToByteArrayList([Landroid/content/pm/Signature;)Ljava/util/List;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"([",
|
|
"Landroid/content/pm/Signature;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"[B>;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
array-length v2, p0
|
|
|
|
if-ge v1, v2, :cond_0
|
|
|
|
aget-object v2, p0, v1
|
|
|
|
invoke-virtual {v2}, Landroid/content/pm/Signature;->toByteArray()[B
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static equalsByteArrayList(Ljava/util/List;Ljava/util/List;)Z
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"[B>;",
|
|
"Ljava/util/List<",
|
|
"[B>;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
return v2
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
if-ge v0, v1, :cond_2
|
|
|
|
invoke-interface {p0, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, [B
|
|
|
|
invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, [B
|
|
|
|
invoke-static {v1, v3}, Ljava/util/Arrays;->equals([B[B)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
return v2
|
|
|
|
:cond_1
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static fetchFonts(Landroid/content/Context;Landroid/os/CancellationSignal;Landroidx/core/provider/FontRequest;)Landroidx/core/provider/FontsContractCompat$FontFamilyResult;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Landroid/content/pm/PackageManager$NameNotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, p2, v1}, Landroidx/core/provider/FontsContractCompat;->getProvider(Landroid/content/pm/PackageManager;Landroidx/core/provider/FontRequest;Landroid/content/res/Resources;)Landroid/content/pm/ProviderInfo;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance p0, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
const/4 p2, 0x0
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;-><init>(I[Landroidx/core/provider/FontsContractCompat$FontInfo;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
iget-object v0, v0, Landroid/content/pm/ProviderInfo;->authority:Ljava/lang/String;
|
|
|
|
invoke-static {p0, p2, v0, p1}, Landroidx/core/provider/FontsContractCompat;->getFontFromProvider(Landroid/content/Context;Landroidx/core/provider/FontRequest;Ljava/lang/String;Landroid/os/CancellationSignal;)[Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
|
|
move-result-object p0
|
|
|
|
new-instance p1, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;
|
|
|
|
const/4 p2, 0x0
|
|
|
|
invoke-direct {p1, p2, p0}, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;-><init>(I[Landroidx/core/provider/FontsContractCompat$FontInfo;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private static getCertificates(Landroidx/core/provider/FontRequest;Landroid/content/res/Resources;)Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroidx/core/provider/FontRequest;",
|
|
"Landroid/content/res/Resources;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Ljava/util/List<",
|
|
"[B>;>;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Landroidx/core/provider/FontRequest;->getCertificates()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroidx/core/provider/FontRequest;->getCertificates()Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroidx/core/provider/FontRequest;->getCertificatesArrayResId()I
|
|
|
|
move-result p0
|
|
|
|
invoke-static {p1, p0}, Landroidx/core/content/res/FontResourcesParserCompat;->readCerts(Landroid/content/res/Resources;I)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static getFontFromProvider(Landroid/content/Context;Landroidx/core/provider/FontRequest;Ljava/lang/String;Landroid/os/CancellationSignal;)[Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
.locals 19
|
|
|
|
move-object/from16 v0, p2
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
new-instance v2, Landroid/net/Uri$Builder;
|
|
|
|
invoke-direct {v2}, Landroid/net/Uri$Builder;-><init>()V
|
|
|
|
const-string v3, "content"
|
|
|
|
invoke-virtual {v2, v3}, Landroid/net/Uri$Builder;->scheme(Ljava/lang/String;)Landroid/net/Uri$Builder;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, v0}, Landroid/net/Uri$Builder;->authority(Ljava/lang/String;)Landroid/net/Uri$Builder;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Landroid/net/Uri$Builder;->build()Landroid/net/Uri;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v4, Landroid/net/Uri$Builder;
|
|
|
|
invoke-direct {v4}, Landroid/net/Uri$Builder;-><init>()V
|
|
|
|
invoke-virtual {v4, v3}, Landroid/net/Uri$Builder;->scheme(Ljava/lang/String;)Landroid/net/Uri$Builder;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3, v0}, Landroid/net/Uri$Builder;->authority(Ljava/lang/String;)Landroid/net/Uri$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v3, "file"
|
|
|
|
invoke-virtual {v0, v3}, Landroid/net/Uri$Builder;->appendPath(Ljava/lang/String;)Landroid/net/Uri$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/net/Uri$Builder;->build()Landroid/net/Uri;
|
|
|
|
move-result-object v0
|
|
|
|
:try_start_0
|
|
sget v4, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
const/16 v5, 0x10
|
|
|
|
const-string v7, "font_variation_settings"
|
|
|
|
const/4 v9, 0x2
|
|
|
|
const/4 v10, 0x7
|
|
|
|
const-string v11, "result_code"
|
|
|
|
const-string v12, "font_italic"
|
|
|
|
const-string v13, "font_weight"
|
|
|
|
const-string v14, "font_ttc_index"
|
|
|
|
const-string v15, "file_id"
|
|
|
|
const-string v3, "_id"
|
|
|
|
const/4 v6, 0x1
|
|
|
|
const/4 v8, 0x0
|
|
|
|
if-le v4, v5, :cond_0
|
|
|
|
:try_start_1
|
|
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v10, v10, [Ljava/lang/String;
|
|
|
|
aput-object v3, v10, v8
|
|
|
|
aput-object v15, v10, v6
|
|
|
|
aput-object v14, v10, v9
|
|
|
|
const/4 v5, 0x3
|
|
|
|
aput-object v7, v10, v5
|
|
|
|
const/4 v5, 0x4
|
|
|
|
aput-object v13, v10, v5
|
|
|
|
const/4 v5, 0x5
|
|
|
|
aput-object v12, v10, v5
|
|
|
|
const/4 v5, 0x6
|
|
|
|
aput-object v11, v10, v5
|
|
|
|
const-string v7, "query = ?"
|
|
|
|
new-array v9, v6, [Ljava/lang/String;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Landroidx/core/provider/FontRequest;->getQuery()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
aput-object v5, v9, v8
|
|
|
|
const/16 v16, 0x0
|
|
|
|
move-object v5, v2
|
|
|
|
move-object/from16 v18, v1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
move-object v6, v10
|
|
|
|
const/4 v10, 0x0
|
|
|
|
move-object v8, v9
|
|
|
|
move-object/from16 v9, v16
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move-object/from16 v10, p3
|
|
|
|
invoke-virtual/range {v4 .. v10}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/database/Cursor;
|
|
|
|
move-result-object v4
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object/from16 v18, v1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v6, v10, [Ljava/lang/String;
|
|
|
|
aput-object v3, v6, v1
|
|
|
|
const/4 v5, 0x1
|
|
|
|
aput-object v15, v6, v5
|
|
|
|
aput-object v14, v6, v9
|
|
|
|
const/4 v5, 0x3
|
|
|
|
aput-object v7, v6, v5
|
|
|
|
const/4 v5, 0x4
|
|
|
|
aput-object v13, v6, v5
|
|
|
|
const/4 v5, 0x5
|
|
|
|
aput-object v12, v6, v5
|
|
|
|
const/4 v5, 0x6
|
|
|
|
aput-object v11, v6, v5
|
|
|
|
const-string v7, "query = ?"
|
|
|
|
const/4 v5, 0x1
|
|
|
|
new-array v8, v5, [Ljava/lang/String;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Landroidx/core/provider/FontRequest;->getQuery()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
aput-object v5, v8, v1
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v5, v2
|
|
|
|
invoke-virtual/range {v4 .. v9}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
|
|
|
move-result-object v4
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
:goto_0
|
|
if-eqz v4, :cond_7
|
|
|
|
:try_start_2
|
|
invoke-interface {v4}, Landroid/database/Cursor;->getCount()I
|
|
|
|
move-result v5
|
|
|
|
if-lez v5, :cond_7
|
|
|
|
invoke-interface {v4, v11}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v5
|
|
|
|
new-instance v6, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v4, v3}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v3
|
|
|
|
invoke-interface {v4, v15}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v7
|
|
|
|
invoke-interface {v4, v14}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v8
|
|
|
|
invoke-interface {v4, v13}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v9
|
|
|
|
invoke-interface {v4, v12}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v10
|
|
|
|
:goto_1
|
|
invoke-interface {v4}, Landroid/database/Cursor;->moveToNext()Z
|
|
|
|
move-result v11
|
|
|
|
if-eqz v11, :cond_8
|
|
|
|
const/4 v11, -0x1
|
|
|
|
if-eq v5, v11, :cond_1
|
|
|
|
invoke-interface {v4, v5}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v12
|
|
|
|
move/from16 v18, v12
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
const/16 v18, 0x0
|
|
|
|
:goto_2
|
|
if-eq v8, v11, :cond_2
|
|
|
|
invoke-interface {v4, v8}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v12
|
|
|
|
move v15, v12
|
|
|
|
goto :goto_3
|
|
|
|
:cond_2
|
|
const/4 v15, 0x0
|
|
|
|
:goto_3
|
|
if-ne v7, v11, :cond_3
|
|
|
|
invoke-interface {v4, v3}, Landroid/database/Cursor;->getLong(I)J
|
|
|
|
move-result-wide v12
|
|
|
|
invoke-static {v2, v12, v13}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;
|
|
|
|
move-result-object v12
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
invoke-interface {v4, v7}, Landroid/database/Cursor;->getLong(I)J
|
|
|
|
move-result-wide v12
|
|
|
|
invoke-static {v0, v12, v13}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;
|
|
|
|
move-result-object v12
|
|
|
|
:goto_4
|
|
move-object v14, v12
|
|
|
|
if-eq v9, v11, :cond_4
|
|
|
|
invoke-interface {v4, v9}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v12
|
|
|
|
move/from16 v16, v12
|
|
|
|
goto :goto_5
|
|
|
|
:cond_4
|
|
const/16 v12, 0x190
|
|
|
|
const/16 v16, 0x190
|
|
|
|
:goto_5
|
|
if-eq v10, v11, :cond_5
|
|
|
|
invoke-interface {v4, v10}, Landroid/database/Cursor;->getInt(I)I
|
|
|
|
move-result v11
|
|
|
|
const/4 v12, 0x1
|
|
|
|
if-ne v11, v12, :cond_6
|
|
|
|
const/16 v17, 0x1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_5
|
|
const/4 v12, 0x1
|
|
|
|
:cond_6
|
|
const/16 v17, 0x0
|
|
|
|
:goto_6
|
|
new-instance v11, Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
|
|
move-object v13, v11
|
|
|
|
invoke-direct/range {v13 .. v18}, Landroidx/core/provider/FontsContractCompat$FontInfo;-><init>(Landroid/net/Uri;IIZI)V
|
|
|
|
invoke-virtual {v6, v11}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_7
|
|
|
|
:cond_7
|
|
move-object/from16 v6, v18
|
|
|
|
:cond_8
|
|
if-eqz v4, :cond_9
|
|
|
|
invoke-interface {v4}, Landroid/database/Cursor;->close()V
|
|
|
|
:cond_9
|
|
new-array v0, v1, [Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
|
|
invoke-virtual {v6, v0}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
|
|
return-object v0
|
|
|
|
:catchall_1
|
|
move-exception v0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_7
|
|
if-eqz v4, :cond_a
|
|
|
|
invoke-interface {v4}, Landroid/database/Cursor;->close()V
|
|
|
|
:cond_a
|
|
goto :goto_9
|
|
|
|
:goto_8
|
|
throw v0
|
|
|
|
:goto_9
|
|
goto :goto_8
|
|
.end method
|
|
|
|
.method static getFontInternal(Landroid/content/Context;Landroidx/core/provider/FontRequest;I)Landroidx/core/provider/FontsContractCompat$TypefaceResult;
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
invoke-static {p0, v0, p1}, Landroidx/core/provider/FontsContractCompat;->fetchFonts(Landroid/content/Context;Landroid/os/CancellationSignal;Landroidx/core/provider/FontRequest;)Landroidx/core/provider/FontsContractCompat$FontFamilyResult;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;->getStatusCode()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x3
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;->getFonts()[Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p0, v0, p1, p2}, Landroidx/core/graphics/TypefaceCompat;->createFromFontInfo(Landroid/content/Context;Landroid/os/CancellationSignal;[Landroidx/core/provider/FontsContractCompat$FontInfo;I)Landroid/graphics/Typeface;
|
|
|
|
move-result-object p0
|
|
|
|
new-instance p1, Landroidx/core/provider/FontsContractCompat$TypefaceResult;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p1, p0, v2}, Landroidx/core/provider/FontsContractCompat$TypefaceResult;-><init>(Landroid/graphics/Typeface;I)V
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontsContractCompat$FontFamilyResult;->getStatusCode()I
|
|
|
|
move-result p0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
if-ne p0, p1, :cond_2
|
|
|
|
const/4 v2, -0x2
|
|
|
|
:cond_2
|
|
new-instance p0, Landroidx/core/provider/FontsContractCompat$TypefaceResult;
|
|
|
|
invoke-direct {p0, v0, v2}, Landroidx/core/provider/FontsContractCompat$TypefaceResult;-><init>(Landroid/graphics/Typeface;I)V
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
new-instance p0, Landroidx/core/provider/FontsContractCompat$TypefaceResult;
|
|
|
|
const/4 p1, -0x1
|
|
|
|
invoke-direct {p0, v0, p1}, Landroidx/core/provider/FontsContractCompat$TypefaceResult;-><init>(Landroid/graphics/Typeface;I)V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getFontSync(Landroid/content/Context;Landroidx/core/provider/FontRequest;Landroidx/core/content/res/ResourcesCompat$FontCallback;Landroid/os/Handler;ZII)Landroid/graphics/Typeface;
|
|
.locals 2
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontRequest;->getIdentifier()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "-"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Landroidx/core/provider/FontsContractCompat;->sTypefaceCache:Landroidx/collection/LruCache;
|
|
|
|
invoke-virtual {v1, v0}, Landroidx/collection/LruCache;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroid/graphics/Typeface;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p2, v1}, Landroidx/core/content/res/ResourcesCompat$FontCallback;->onFontRetrieved(Landroid/graphics/Typeface;)V
|
|
|
|
:cond_0
|
|
return-object v1
|
|
|
|
:cond_1
|
|
if-eqz p4, :cond_4
|
|
|
|
const/4 v1, -0x1
|
|
|
|
if-ne p5, v1, :cond_4
|
|
|
|
invoke-static {p0, p1, p6}, Landroidx/core/provider/FontsContractCompat;->getFontInternal(Landroid/content/Context;Landroidx/core/provider/FontRequest;I)Landroidx/core/provider/FontsContractCompat$TypefaceResult;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
iget p1, p0, Landroidx/core/provider/FontsContractCompat$TypefaceResult;->mResult:I
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
iget-object p1, p0, Landroidx/core/provider/FontsContractCompat$TypefaceResult;->mTypeface:Landroid/graphics/Typeface;
|
|
|
|
invoke-virtual {p2, p1, p3}, Landroidx/core/content/res/ResourcesCompat$FontCallback;->callbackSuccessAsync(Landroid/graphics/Typeface;Landroid/os/Handler;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
iget p1, p0, Landroidx/core/provider/FontsContractCompat$TypefaceResult;->mResult:I
|
|
|
|
invoke-virtual {p2, p1, p3}, Landroidx/core/content/res/ResourcesCompat$FontCallback;->callbackFailAsync(ILandroid/os/Handler;)V
|
|
|
|
:cond_3
|
|
:goto_0
|
|
iget-object p0, p0, Landroidx/core/provider/FontsContractCompat$TypefaceResult;->mTypeface:Landroid/graphics/Typeface;
|
|
|
|
return-object p0
|
|
|
|
:cond_4
|
|
new-instance v1, Landroidx/core/provider/FontsContractCompat$1;
|
|
|
|
invoke-direct {v1, p0, p1, p6, v0}, Landroidx/core/provider/FontsContractCompat$1;-><init>(Landroid/content/Context;Landroidx/core/provider/FontRequest;ILjava/lang/String;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
if-eqz p4, :cond_5
|
|
|
|
:try_start_0
|
|
sget-object p1, Landroidx/core/provider/FontsContractCompat;->sBackgroundThread:Landroidx/core/provider/SelfDestructiveThread;
|
|
|
|
invoke-virtual {p1, v1, p5}, Landroidx/core/provider/SelfDestructiveThread;->postAndWait(Ljava/util/concurrent/Callable;I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/core/provider/FontsContractCompat$TypefaceResult;
|
|
|
|
iget-object p0, p1, Landroidx/core/provider/FontsContractCompat$TypefaceResult;->mTypeface:Landroid/graphics/Typeface;
|
|
:try_end_0
|
|
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
return-object p0
|
|
|
|
:cond_5
|
|
if-nez p2, :cond_6
|
|
|
|
move-object p1, p0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_6
|
|
new-instance p1, Landroidx/core/provider/FontsContractCompat$2;
|
|
|
|
invoke-direct {p1, p2, p3}, Landroidx/core/provider/FontsContractCompat$2;-><init>(Landroidx/core/content/res/ResourcesCompat$FontCallback;Landroid/os/Handler;)V
|
|
|
|
:goto_1
|
|
sget-object p2, Landroidx/core/provider/FontsContractCompat;->sLock:Ljava/lang/Object;
|
|
|
|
monitor-enter p2
|
|
|
|
:try_start_1
|
|
sget-object p3, Landroidx/core/provider/FontsContractCompat;->sPendingReplies:Landroidx/collection/SimpleArrayMap;
|
|
|
|
invoke-virtual {p3, v0}, Landroidx/collection/SimpleArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p3
|
|
|
|
check-cast p3, Ljava/util/ArrayList;
|
|
|
|
if-eqz p3, :cond_8
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
invoke-virtual {p3, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_7
|
|
monitor-exit p2
|
|
|
|
return-object p0
|
|
|
|
:cond_8
|
|
if-eqz p1, :cond_9
|
|
|
|
new-instance p3, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p3}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-virtual {p3, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
sget-object p1, Landroidx/core/provider/FontsContractCompat;->sPendingReplies:Landroidx/collection/SimpleArrayMap;
|
|
|
|
invoke-virtual {p1, v0, p3}, Landroidx/collection/SimpleArrayMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_9
|
|
monitor-exit p2
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
sget-object p1, Landroidx/core/provider/FontsContractCompat;->sBackgroundThread:Landroidx/core/provider/SelfDestructiveThread;
|
|
|
|
new-instance p2, Landroidx/core/provider/FontsContractCompat$3;
|
|
|
|
invoke-direct {p2, v0}, Landroidx/core/provider/FontsContractCompat$3;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1, v1, p2}, Landroidx/core/provider/SelfDestructiveThread;->postAndReply(Ljava/util/concurrent/Callable;Landroidx/core/provider/SelfDestructiveThread$ReplyCallback;)V
|
|
|
|
return-object p0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
:try_start_2
|
|
monitor-exit p2
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static getProvider(Landroid/content/pm/PackageManager;Landroidx/core/provider/FontRequest;Landroid/content/res/Resources;)Landroid/content/pm/ProviderInfo;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Landroid/content/pm/PackageManager$NameNotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontRequest;->getProviderAuthority()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p0, v0, v1}, Landroid/content/pm/PackageManager;->resolveContentProvider(Ljava/lang/String;I)Landroid/content/pm/ProviderInfo;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
iget-object v3, v2, Landroid/content/pm/ProviderInfo;->packageName:Ljava/lang/String;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontRequest;->getProviderPackage()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
iget-object v0, v2, Landroid/content/pm/ProviderInfo;->packageName:Ljava/lang/String;
|
|
|
|
const/16 v3, 0x40
|
|
|
|
invoke-virtual {p0, v0, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object p0
|
|
|
|
iget-object p0, p0, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
|
|
|
|
invoke-static {p0}, Landroidx/core/provider/FontsContractCompat;->convertToByteArrayList([Landroid/content/pm/Signature;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
sget-object v0, Landroidx/core/provider/FontsContractCompat;->sByteArrayComparator:Ljava/util/Comparator;
|
|
|
|
invoke-static {p0, v0}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
|
|
|
|
invoke-static {p1, p2}, Landroidx/core/provider/FontsContractCompat;->getCertificates(Landroidx/core/provider/FontRequest;Landroid/content/res/Resources;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result p2
|
|
|
|
if-ge v1, p2, :cond_1
|
|
|
|
new-instance p2, Ljava/util/ArrayList;
|
|
|
|
invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Collection;
|
|
|
|
invoke-direct {p2, v0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
sget-object v0, Landroidx/core/provider/FontsContractCompat;->sByteArrayComparator:Ljava/util/Comparator;
|
|
|
|
invoke-static {p2, v0}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
|
|
|
|
invoke-static {p0, p2}, Landroidx/core/provider/FontsContractCompat;->equalsByteArrayList(Ljava/util/List;Ljava/util/List;)Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
return-object v2
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
new-instance p0, Landroid/content/pm/PackageManager$NameNotFoundException;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Found content provider "
|
|
|
|
invoke-direct {p2, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, ", but package was not "
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/provider/FontRequest;->getProviderPackage()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroid/content/pm/PackageManager$NameNotFoundException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_3
|
|
new-instance p0, Landroid/content/pm/PackageManager$NameNotFoundException;
|
|
|
|
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "No package found for authority: "
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroid/content/pm/PackageManager$NameNotFoundException;-><init>(Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:goto_1
|
|
throw p0
|
|
|
|
:goto_2
|
|
goto :goto_1
|
|
.end method
|
|
|
|
.method public static prepareFontData(Landroid/content/Context;[Landroidx/core/provider/FontsContractCompat$FontInfo;Landroid/os/CancellationSignal;)Ljava/util/Map;
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"[",
|
|
"Landroidx/core/provider/FontsContractCompat$FontInfo;",
|
|
"Landroid/os/CancellationSignal;",
|
|
")",
|
|
"Ljava/util/Map<",
|
|
"Landroid/net/Uri;",
|
|
"Ljava/nio/ByteBuffer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
array-length v1, p1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
aget-object v3, p1, v2
|
|
|
|
invoke-virtual {v3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getResultCode()I
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
invoke-virtual {v3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getUri()Landroid/net/Uri;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v3}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
invoke-static {p0, p2, v3}, Landroidx/core/graphics/TypefaceCompatUtil;->mmap(Landroid/content/Context;Landroid/os/CancellationSignal;Landroid/net/Uri;)Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v0, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-static {v0}, Ljava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static requestFont(Landroid/content/Context;Landroidx/core/provider/FontRequest;Landroidx/core/provider/FontsContractCompat$FontRequestCallback;Landroid/os/Handler;)V
|
|
.locals 0
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0, p1, p2, p3}, Landroidx/core/provider/FontsContractCompat;->requestFontInternal(Landroid/content/Context;Landroidx/core/provider/FontRequest;Landroidx/core/provider/FontsContractCompat$FontRequestCallback;Landroid/os/Handler;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static requestFontInternal(Landroid/content/Context;Landroidx/core/provider/FontRequest;Landroidx/core/provider/FontsContractCompat$FontRequestCallback;Landroid/os/Handler;)V
|
|
.locals 2
|
|
|
|
new-instance v0, Landroid/os/Handler;
|
|
|
|
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
|
|
|
|
new-instance v1, Landroidx/core/provider/FontsContractCompat$4;
|
|
|
|
invoke-direct {v1, p0, p1, v0, p2}, Landroidx/core/provider/FontsContractCompat$4;-><init>(Landroid/content/Context;Landroidx/core/provider/FontRequest;Landroid/os/Handler;Landroidx/core/provider/FontsContractCompat$FontRequestCallback;)V
|
|
|
|
invoke-virtual {p3, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static resetCache()V
|
|
.locals 1
|
|
|
|
sget-object v0, Landroidx/core/provider/FontsContractCompat;->sTypefaceCache:Landroidx/collection/LruCache;
|
|
|
|
invoke-virtual {v0}, Landroidx/collection/LruCache;->evictAll()V
|
|
|
|
return-void
|
|
.end method
|