android/permissions: limit write permission request to api 30 (#261)

Updates tailscale/corp#18202

the WRITE_EXTERNAL_STORAGE permission is only requried for API level <30.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
pull/263/head
Jonathan Nobels 8 months ago committed by GitHub
parent e024c896c1
commit 2818195400
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,7 +19,7 @@ object Permissions {
val all: List<Permission> val all: List<Permission>
get() { get() {
val result = mutableListOf<Permission>() val result = mutableListOf<Permission>()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
result.add( result.add(
Permission( Permission(
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE,
@ -27,7 +27,8 @@ object Permissions {
R.string.permission_write_external_storage_needed, R.string.permission_write_external_storage_needed,
R.string.permission_write_external_storage_granted, R.string.permission_write_external_storage_granted,
)) ))
} else { }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
result.add( result.add(
Permission( Permission(
Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.POST_NOTIFICATIONS,

Loading…
Cancel
Save