File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
what-the-stack/src/main/java/com/haroldadmin/whatthestack Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ internal object InitializationManager {
3232 private val connection = WhatTheStackConnection (
3333 onConnected = { binder ->
3434 val messenger = Messenger (binder)
35- val exceptionHandler = WhatTheStackExceptionHandler (messenger)
35+ val defaultHandler = Thread .getDefaultUncaughtExceptionHandler()
36+ val exceptionHandler = WhatTheStackExceptionHandler (messenger, defaultHandler)
3637 Thread .setDefaultUncaughtExceptionHandler(exceptionHandler)
3738 }
3839 )
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import androidx.core.os.bundleOf
1212 */
1313
1414internal class WhatTheStackExceptionHandler (
15- private val service : Messenger
15+ private val service : Messenger ,
16+ private val defaultHandler : Thread .UncaughtExceptionHandler ?
1617) : Thread.UncaughtExceptionHandler {
1718 override fun uncaughtException (t : Thread , e : Throwable ) {
1819
@@ -27,6 +28,6 @@ internal class WhatTheStackExceptionHandler(
2728 )
2829 })
2930
30- Process .killProcess(Process .myPid())
31+ defaultHandler?.uncaughtException(t, e) ? : Process .killProcess(Process .myPid())
3132 }
3233}
You can’t perform that action at this time.
0 commit comments