612 lines
14 KiB
Smali
612 lines
14 KiB
Smali
.class public final Landroidx/core/os/LocaleListCompat;
|
|
.super Ljava/lang/Object;
|
|
.source "LocaleListCompat.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final sEmptyLocaleList:Landroidx/core/os/LocaleListCompat;
|
|
|
|
|
|
# instance fields
|
|
.field private mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v0, v0, [Ljava/util/Locale;
|
|
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->create([Ljava/util/Locale;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Landroidx/core/os/LocaleListCompat;->sEmptyLocaleList:Landroidx/core/os/LocaleListCompat;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>(Landroidx/core/os/LocaleListInterface;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static varargs create([Ljava/util/Locale;)Landroidx/core/os/LocaleListCompat;
|
|
.locals 2
|
|
.param p0 # [Ljava/util/Locale;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
new-instance v0, Landroid/os/LocaleList;
|
|
|
|
invoke-direct {v0, p0}, Landroid/os/LocaleList;-><init>([Ljava/util/Locale;)V
|
|
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->wrap(Landroid/os/LocaleList;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance v0, Landroidx/core/os/LocaleListCompat;
|
|
|
|
new-instance v1, Landroidx/core/os/LocaleListCompatWrapper;
|
|
|
|
invoke-direct {v1, p0}, Landroidx/core/os/LocaleListCompatWrapper;-><init>([Ljava/util/Locale;)V
|
|
|
|
invoke-direct {v0, v1}, Landroidx/core/os/LocaleListCompat;-><init>(Landroidx/core/os/LocaleListInterface;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static forLanguageTagCompat(Ljava/lang/String;)Ljava/util/Locale;
|
|
.locals 6
|
|
|
|
const-string v0, "-"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x1
|
|
|
|
const/4 v3, 0x2
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {p0, v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
array-length v1, v0
|
|
|
|
if-le v1, v3, :cond_0
|
|
|
|
new-instance p0, Ljava/util/Locale;
|
|
|
|
aget-object v1, v0, v4
|
|
|
|
aget-object v2, v0, v5
|
|
|
|
aget-object v0, v0, v3
|
|
|
|
invoke-direct {p0, v1, v2, v0}, Ljava/util/Locale;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
array-length v1, v0
|
|
|
|
if-le v1, v5, :cond_1
|
|
|
|
new-instance p0, Ljava/util/Locale;
|
|
|
|
aget-object v1, v0, v4
|
|
|
|
aget-object v0, v0, v5
|
|
|
|
invoke-direct {p0, v1, v0}, Ljava/util/Locale;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
array-length v1, v0
|
|
|
|
if-ne v1, v5, :cond_5
|
|
|
|
new-instance p0, Ljava/util/Locale;
|
|
|
|
aget-object v0, v0, v4
|
|
|
|
invoke-direct {p0, v0}, Ljava/util/Locale;-><init>(Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
const-string v0, "_"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
invoke-virtual {p0, v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
array-length v1, v0
|
|
|
|
if-le v1, v3, :cond_3
|
|
|
|
new-instance p0, Ljava/util/Locale;
|
|
|
|
aget-object v1, v0, v4
|
|
|
|
aget-object v2, v0, v5
|
|
|
|
aget-object v0, v0, v3
|
|
|
|
invoke-direct {p0, v1, v2, v0}, Ljava/util/Locale;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_3
|
|
array-length v1, v0
|
|
|
|
if-le v1, v5, :cond_4
|
|
|
|
new-instance p0, Ljava/util/Locale;
|
|
|
|
aget-object v1, v0, v4
|
|
|
|
aget-object v0, v0, v5
|
|
|
|
invoke-direct {p0, v1, v0}, Ljava/util/Locale;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_4
|
|
array-length v1, v0
|
|
|
|
if-ne v1, v5, :cond_5
|
|
|
|
new-instance p0, Ljava/util/Locale;
|
|
|
|
aget-object v0, v0, v4
|
|
|
|
invoke-direct {p0, v0}, Ljava/util/Locale;-><init>(Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_5
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Can not parse language tag: ["
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, "]"
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_6
|
|
new-instance v0, Ljava/util/Locale;
|
|
|
|
invoke-direct {v0, p0}, Ljava/util/Locale;-><init>(Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static forLanguageTags(Ljava/lang/String;)Landroidx/core/os/LocaleListCompat;
|
|
.locals 4
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_0
|
|
const/4 v0, -0x1
|
|
|
|
const-string v1, ","
|
|
|
|
invoke-virtual {p0, v1, v0}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
array-length v0, p0
|
|
|
|
new-array v0, v0, [Ljava/util/Locale;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
array-length v2, v0
|
|
|
|
if-ge v1, v2, :cond_2
|
|
|
|
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v3, 0x15
|
|
|
|
if-lt v2, v3, :cond_1
|
|
|
|
aget-object v2, p0, v1
|
|
|
|
invoke-static {v2}, Ljava/util/Locale;->forLanguageTag(Ljava/lang/String;)Ljava/util/Locale;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
aget-object v2, p0, v1
|
|
|
|
invoke-static {v2}, Landroidx/core/os/LocaleListCompat;->forLanguageTagCompat(Ljava/lang/String;)Ljava/util/Locale;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_1
|
|
aput-object v2, v0, v1
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->create([Ljava/util/Locale;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_3
|
|
:goto_2
|
|
invoke-static {}, Landroidx/core/os/LocaleListCompat;->getEmptyLocaleList()Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getAdjustedDefault()Landroidx/core/os/LocaleListCompat;
|
|
.locals 3
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/Size;
|
|
min = 0x1L
|
|
.end annotation
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-static {}, Landroid/os/LocaleList;->getAdjustedDefault()Landroid/os/LocaleList;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->wrap(Landroid/os/LocaleList;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Ljava/util/Locale;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, v0, v1
|
|
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->create([Ljava/util/Locale;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getDefault()Landroidx/core/os/LocaleListCompat;
|
|
.locals 3
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/Size;
|
|
min = 0x1L
|
|
.end annotation
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-static {}, Landroid/os/LocaleList;->getDefault()Landroid/os/LocaleList;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->wrap(Landroid/os/LocaleList;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Ljava/util/Locale;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, v0, v1
|
|
|
|
invoke-static {v0}, Landroidx/core/os/LocaleListCompat;->create([Ljava/util/Locale;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getEmptyLocaleList()Landroidx/core/os/LocaleListCompat;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
sget-object v0, Landroidx/core/os/LocaleListCompat;->sEmptyLocaleList:Landroidx/core/os/LocaleListCompat;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static wrap(Landroid/os/LocaleList;)Landroidx/core/os/LocaleListCompat;
|
|
.locals 2
|
|
.param p0 # Landroid/os/LocaleList;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
value = 0x18
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/core/os/LocaleListCompat;
|
|
|
|
new-instance v1, Landroidx/core/os/LocaleListPlatformWrapper;
|
|
|
|
invoke-direct {v1, p0}, Landroidx/core/os/LocaleListPlatformWrapper;-><init>(Landroid/os/LocaleList;)V
|
|
|
|
invoke-direct {v0, v1}, Landroidx/core/os/LocaleListCompat;-><init>(Landroidx/core/os/LocaleListInterface;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static wrap(Ljava/lang/Object;)Landroidx/core/os/LocaleListCompat;
|
|
.locals 0
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
value = 0x18
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/Deprecated;
|
|
.end annotation
|
|
|
|
check-cast p0, Landroid/os/LocaleList;
|
|
|
|
invoke-static {p0}, Landroidx/core/os/LocaleListCompat;->wrap(Landroid/os/LocaleList;)Landroidx/core/os/LocaleListCompat;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final equals(Ljava/lang/Object;)Z
|
|
.locals 1
|
|
|
|
instance-of v0, p1, Landroidx/core/os/LocaleListCompat;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
check-cast p1, Landroidx/core/os/LocaleListCompat;
|
|
|
|
iget-object p1, p1, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final get(I)Ljava/util/Locale;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0, p1}, Landroidx/core/os/LocaleListInterface;->get(I)Ljava/util/Locale;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final getFirstMatch([Ljava/lang/String;)Ljava/util/Locale;
|
|
.locals 1
|
|
.param p1 # [Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0, p1}, Landroidx/core/os/LocaleListInterface;->getFirstMatch([Ljava/lang/String;)Ljava/util/Locale;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final hashCode()I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final indexOf(Ljava/util/Locale;)I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/IntRange;
|
|
from = -0x1L
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0, p1}, Landroidx/core/os/LocaleListInterface;->indexOf(Ljava/util/Locale;)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final isEmpty()Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0}, Landroidx/core/os/LocaleListInterface;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final size()I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/IntRange;
|
|
from = 0x0L
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0}, Landroidx/core/os/LocaleListInterface;->size()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final toLanguageTags()Ljava/lang/String;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0}, Landroidx/core/os/LocaleListInterface;->toLanguageTags()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final toString()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final unwrap()Ljava/lang/Object;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/core/os/LocaleListCompat;->mImpl:Landroidx/core/os/LocaleListInterface;
|
|
|
|
invoke-interface {v0}, Landroidx/core/os/LocaleListInterface;->getLocaleList()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|