Rial 00
Rial 00

Reputation: 43

Android - Can I see if WRITE_SETTINGS permission granted API < 23

I have an app that needs to support minSdkVersion lower than 23.
Recently Google requires all apps have targetSdkVersion 26+

Now we must request Manifest.permission.WRITE_SETTINGS with ACTION_MANAGE_WRITE_SETTINGS.

However I am unable to determine if permission is granted without using Settings.System.canWrite(context); (canWrite() requires minSdkVersion >= 23 )

I've tried

ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_SETTINGS)

and

PermissionChecker.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_SETTINGS)

both do not return PERMISSION_GRANTED even when the permission is granted. (checked with Settings.ACTION_MANAGE_WRITE_SETTINGS activity slider is ON)

Upvotes: 0

Views: 258

Answers (1)

Gavin Wright
Gavin Wright

Reputation: 3212

There are no runtime permissions for API<23. So the user already granted the permission as a stipulation for downloading the app.

Upvotes: 2

Related Questions