.class public final Lkotlinx/coroutines/android/AndroidExceptionPreHandler; .super Lkotlin/coroutines/a; .source "AndroidExceptionPreHandler.kt" # interfaces .implements Lkotlinx/coroutines/CoroutineExceptionHandler; # annotations .annotation build Landroidx/annotation/Keep; .end annotation .annotation runtime Lkotlin/Metadata; bv = {} d1 = { "\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\u0008\u0005\u0008\u0001\u0018\u00002\u00020\u00012\u00020\u0002B\u0007\u00a2\u0006\u0004\u0008\u000e\u0010\u000fJ\n\u0010\u0004\u001a\u0004\u0018\u00010\u0003H\u0002J\u0018\u0010\n\u001a\u00020\t2\u0006\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0008\u001a\u00020\u0007H\u0016R\u0018\u0010\u000c\u001a\u0004\u0018\u00010\u000b8\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008\u000c\u0010\r\u00a8\u0006\u0010" } d2 = { "Lkotlinx/coroutines/android/AndroidExceptionPreHandler;", "Lkotlin/coroutines/a;", "Lkotlinx/coroutines/CoroutineExceptionHandler;", "Ljava/lang/reflect/Method;", "preHandler", "Lkotlin/coroutines/CoroutineContext;", "context", "", "exception", "Lkotlin/d1;", "handleException", "", "_preHandler", "Ljava/lang/Object;", "", "()V", "kotlinx-coroutines-android" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # instance fields .field private volatile _preHandler:Ljava/lang/Object; # direct methods .method public constructor ()V .locals 1 .line 1 sget-object v0, Lkotlinx/coroutines/CoroutineExceptionHandler;->p0:Lkotlinx/coroutines/CoroutineExceptionHandler$b; invoke-direct {p0, v0}, Lkotlin/coroutines/a;->(Lkotlin/coroutines/CoroutineContext$b;)V .line 2 iput-object p0, p0, Lkotlinx/coroutines/android/AndroidExceptionPreHandler;->_preHandler:Ljava/lang/Object; return-void .end method .method private final preHandler()Ljava/lang/reflect/Method; .locals 5 .line 1 iget-object v0, p0, Lkotlinx/coroutines/android/AndroidExceptionPreHandler;->_preHandler:Ljava/lang/Object; if-eq v0, p0, :cond_0 .line 2 check-cast v0, Ljava/lang/reflect/Method; return-object v0 :cond_0 const/4 v0, 0x0 .line 3 :try_start_0 const-class v1, Ljava/lang/Thread; const-string v2, "getUncaughtExceptionPreHandler" const/4 v3, 0x0 new-array v4, v3, [Ljava/lang/Class; invoke-virtual {v1, v2, v4}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v1 .line 4 invoke-virtual {v1}, Ljava/lang/reflect/Method;->getModifiers()I move-result v2 invoke-static {v2}, Ljava/lang/reflect/Modifier;->isPublic(I)Z move-result v2 if-eqz v2, :cond_1 invoke-virtual {v1}, Ljava/lang/reflect/Method;->getModifiers()I move-result v2 invoke-static {v2}, Ljava/lang/reflect/Modifier;->isStatic(I)Z move-result v2 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz v2, :cond_1 const/4 v3, 0x1 :cond_1 if-eqz v3, :cond_2 move-object v0, v1 .line 5 :catchall_0 :cond_2 iput-object v0, p0, Lkotlinx/coroutines/android/AndroidExceptionPreHandler;->_preHandler:Ljava/lang/Object; return-object v0 .end method # virtual methods .method public handleException(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Throwable;)V .locals 3 .param p1 # Lkotlin/coroutines/CoroutineContext; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .param p2 # Ljava/lang/Throwable; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .line 1 invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object p1 .line 2 sget v0, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v1, 0x1c if-lt v0, v1, :cond_0 .line 3 invoke-virtual {p1}, Ljava/lang/Thread;->getUncaughtExceptionHandler()Ljava/lang/Thread$UncaughtExceptionHandler; move-result-object v0 invoke-interface {v0, p1, p2}, Ljava/lang/Thread$UncaughtExceptionHandler;->uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V goto :goto_2 .line 4 :cond_0 invoke-direct {p0}, Lkotlinx/coroutines/android/AndroidExceptionPreHandler;->preHandler()Ljava/lang/reflect/Method; move-result-object v0 const/4 v1, 0x0 if-eqz v0, :cond_1 const/4 v2, 0x0 new-array v2, v2, [Ljava/lang/Object; invoke-virtual {v0, v1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 goto :goto_0 :cond_1 move-object v0, v1 :goto_0 instance-of v2, v0, Ljava/lang/Thread$UncaughtExceptionHandler; if-nez v2, :cond_2 goto :goto_1 :cond_2 move-object v1, v0 :goto_1 check-cast v1, Ljava/lang/Thread$UncaughtExceptionHandler; if-eqz v1, :cond_3 .line 5 invoke-interface {v1, p1, p2}, Ljava/lang/Thread$UncaughtExceptionHandler;->uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V :cond_3 :goto_2 return-void .end method