From 8b7b0b0b3ef2c840a66cd65c15871cf6e638fcf8 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sun, 6 Jan 2019 01:43:19 +0800 Subject: [PATCH] Fix flashing icons --- .../main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt | 2 +- .../be/mygod/vpnhotspot/manage/LocalOnlyHotspotManager.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt index 3d102387..32f59276 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt @@ -107,7 +107,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() { SmartSnackbar.make(message).show() startFailure() } - }, app.handler) + }, null) } catch (e: IllegalStateException) { Timber.w(e) SmartSnackbar.make(e).show() diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotManager.kt index 831448bf..45001b1d 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/LocalOnlyHotspotManager.kt @@ -76,8 +76,8 @@ class LocalOnlyHotspotManager(private val parent: TetheringFragment) : Manager() private val lookup: Map get() = parent.ifaceLookup override val icon: Int get() { - val iface = binder?.iface ?: return TetherType.WIFI.icon - return TetherType.ofInterface(iface).icon + val iface = binder?.iface + return (if (iface.isNullOrBlank()) TetherType.WIFI else TetherType.ofInterface(iface)).icon } override val title: CharSequence get() { val configuration = binder?.configuration ?: return parent.getString(R.string.tethering_temp_hotspot)