From f7ed0c2387c9e15ca38239ff20765d624c419dce Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 11 Jul 2020 06:39:55 +0800 Subject: [PATCH] Suppress not registered error for now See also: b/160765229 --- .../main/java/be/mygod/vpnhotspot/net/TetheringManager.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt index 29e9c4f4..f284f8c9 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt @@ -577,7 +577,12 @@ object TetheringManager { @RequiresApi(30) fun unregisterTetheringEventCallback(callback: TetheringEventCallback) { val proxy = synchronized(callbackMap) { callbackMap.remove(callback) } ?: return - unregisterTetheringEventCallback(instance, proxy) + try { + unregisterTetheringEventCallback(instance, proxy) + } catch (e: InvocationTargetException) { + if (e.targetException !is IllegalArgumentException) throw e + Timber.e(e) // TODO: b/160765229 + } } /**