mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
51579928c6
commit
f37ebc5d02
@ -47,14 +47,8 @@ class PermissionActivity : AppCompatActivity() {
|
||||
//所有文件所有文件的管理权限
|
||||
Request.TYPE_MANAGE_ALL_FILES_ACCESS_PERMISSION -> try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
kotlin.runCatching {
|
||||
val settingIntent = Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
|
||||
settingIntent.data = Uri.parse("package:$packageName")
|
||||
settingActivityResult.launch(settingIntent)
|
||||
}.onFailure {
|
||||
val settingIntent = Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
|
||||
settingActivityResult.launch(settingIntent)
|
||||
}
|
||||
} else {
|
||||
throw NoStackTraceException("no MANAGE_ALL_FILES_ACCESS_PERMISSION")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user