From f37ebc5d0295496d561ac11792c7e3bbd5029543 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 19 Jan 2023 17:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/lib/permission/PermissionActivity.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt b/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt index e1c615320..feed79e61 100644 --- a/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt +++ b/app/src/main/java/io/legado/app/lib/permission/PermissionActivity.kt @@ -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) - } + val settingIntent = Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION) + settingActivityResult.launch(settingIntent) } else { throw NoStackTraceException("no MANAGE_ALL_FILES_ACCESS_PERMISSION") }