mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
feat: Open the app-specific manage all files permission dialog (#2148)
This commit is contained in:
parent
edb4e421e2
commit
10e7e4b39f
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ package app.revanced.manager.util
|
|||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Environment
|
||||
import android.provider.Settings
|
||||
|
@ -10,7 +11,7 @@ import androidx.annotation.RequiresApi
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.R)
|
||||
class RequestManageStorageContract(private val forceLaunch: Boolean = false) : ActivityResultContract<String, Boolean>() {
|
||||
override fun createIntent(context: Context, input: String) = Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
|
||||
override fun createIntent(context: Context, input: String) = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.fromParts("package", context.packageName, null))
|
||||
|
||||
override fun getSynchronousResult(context: Context, input: String): SynchronousResult<Boolean>? = if (!forceLaunch && Environment.isExternalStorageManager()) SynchronousResult(true) else null
|
||||
|
||||
|
|
Loading…
Reference in a new issue