Catch SecurityExceptions
This commit is contained in:
@@ -99,8 +99,9 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
|
||||
|
||||
fun updateErrorMessage(errored: List<String>) {
|
||||
data.text = errored.filter { TetherType.ofInterface(it) == tetherType }.joinToString("\n") {
|
||||
"$it: " + try {
|
||||
val error = TetheringManager.getLastTetherError(it)
|
||||
"$it: " + when (error) {
|
||||
when (error) {
|
||||
TetheringManager.TETHER_ERROR_NO_ERROR -> "TETHER_ERROR_NO_ERROR"
|
||||
TetheringManager.TETHER_ERROR_UNKNOWN_IFACE -> "TETHER_ERROR_UNKNOWN_IFACE"
|
||||
TetheringManager.TETHER_ERROR_SERVICE_UNAVAIL -> "TETHER_ERROR_SERVICE_UNAVAIL"
|
||||
@@ -114,6 +115,10 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
|
||||
TetheringManager.TETHER_ERROR_IFACE_CFG_ERROR -> "TETHER_ERROR_IFACE_CFG_ERROR"
|
||||
else -> app.getString(R.string.failure_reason_unknown, error)
|
||||
}
|
||||
} catch (e: SecurityException) {
|
||||
Crashlytics.logException(e)
|
||||
e.localizedMessage
|
||||
}
|
||||
}
|
||||
data.notifyChange()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user