From 549381050b12605847a88ddecf139abc89cefdc3 Mon Sep 17 00:00:00 2001 From: Mygod Date: Mon, 18 Mar 2019 17:37:35 +0800 Subject: [PATCH] Do not prompt error onTetheringFailed --- .../main/java/be/mygod/vpnhotspot/manage/TetherManager.kt | 5 ++++- .../java/be/mygod/vpnhotspot/manage/TetheringTileService.kt | 6 +++++- mobile/src/main/res/values-zh-rCN/strings.xml | 1 - mobile/src/main/res/values/strings.xml | 1 - 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt index 0c16d91d..3ec81097 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt @@ -94,7 +94,10 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(), protected abstract fun stop() override fun onTetheringStarted() = data.notifyChange() - override fun onTetheringFailed() = SmartSnackbar.make(R.string.tethering_manage_failed).show() + override fun onTetheringFailed() { + DebugHelper.log(javaClass.simpleName, "onTetheringFailed") + data.notifyChange() + } override fun bindTo(viewHolder: RecyclerView.ViewHolder) { (viewHolder as ViewHolder).manager = this diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringTileService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringTileService.kt index 03ada374..26ff4ed6 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringTileService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringTileService.kt @@ -9,6 +9,7 @@ import android.service.quicksettings.Tile import android.widget.Toast import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat +import be.mygod.vpnhotspot.DebugHelper import be.mygod.vpnhotspot.R import be.mygod.vpnhotspot.TetheringService import be.mygod.vpnhotspot.net.TetherType @@ -101,7 +102,10 @@ sealed class TetheringTileService : TetherListeningTileService(), TetheringManag } override fun onTetheringStarted() = updateTile() - override fun onTetheringFailed() = SmartSnackbar.make(R.string.tethering_manage_failed).show() + override fun onTetheringFailed() { + DebugHelper.log(javaClass.simpleName, "onTetheringFailed") + updateTile() + } class Wifi : TetheringTileService() { override val labelString get() = R.string.tethering_manage_wifi diff --git a/mobile/src/main/res/values-zh-rCN/strings.xml b/mobile/src/main/res/values-zh-rCN/strings.xml index 5142fd0c..615d8312 100644 --- a/mobile/src/main/res/values-zh-rCN/strings.xml +++ b/mobile/src/main/res/values-zh-rCN/strings.xml @@ -56,7 +56,6 @@ WLAN 热点 WLAN 热点 (旧 API) 蓝牙网络共享 - Android 系统无法打开网络共享。 (正在连接) (已连接) diff --git a/mobile/src/main/res/values/strings.xml b/mobile/src/main/res/values/strings.xml index 1938576a..70098cbb 100644 --- a/mobile/src/main/res/values/strings.xml +++ b/mobile/src/main/res/values/strings.xml @@ -59,7 +59,6 @@ Wi\u2011Fi hotspot Wi\u2011Fi hotspot (legacy) Bluetooth tethering - Android system has failed to start tethering. " (connecting)" " (reachable)"