535 lines
12 KiB
Smali
535 lines
12 KiB
Smali
.class public final Landroidx/core/view/DisplayCompat;
|
|
.super Ljava/lang/Object;
|
|
.source "DisplayCompat.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final DISPLAY_SIZE_4K_HEIGHT:I = 0x870
|
|
|
|
.field public static final DISPLAY_SIZE_4K_WIDTH:I = 0xf00
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static getPhysicalDisplaySize(Landroid/content/Context;Landroid/view/Display;)Landroid/graphics/Point;
|
|
.locals 2
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Landroid/view/Display;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x1c
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
const-string v0, "sys.display-size"
|
|
|
|
invoke-static {v0, p1}, Landroidx/core/view/DisplayCompat;->parsePhysicalDisplaySizeFromSystemProperties(Ljava/lang/String;Landroid/view/Display;)Landroid/graphics/Point;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string/jumbo v0, "vendor.display-size"
|
|
|
|
invoke-static {v0, p1}, Landroidx/core/view/DisplayCompat;->parsePhysicalDisplaySizeFromSystemProperties(Ljava/lang/String;Landroid/view/Display;)Landroid/graphics/Point;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
invoke-static {p0}, Landroidx/core/view/DisplayCompat;->isSonyBravia4kTv(Landroid/content/Context;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
new-instance p0, Landroid/graphics/Point;
|
|
|
|
const/16 p1, 0xf00
|
|
|
|
const/16 v0, 0x870
|
|
|
|
invoke-direct {p0, p1, v0}, Landroid/graphics/Point;-><init>(II)V
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
new-instance p0, Landroid/graphics/Point;
|
|
|
|
invoke-direct {p0}, Landroid/graphics/Point;-><init>()V
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x17
|
|
|
|
if-lt v0, v1, :cond_3
|
|
|
|
invoke-virtual {p1}, Landroid/view/Display;->getMode()Landroid/view/Display$Mode;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/view/Display$Mode;->getPhysicalWidth()I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Landroid/graphics/Point;->x:I
|
|
|
|
invoke-virtual {p1}, Landroid/view/Display$Mode;->getPhysicalHeight()I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Landroid/graphics/Point;->y:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-virtual {p1, p0}, Landroid/view/Display;->getRealSize(Landroid/graphics/Point;)V
|
|
|
|
:goto_1
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getSupportedModes(Landroid/content/Context;Landroid/view/Display;)[Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
.locals 7
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Landroid/view/Display;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroid/annotation/SuppressLint;
|
|
value = {
|
|
"ArrayReturn"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1}, Landroidx/core/view/DisplayCompat;->getPhysicalDisplaySize(Landroid/content/Context;Landroid/view/Display;)Landroid/graphics/Point;
|
|
|
|
move-result-object p0
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/16 v3, 0x17
|
|
|
|
if-lt v0, v3, :cond_3
|
|
|
|
invoke-virtual {p1}, Landroid/view/Display;->getSupportedModes()[Landroid/view/Display$Mode;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
array-length v3, p1
|
|
|
|
invoke-direct {v0, v3}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
array-length v5, p1
|
|
|
|
if-ge v3, v5, :cond_1
|
|
|
|
aget-object v5, p1, v3
|
|
|
|
invoke-static {v5, p0}, Landroidx/core/view/DisplayCompat;->physicalSizeEquals(Landroid/view/Display$Mode;Landroid/graphics/Point;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
new-instance v4, Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
aget-object v5, p1, v3
|
|
|
|
invoke-direct {v4, v5, v1}, Landroidx/core/view/DisplayCompat$ModeCompat;-><init>(Landroid/view/Display$Mode;Z)V
|
|
|
|
invoke-virtual {v0, v3, v4}, Ljava/util/ArrayList;->add(ILjava/lang/Object;)V
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
new-instance v5, Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
aget-object v6, p1, v3
|
|
|
|
invoke-direct {v5, v6, v2}, Landroidx/core/view/DisplayCompat$ModeCompat;-><init>(Landroid/view/Display$Mode;Z)V
|
|
|
|
invoke-virtual {v0, v3, v5}, Ljava/util/ArrayList;->add(ILjava/lang/Object;)V
|
|
|
|
:goto_1
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
if-nez v4, :cond_2
|
|
|
|
new-instance p1, Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
invoke-direct {p1, p0}, Landroidx/core/view/DisplayCompat$ModeCompat;-><init>(Landroid/graphics/Point;)V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_2
|
|
new-array p0, v2, [Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, [Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
return-object p0
|
|
|
|
:cond_3
|
|
new-array p1, v1, [Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
new-instance v0, Landroidx/core/view/DisplayCompat$ModeCompat;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/core/view/DisplayCompat$ModeCompat;-><init>(Landroid/graphics/Point;)V
|
|
|
|
aput-object v0, p1, v2
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static getSystemProperty(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 6
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
:try_start_0
|
|
const-string v0, "android.os.SystemProperties"
|
|
|
|
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "get"
|
|
|
|
const/4 v2, 0x1
|
|
|
|
new-array v3, v2, [Ljava/lang/Class;
|
|
|
|
const-class v4, Ljava/lang/String;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
aput-object v4, v3, v5
|
|
|
|
invoke-virtual {v0, v1, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object v1
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
aput-object p0, v2, v5
|
|
|
|
invoke-virtual {v1, v0, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/lang/String;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static isSonyBravia4kTv(Landroid/content/Context;)Z
|
|
.locals 2
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
invoke-static {p0}, Landroidx/core/view/DisplayCompat;->isTv(Landroid/content/Context;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
|
|
|
|
const-string v1, "Sony"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;
|
|
|
|
const-string v1, "BRAVIA"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "com.sony.dtv.hardware.panel.qfhd"
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isTv(Landroid/content/Context;)Z
|
|
.locals 1
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
const-string v0, "uimode"
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Landroid/app/UiModeManager;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/app/UiModeManager;->getCurrentModeType()I
|
|
|
|
move-result p0
|
|
|
|
const/4 v0, 0x4
|
|
|
|
if-ne p0, v0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method public static parseDisplaySize(Ljava/lang/String;)Landroid/graphics/Point;
|
|
.locals 2
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NumberFormatException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->trim()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string/jumbo v0, "x"
|
|
|
|
const/4 v1, -0x1
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
aget-object v0, p0, v0
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aget-object p0, p0, v1
|
|
|
|
invoke-static {p0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result p0
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
if-lez p0, :cond_0
|
|
|
|
new-instance v1, Landroid/graphics/Point;
|
|
|
|
invoke-direct {v1, v0, p0}, Landroid/graphics/Point;-><init>(II)V
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/NumberFormatException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NumberFormatException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static parsePhysicalDisplaySizeFromSystemProperties(Ljava/lang/String;Landroid/view/Display;)Landroid/graphics/Point;
|
|
.locals 0
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Landroid/view/Display;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Landroid/view/Display;->getDisplayId()I
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
invoke-static {p0}, Landroidx/core/view/DisplayCompat;->getSystemProperty(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
:try_start_0
|
|
invoke-static {p0}, Landroidx/core/view/DisplayCompat;->parseDisplaySize(Ljava/lang/String;)Landroid/graphics/Point;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static physicalSizeEquals(Landroid/view/Display$Mode;Landroid/graphics/Point;)Z
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
value = 0x17
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Landroid/view/Display$Mode;->getPhysicalWidth()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p1, Landroid/graphics/Point;->x:I
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/view/Display$Mode;->getPhysicalHeight()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p1, Landroid/graphics/Point;->y:I
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/view/Display$Mode;->getPhysicalWidth()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p1, Landroid/graphics/Point;->y:I
|
|
|
|
if-ne v0, v1, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroid/view/Display$Mode;->getPhysicalHeight()I
|
|
|
|
move-result p0
|
|
|
|
iget p1, p1, Landroid/graphics/Point;->x:I
|
|
|
|
if-ne p0, p1, :cond_2
|
|
|
|
:cond_1
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|