.class public final Lcom/tapjoy/TJDeviceInfo; .super Ljava/lang/Object; .source "SourceFile" # static fields .field public static final INSTANCE:Lcom/tapjoy/TJDeviceInfo; # direct methods .method static constructor ()V .locals 1 new-instance v0, Lcom/tapjoy/TJDeviceInfo; invoke-direct {v0}, Lcom/tapjoy/TJDeviceInfo;->()V sput-object v0, Lcom/tapjoy/TJDeviceInfo;->INSTANCE:Lcom/tapjoy/TJDeviceInfo; return-void .end method .method public constructor ()V .locals 0 .line 1 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method # virtual methods .method public final getBatteryLevel(Landroid/content/Context;)Ljava/lang/Float; .locals 2 const/4 v0, 0x0 if-eqz p1, :cond_0 const-string v1, "batterymanager" .line 1 invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object p1 goto :goto_0 :cond_0 move-object p1, v0 :goto_0 instance-of v1, p1, Landroid/os/BatteryManager; if-eqz v1, :cond_1 check-cast p1, Landroid/os/BatteryManager; goto :goto_1 :cond_1 move-object p1, v0 :goto_1 if-nez p1, :cond_2 return-object v0 :cond_2 const/4 v0, 0x4 .line 2 invoke-virtual {p1, v0}, Landroid/os/BatteryManager;->getIntProperty(I)I move-result p1 int-to-float p1, p1 const/high16 v0, 0x42c80000 # 100.0f div-float/2addr p1, v0 invoke-static {p1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float; move-result-object p1 return-object p1 .end method .method public final getBrightness(Landroid/content/Context;)Ljava/lang/Float; .locals 4 const/4 v0, 0x0 if-eqz p1, :cond_0 .line 1 :try_start_0 invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver; move-result-object p1 goto :goto_0 :catch_0 move-exception p1 goto :goto_1 :cond_0 move-object p1, v0 :goto_0 if-nez p1, :cond_1 return-object v0 :cond_1 const-string v1, "screen_brightness" .line 2 invoke-static {p1, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I move-result p1 int-to-float p1, p1 const/high16 v1, 0x437f0000 # 255.0f div-float/2addr p1, v1 .line 4 new-instance v1, Ljava/math/BigDecimal; float-to-double v2, p1 invoke-direct {v1, v2, v3}, Ljava/math/BigDecimal;->(D)V sget-object p1, Ljava/math/RoundingMode;->HALF_UP:Ljava/math/RoundingMode; const/4 v2, 0x2 invoke-virtual {v1, v2, p1}, Ljava/math/BigDecimal;->setScale(ILjava/math/RoundingMode;)Ljava/math/BigDecimal; move-result-object p1 invoke-virtual {p1}, Ljava/math/BigDecimal;->floatValue()F move-result p1 invoke-static {p1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float; move-result-object p1 :try_end_0 .catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 .line 6 :goto_1 invoke-virtual {p1}, Ljava/lang/Throwable;->getLocalizedMessage()Ljava/lang/String; move-result-object p1 const-string v1, "TJDeviceInfo" invoke-static {v1, p1}, Lcom/tapjoy/TapjoyLog;->e(Ljava/lang/String;Ljava/lang/String;)V return-object v0 .end method .method public final getDeviceScreenLayoutSize(Landroid/content/Context;)Ljava/lang/Integer; .locals 3 const/4 v0, 0x0 if-eqz p1, :cond_0 .line 1 invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object p1 if-eqz p1, :cond_0 invoke-virtual {p1}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration; move-result-object p1 goto :goto_0 :cond_0 move-object p1, v0 :goto_0 if-nez p1, :cond_1 return-object v0 .line 3 :cond_1 :try_start_0 iget p1, p1, Landroid/content/res/Configuration;->screenLayout:I and-int/lit8 p1, p1, 0xf invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p1 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 :catch_0 move-exception p1 .line 5 new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V const-string v2, "Error getting screen density/dimensions/layout: " invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 const-string v1, "TJDeviceInfo" invoke-static {v1, p1}, Lcom/tapjoy/TapjoyLog;->e(Ljava/lang/String;Ljava/lang/String;)V return-object v0 .end method .method public final getScreenDPI(Landroid/content/Context;)Ljava/lang/Integer; .locals 3 const/4 v0, 0x0 :try_start_0 sget v1, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v2, 0x1e if-lt v1, v2, :cond_1 if-eqz p1, :cond_0 .line 2 invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object p1 if-eqz p1, :cond_0 invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics; move-result-object p1 if-eqz p1, :cond_0 iget p1, p1, Landroid/util/DisplayMetrics;->densityDpi:I invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v0 goto :goto_0 :catch_0 move-exception p1 goto :goto_3 :cond_0 :goto_0 return-object v0 :cond_1 if-eqz p1, :cond_2 const-string v1, "window" .line 4 invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object p1 goto :goto_1 :cond_2 move-object p1, v0 .line 5 :goto_1 instance-of v1, p1, Landroid/view/WindowManager; if-eqz v1, :cond_3 check-cast p1, Landroid/view/WindowManager; goto :goto_2 :cond_3 move-object p1, v0 :goto_2 if-nez p1, :cond_4 return-object v0 .line 6 :cond_4 new-instance v1, Landroid/util/DisplayMetrics; invoke-direct {v1}, Landroid/util/DisplayMetrics;->()V .line 8 invoke-interface {p1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display; move-result-object p1 if-eqz p1, :cond_5 invoke-virtual {p1, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V :cond_5 iget p1, v1, Landroid/util/DisplayMetrics;->densityDpi:I .line 9 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p1 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 .line 12 :goto_3 invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 const-string v1, "TJDeviceInfo" invoke-static {v1, p1}, Lcom/tapjoy/TapjoyLog;->d(Ljava/lang/String;Ljava/lang/String;)V return-object v0 .end method .method public final getScreenHeight(Landroid/content/Context;)Ljava/lang/Integer; .locals 7 const/4 v0, 0x0 if-eqz p1, :cond_0 :try_start_0 const-string v1, "window" .line 1 invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v1 goto :goto_0 :catch_0 move-exception p1 goto/16 :goto_3 :cond_0 move-object v1, v0 .line 2 :goto_0 instance-of v2, v1, Landroid/view/WindowManager; if-eqz v2, :cond_1 check-cast v1, Landroid/view/WindowManager; goto :goto_1 :cond_1 move-object v1, v0 :goto_1 if-nez v1, :cond_2 return-object v0 :cond_2 sget v2, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v3, 0x1e if-lt v2, v3, :cond_4 .line 4 invoke-static {v1}, Lcom/firemint/realracing/Platform$$ExternalSyntheticApiModelOutline0;->m(Landroid/view/WindowManager;)Landroid/view/WindowMetrics; move-result-object v1 const-string v2, "getCurrentWindowMetrics(...)" invoke-static {v1, v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V .line 5 invoke-static {v1}, Lcom/tapjoy/TJDeviceInfo$$ExternalSyntheticApiModelOutline0;->m(Landroid/view/WindowMetrics;)Landroid/view/WindowInsets; move-result-object v1 invoke-static {}, Landroidx/core/view/WindowInsetsCompat$TypeImpl30$$ExternalSyntheticApiModelOutline0;->m()I move-result v2 invoke-static {v1, v2}, Landroidx/core/view/WindowInsetsCompat$Impl30$$ExternalSyntheticApiModelOutline3;->m(Landroid/view/WindowInsets;I)Landroid/graphics/Insets; move-result-object v1 invoke-static {v1}, Landroidx/appcompat/widget/DrawableUtils$$ExternalSyntheticApiModelOutline1;->m(Landroid/graphics/Insets;)I move-result v1 .line 6 invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object p1 if-eqz p1, :cond_3 invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics; move-result-object p1 if-eqz p1, :cond_3 iget p1, p1, Landroid/util/DisplayMetrics;->heightPixels:I sub-int/2addr p1, v1 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p1 return-object p1 :cond_3 return-object v0 .line 8 :cond_4 new-instance v2, Landroid/util/DisplayMetrics; invoke-direct {v2}, Landroid/util/DisplayMetrics;->()V .line 10 invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display; move-result-object v1 if-eqz v1, :cond_5 invoke-virtual {v1, v2}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 :cond_5 const/4 v1, 0x0 .line 14 :try_start_1 invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object v3 if-eqz v3, :cond_6 const-string v4, "status_bar_height" const-string v5, "dimen" const-string v6, "android" invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I move-result v3 goto :goto_2 :cond_6 move v3, v1 :goto_2 if-lez v3, :cond_7 .line 16 invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object p1 if-eqz p1, :cond_7 invoke-virtual {p1, v3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I move-result v1 :try_end_1 .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1 :catch_1 :cond_7 :try_start_2 iget p1, v2, Landroid/util/DisplayMetrics;->heightPixels:I sub-int/2addr p1, v1 iput p1, v2, Landroid/util/DisplayMetrics;->heightPixels:I .line 21 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p1 :try_end_2 .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0 return-object p1 .line 24 :goto_3 invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 const-string v1, "TJDeviceInfo" invoke-static {v1, p1}, Lcom/tapjoy/TapjoyLog;->d(Ljava/lang/String;Ljava/lang/String;)V return-object v0 .end method .method public final getScreenWidth(Landroid/content/Context;)Ljava/lang/Integer; .locals 3 const/4 v0, 0x0 :try_start_0 sget v1, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v2, 0x1e if-lt v1, v2, :cond_1 if-eqz p1, :cond_0 .line 2 invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object p1 if-eqz p1, :cond_0 invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics; move-result-object p1 if-eqz p1, :cond_0 iget p1, p1, Landroid/util/DisplayMetrics;->widthPixels:I invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v0 goto :goto_0 :catch_0 move-exception p1 goto :goto_3 :cond_0 :goto_0 return-object v0 :cond_1 if-eqz p1, :cond_2 const-string v1, "window" .line 4 invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object p1 goto :goto_1 :cond_2 move-object p1, v0 .line 5 :goto_1 instance-of v1, p1, Landroid/view/WindowManager; if-eqz v1, :cond_3 check-cast p1, Landroid/view/WindowManager; goto :goto_2 :cond_3 move-object p1, v0 :goto_2 if-nez p1, :cond_4 return-object v0 .line 6 :cond_4 new-instance v1, Landroid/util/DisplayMetrics; invoke-direct {v1}, Landroid/util/DisplayMetrics;->()V .line 8 invoke-interface {p1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display; move-result-object p1 if-eqz p1, :cond_5 invoke-virtual {p1, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V :cond_5 iget p1, v1, Landroid/util/DisplayMetrics;->widthPixels:I .line 9 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p1 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 .line 12 :goto_3 invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 const-string v1, "TJDeviceInfo" invoke-static {v1, p1}, Lcom/tapjoy/TapjoyLog;->d(Ljava/lang/String;Ljava/lang/String;)V return-object v0 .end method .method public final getTheme(Landroid/content/Context;)Ljava/lang/String; .locals 2 const/4 v0, 0x0 if-eqz p1, :cond_0 const-string v1, "uimode" .line 1 invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object p1 goto :goto_0 :cond_0 move-object p1, v0 :goto_0 instance-of v1, p1, Landroid/app/UiModeManager; if-eqz v1, :cond_1 check-cast p1, Landroid/app/UiModeManager; goto :goto_1 :cond_1 move-object p1, v0 :goto_1 if-eqz p1, :cond_2 .line 2 invoke-virtual {p1}, Landroid/app/UiModeManager;->getNightMode()I move-result p1 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v0 :cond_2 if-nez v0, :cond_3 goto :goto_2 .line 4 :cond_3 invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I move-result p1 const/4 v0, 0x2 if-ne p1, v0, :cond_4 const-string p1, "dark" goto :goto_3 :cond_4 :goto_2 const-string p1, "light" :goto_3 return-object p1 .end method .method public final getVolume(Landroid/content/Context;)Ljava/lang/Float; .locals 3 const/4 v0, 0x0 if-eqz p1, :cond_0 :try_start_0 const-string v1, "audio" .line 1 invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object p1 goto :goto_0 :cond_0 move-object p1, v0 .line 2 :goto_0 instance-of v1, p1, Landroid/media/AudioManager; if-eqz v1, :cond_1 check-cast p1, Landroid/media/AudioManager; goto :goto_1 :cond_1 move-object p1, v0 :goto_1 if-nez p1, :cond_2 return-object v0 :cond_2 const/4 v1, 0x3 .line 3 invoke-virtual {p1, v1}, Landroid/media/AudioManager;->getStreamVolume(I)I move-result v2 .line 4 invoke-virtual {p1, v1}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I move-result p1 int-to-float v1, v2 int-to-float p1, p1 div-float/2addr v1, p1 .line 6 new-instance p1, Ljava/math/BigDecimal; float-to-double v1, v1 invoke-direct {p1, v1, v2}, Ljava/math/BigDecimal;->(D)V sget-object v1, Ljava/math/RoundingMode;->HALF_UP:Ljava/math/RoundingMode; const/4 v2, 0x2 invoke-virtual {p1, v2, v1}, Ljava/math/BigDecimal;->setScale(ILjava/math/RoundingMode;)Ljava/math/BigDecimal; move-result-object p1 invoke-virtual {p1}, Ljava/math/BigDecimal;->floatValue()F move-result p1 invoke-static {p1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float; move-result-object p1 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 :catch_0 const-string p1, "TJDeviceInfo" const-string v1, "Unable to fetch volume" .line 8 invoke-static {p1, v1}, Lcom/tapjoy/TapjoyLog;->e(Ljava/lang/String;Ljava/lang/String;)V return-object v0 .end method