Revoke notification permission (Android 13+) if user disables session notification.
This commit is contained in:
parent
652069d520
commit
238b41ce55
|
@ -68,4 +68,11 @@ class NotificationPermissionManager @Inject constructor(
|
|||
arrayOf(Manifest.permission.POST_NOTIFICATIONS)
|
||||
)
|
||||
}
|
||||
|
||||
fun eventuallyRevokePermission(
|
||||
activity: Activity,
|
||||
) {
|
||||
if (!sdkIntProvider.isAtLeast(Build.VERSION_CODES.TIRAMISU)) return
|
||||
activity.revokeSelfPermissionOnKill(Manifest.permission.POST_NOTIFICATIONS)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ class VectorSettingsNotificationPreferenceFragment :
|
|||
} else {
|
||||
unifiedPushHelper.unregister(pushersManager)
|
||||
session.pushersService().refreshPushers()
|
||||
notificationPermissionManager.eventuallyRevokePermission(requireActivity())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue