Suppress reporting incompatible mode error
This commit is contained in:
@@ -90,7 +90,8 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
|
|||||||
else -> getString(R.string.failure_reason_unknown, reason)
|
else -> getString(R.string.failure_reason_unknown, reason)
|
||||||
})
|
})
|
||||||
Toast.makeText(this@LocalOnlyHotspotService, message, Toast.LENGTH_SHORT).show()
|
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)
|
}, app.handler)
|
||||||
} catch (e: IllegalStateException) {
|
} catch (e: IllegalStateException) {
|
||||||
@@ -104,7 +105,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
|
|||||||
return START_STICKY
|
return START_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startFailure(e: Exception) {
|
private fun startFailure(e: Exception?) {
|
||||||
Crashlytics.logException(e)
|
Crashlytics.logException(e)
|
||||||
updateNotification()
|
updateNotification()
|
||||||
ServiceNotification.stopForeground(this@LocalOnlyHotspotService)
|
ServiceNotification.stopForeground(this@LocalOnlyHotspotService)
|
||||||
|
|||||||
Reference in New Issue
Block a user