Skip to content

Instantly share code, notes, and snippets.

@0awawa0
Created July 27, 2022 06:17
Show Gist options
  • Save 0awawa0/27842ec77b051c83fbfe994576dbcbc5 to your computer and use it in GitHub Desktop.
Save 0awawa0/27842ec77b051c83fbfe994576dbcbc5 to your computer and use it in GitHub Desktop.
var intent = XiaomiUtilities.getPermissionManagerIntent(applicationContext)
if (intent != null) {
try {
startActivity(intent)
} catch (e: Exception) {
try {
intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
intent.data = Uri.parse("package:" + applicationContext.packageName)
startActivity(intent)
} catch (e: Exception) {
Logger.log(logTag, e.toString(), writeToFile = true)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment