Skip to content
Snippets Groups Projects
Commit 53222671 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Duncan McNamara
Browse files

Fix the hasAllAccess method for Android versions between 23 and 29

parent f36aab18
No related branches found
No related tags found
1 merge request!2011Fine storage permissions
......@@ -181,7 +181,10 @@ object Permissions {
* @param context: the context to check with
* @return true if the app has been granted the whole permissions including [Manifest.permission.MANAGE_EXTERNAL_STORAGE]
*/
fun hasAllAccess(context: Context) = !Intent(android.provider.Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.fromParts(SCHEME_PACKAGE, context.packageName, null)).isCallable(context) || isExternalStorageManager()
fun hasAllAccess(context: Context) =
Build.VERSION.SDK_INT < Build.VERSION_CODES.M
|| (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && canReadStorage(context))
|| isExternalStorageManager()
fun canCheckBluetoothDevices(context: Context): Boolean {
return ContextCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment