From 9a159a9fa231e02823ccebc3192a9cf06c082693 Mon Sep 17 00:00:00 2001 From: Mygod Date: Mon, 11 Jun 2018 20:37:22 +0800 Subject: [PATCH] Suppress reporting incompatible mode error --- .../main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt index 6931b9fe..951f4054 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt @@ -90,7 +90,8 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() { else -> getString(R.string.failure_reason_unknown, reason) }) Toast.makeText(this@LocalOnlyHotspotService, message, Toast.LENGTH_SHORT).show() - startFailure(StartFailure(message)) + startFailure(if (reason == WifiManager.LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE) null else + StartFailure(message)) } }, app.handler) } catch (e: IllegalStateException) { @@ -104,7 +105,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() { return START_STICKY } - private fun startFailure(e: Exception) { + private fun startFailure(e: Exception?) { Crashlytics.logException(e) updateNotification() ServiceNotification.stopForeground(this@LocalOnlyHotspotService)