Add request for POST_NOTIFICATIONS on Android 13.

Closes #29
This commit is contained in:
darken
2022-09-19 22:26:43 +02:00
committed by Matthias Urhahn
parent 887adc87de
commit 2d96822014
4 changed files with 17 additions and 1 deletions
@@ -71,7 +71,13 @@ enum class Permission(
isGranted = {
android.provider.Settings.canDrawOverlays(it)
},
)
),
POST_NOTIFICATIONS(
minApiLevel = Build.VERSION_CODES.S,
labelRes = R.string.permission_post_notifications_label,
descriptionRes = R.string.permission_post_notifications_description,
permissionId = "android.permission.POST_NOTIFICATIONS",
),
}
fun Permission.isRequired(context: Context): Boolean = when {
@@ -65,4 +65,6 @@
<string name="last_seen_x">Last seen: %s</string>
<string name="first_seen_x">First seen: %s</string>
<string name="permission_post_notifications_label">Post notifications</string>
<string name="permission_post_notifications_description">"Allow CAPod to show you notifications about your AirPods, e.g. their current status while connected."</string>
</resources>