Suppress SecurityException on Android 8-10

This commit is contained in:
Mygod
2020-07-07 04:20:24 +08:00
parent 293140f64e
commit 82dc01ab37
5 changed files with 14 additions and 7 deletions

View File

@@ -196,7 +196,9 @@ class TetheringFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClick
null
} catch (eRoot: Exception) {
eRoot.addSuppressed(e)
Timber.w(eRoot)
if (Build.VERSION.SDK_INT !in 26..29 || eRoot.getRootCause() !is SecurityException) {
Timber.w(eRoot)
}
SmartSnackbar.make(eRoot).show()
null
}