1
0
mirror of https://github.com/vector-im/element-android.git synced 2025-07-29 19:41:14 +03:00

Manage new Android 13 notification permission.

This commit is contained in:
Benoit Marty
2022-10-06 18:00:33 +02:00
parent 3952f732dd
commit 652069d520
30 changed files with 241 additions and 92 deletions

25
tools/adb/notification.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
## From https://developer.android.com/develop/ui/views/notifications/notification-permission#test
PACKAGE_NAME=im.vector.app.debug
# App is newly installed on a device that runs Android 13 or higher:
adb shell pm revoke ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS
adb shell pm clear-permission-flags ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS user-set
adb shell pm clear-permission-flags ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS user-fixed
# The user keeps notifications enabled when the app is installed on a device that runs 12L or lower,
# then the device upgrades to Android 13 or higher:
# adb shell pm grant ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS
# adb shell pm set-permission-flags ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS user-set
# adb shell pm clear-permission-flags ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS user-fixed
# The user manually disables notifications when the app is installed on a device that runs 12L or lower,
# then the device upgrades to Android 13 or higher:
# adb shell pm revoke ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS
# adb shell pm set-permission-flags ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS user-set
# adb shell pm clear-permission-flags ${PACKAGE_NAME} android.permission.POST_NOTIFICATIONS user-fixed