Handle errors in WifiLegacy

This commit is contained in:
Mygod
2020-07-07 03:26:50 +08:00
parent 513e01d747
commit 029a1527a7
2 changed files with 20 additions and 4 deletions

View File

@@ -267,7 +267,15 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
override val tetherType get() = TetherType.WIFI override val tetherType get() = TetherType.WIFI
override val type get() = VIEW_TYPE_WIFI_LEGACY override val type get() = VIEW_TYPE_WIFI_LEGACY
override fun start() = WifiApManager.start() override fun start() = try {
override fun stop() = WifiApManager.stop() WifiApManager.start()
} catch (e: Exception) {
onException(e)
}
override fun stop() = try {
WifiApManager.stop()
} catch (e: Exception) {
onException(e)
}
} }
} }

View File

@@ -242,7 +242,15 @@ sealed class TetheringTileService : IpNeighbourMonitoringTileService(), Tetherin
override val tetherType get() = TetherType.WIFI override val tetherType get() = TetherType.WIFI
override val icon get() = R.drawable.ic_device_wifi_tethering override val icon get() = R.drawable.ic_device_wifi_tethering
override fun start() = WifiApManager.start() override fun start() = try {
override fun stop() = WifiApManager.stop() WifiApManager.start()
} catch (e: Exception) {
onException(e)
}
override fun stop() = try {
WifiApManager.stop()
} catch (e: Exception) {
onException(e)
}
} }
} }