.class public final Landroidx/tracing/Trace; .super Ljava/lang/Object; .source "Trace.java" # static fields .field static final TAG:Ljava/lang/String; = "Trace" .field private static sAsyncTraceBeginMethod:Ljava/lang/reflect/Method; .field private static sAsyncTraceEndMethod:Ljava/lang/reflect/Method; .field private static sIsTagEnabledMethod:Ljava/lang/reflect/Method; .field private static sTraceCounterMethod:Ljava/lang/reflect/Method; .field private static sTraceTagApp:J # direct methods .method private constructor ()V .locals 0 .line 240 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static beginAsyncSection(Ljava/lang/String;I)V .locals 1 :try_start_0 sget-object v0, Landroidx/tracing/Trace;->sAsyncTraceBeginMethod:Ljava/lang/reflect/Method; if-nez v0, :cond_0 .line 112 invoke-static {p0, p1}, Landroidx/tracing/TraceApi29Impl;->beginAsyncSection(Ljava/lang/String;I)V :try_end_0 .catch Ljava/lang/NoSuchMethodError; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/NoClassDefFoundError; {:try_start_0 .. :try_end_0} :catch_0 return-void .line 117 :catch_0 :cond_0 invoke-static {p0, p1}, Landroidx/tracing/Trace;->beginAsyncSectionFallback(Ljava/lang/String;I)V return-void .end method .method private static beginAsyncSectionFallback(Ljava/lang/String;I)V .locals 8 const-string v0, "asyncTraceBegin" :try_start_0 sget-object v1, Landroidx/tracing/Trace;->sAsyncTraceBeginMethod:Ljava/lang/reflect/Method; const/4 v2, 0x2 const/4 v3, 0x1 const/4 v4, 0x0 const/4 v5, 0x3 if-nez v1, :cond_0 .line 180 const-class v1, Landroid/os/Trace; new-array v6, v5, [Ljava/lang/Class; sget-object v7, Ljava/lang/Long;->TYPE:Ljava/lang/Class; aput-object v7, v6, v4 const-class v7, Ljava/lang/String; aput-object v7, v6, v3 sget-object v7, Ljava/lang/Integer;->TYPE:Ljava/lang/Class; aput-object v7, v6, v2 invoke-virtual {v1, v0, v6}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v1 sput-object v1, Landroidx/tracing/Trace;->sAsyncTraceBeginMethod:Ljava/lang/reflect/Method; :cond_0 sget-object v1, Landroidx/tracing/Trace;->sAsyncTraceBeginMethod:Ljava/lang/reflect/Method; new-array v5, v5, [Ljava/lang/Object; sget-wide v6, Landroidx/tracing/Trace;->sTraceTagApp:J .line 186 invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v6 aput-object v6, v5, v4 aput-object p0, v5, v3 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p0 aput-object p0, v5, v2 const/4 p0, 0x0 invoke-virtual {v1, p0, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception p0 .line 188 invoke-static {v0, p0}, Landroidx/tracing/Trace;->handleException(Ljava/lang/String;Ljava/lang/Exception;)V :goto_0 return-void .end method .method public static beginSection(Ljava/lang/String;)V .locals 0 .line 81 invoke-static {p0}, Landroidx/tracing/TraceApi18Impl;->beginSection(Ljava/lang/String;)V return-void .end method .method public static endAsyncSection(Ljava/lang/String;I)V .locals 1 :try_start_0 sget-object v0, Landroidx/tracing/Trace;->sAsyncTraceEndMethod:Ljava/lang/reflect/Method; if-nez v0, :cond_0 .line 132 invoke-static {p0, p1}, Landroidx/tracing/TraceApi29Impl;->endAsyncSection(Ljava/lang/String;I)V :try_end_0 .catch Ljava/lang/NoSuchMethodError; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/NoClassDefFoundError; {:try_start_0 .. :try_end_0} :catch_0 return-void .line 137 :catch_0 :cond_0 invoke-static {p0, p1}, Landroidx/tracing/Trace;->endAsyncSectionFallback(Ljava/lang/String;I)V return-void .end method .method private static endAsyncSectionFallback(Ljava/lang/String;I)V .locals 8 const-string v0, "asyncTraceEnd" :try_start_0 sget-object v1, Landroidx/tracing/Trace;->sAsyncTraceEndMethod:Ljava/lang/reflect/Method; const/4 v2, 0x2 const/4 v3, 0x1 const/4 v4, 0x0 const/4 v5, 0x3 if-nez v1, :cond_0 .line 197 const-class v1, Landroid/os/Trace; new-array v6, v5, [Ljava/lang/Class; sget-object v7, Ljava/lang/Long;->TYPE:Ljava/lang/Class; aput-object v7, v6, v4 const-class v7, Ljava/lang/String; aput-object v7, v6, v3 sget-object v7, Ljava/lang/Integer;->TYPE:Ljava/lang/Class; aput-object v7, v6, v2 invoke-virtual {v1, v0, v6}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v1 sput-object v1, Landroidx/tracing/Trace;->sAsyncTraceEndMethod:Ljava/lang/reflect/Method; :cond_0 sget-object v1, Landroidx/tracing/Trace;->sAsyncTraceEndMethod:Ljava/lang/reflect/Method; new-array v5, v5, [Ljava/lang/Object; sget-wide v6, Landroidx/tracing/Trace;->sTraceTagApp:J .line 203 invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v6 aput-object v6, v5, v4 aput-object p0, v5, v3 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p0 aput-object p0, v5, v2 const/4 p0, 0x0 invoke-virtual {v1, p0, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception p0 .line 205 invoke-static {v0, p0}, Landroidx/tracing/Trace;->handleException(Ljava/lang/String;Ljava/lang/Exception;)V :goto_0 return-void .end method .method public static endSection()V .locals 0 .line 94 invoke-static {}, Landroidx/tracing/TraceApi18Impl;->endSection()V return-void .end method .method private static handleException(Ljava/lang/String;Ljava/lang/Exception;)V .locals 2 .line 229 instance-of v0, p1, Ljava/lang/reflect/InvocationTargetException; if-eqz v0, :cond_1 .line 230 invoke-virtual {p1}, Ljava/lang/Exception;->getCause()Ljava/lang/Throwable; move-result-object p0 .line 231 instance-of p1, p0, Ljava/lang/RuntimeException; if-eqz p1, :cond_0 .line 232 check-cast p0, Ljava/lang/RuntimeException; throw p0 .line 234 :cond_0 new-instance p1, Ljava/lang/RuntimeException; invoke-direct {p1, p0}, Ljava/lang/RuntimeException;->(Ljava/lang/Throwable;)V throw p1 .line 237 :cond_1 new-instance v0, Ljava/lang/StringBuilder; const-string v1, "Unable to call " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 const-string v0, " via reflection" invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 const-string v0, "Trace" invoke-static {v0, p0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I return-void .end method .method public static isEnabled()Z .locals 1 :try_start_0 sget-object v0, Landroidx/tracing/Trace;->sIsTagEnabledMethod:Ljava/lang/reflect/Method; if-nez v0, :cond_0 .line 62 invoke-static {}, Landroid/os/Trace;->isEnabled()Z move-result v0 :try_end_0 .catch Ljava/lang/NoSuchMethodError; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/NoClassDefFoundError; {:try_start_0 .. :try_end_0} :catch_0 return v0 .line 66 :catch_0 :cond_0 invoke-static {}, Landroidx/tracing/Trace;->isEnabledFallback()Z move-result v0 return v0 .end method .method private static isEnabledFallback()Z .locals 7 const-string v0, "isTagEnabled" const/4 v1, 0x0 :try_start_0 sget-object v2, Landroidx/tracing/Trace;->sIsTagEnabledMethod:Ljava/lang/reflect/Method; const/4 v3, 0x1 const/4 v4, 0x0 if-nez v2, :cond_0 .line 162 const-class v2, Landroid/os/Trace; const-string v5, "TRACE_TAG_APP" invoke-virtual {v2, v5}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field; move-result-object v2 .line 163 invoke-virtual {v2, v4}, Ljava/lang/reflect/Field;->getLong(Ljava/lang/Object;)J move-result-wide v5 sput-wide v5, Landroidx/tracing/Trace;->sTraceTagApp:J .line 164 const-class v2, Landroid/os/Trace; new-array v5, v3, [Ljava/lang/Class; sget-object v6, Ljava/lang/Long;->TYPE:Ljava/lang/Class; aput-object v6, v5, v1 .line 165 invoke-virtual {v2, v0, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v2 sput-object v2, Landroidx/tracing/Trace;->sIsTagEnabledMethod:Ljava/lang/reflect/Method; :cond_0 sget-object v2, Landroidx/tracing/Trace;->sIsTagEnabledMethod:Ljava/lang/reflect/Method; new-array v3, v3, [Ljava/lang/Object; sget-wide v5, Landroidx/tracing/Trace;->sTraceTagApp:J .line 167 invoke-static {v5, v6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v5 aput-object v5, v3, v1 invoke-virtual {v2, v4, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; move-result-object v2 check-cast v2, Ljava/lang/Boolean; invoke-virtual {v2}, Ljava/lang/Boolean;->booleanValue()Z move-result v0 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return v0 :catch_0 move-exception v2 .line 169 invoke-static {v0, v2}, Landroidx/tracing/Trace;->handleException(Ljava/lang/String;Ljava/lang/Exception;)V return v1 .end method .method public static setCounter(Ljava/lang/String;I)V .locals 1 :try_start_0 sget-object v0, Landroidx/tracing/Trace;->sTraceCounterMethod:Ljava/lang/reflect/Method; if-nez v0, :cond_0 .line 150 invoke-static {p0, p1}, Landroidx/tracing/TraceApi29Impl;->setCounter(Ljava/lang/String;I)V :try_end_0 .catch Ljava/lang/NoSuchMethodError; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/NoClassDefFoundError; {:try_start_0 .. :try_end_0} :catch_0 return-void .line 155 :catch_0 :cond_0 invoke-static {p0, p1}, Landroidx/tracing/Trace;->setCounterFallback(Ljava/lang/String;I)V return-void .end method .method private static setCounterFallback(Ljava/lang/String;I)V .locals 8 const-string v0, "traceCounter" :try_start_0 sget-object v1, Landroidx/tracing/Trace;->sTraceCounterMethod:Ljava/lang/reflect/Method; const/4 v2, 0x2 const/4 v3, 0x1 const/4 v4, 0x0 const/4 v5, 0x3 if-nez v1, :cond_0 .line 214 const-class v1, Landroid/os/Trace; new-array v6, v5, [Ljava/lang/Class; sget-object v7, Ljava/lang/Long;->TYPE:Ljava/lang/Class; aput-object v7, v6, v4 const-class v7, Ljava/lang/String; aput-object v7, v6, v3 sget-object v7, Ljava/lang/Integer;->TYPE:Ljava/lang/Class; aput-object v7, v6, v2 invoke-virtual {v1, v0, v6}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v1 sput-object v1, Landroidx/tracing/Trace;->sTraceCounterMethod:Ljava/lang/reflect/Method; :cond_0 sget-object v1, Landroidx/tracing/Trace;->sTraceCounterMethod:Ljava/lang/reflect/Method; new-array v5, v5, [Ljava/lang/Object; sget-wide v6, Landroidx/tracing/Trace;->sTraceTagApp:J .line 221 invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v6 aput-object v6, v5, v4 aput-object p0, v5, v3 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p0 aput-object p0, v5, v2 const/4 p0, 0x0 invoke-virtual {v1, p0, v5}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception p0 .line 223 invoke-static {v0, p0}, Landroidx/tracing/Trace;->handleException(Ljava/lang/String;Ljava/lang/Exception;)V :goto_0 return-void .end method