-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestDPC app is not responding and eventually crashes when the notifications permission is not granted #227
Comments
Hello Michal and @pfmaggi , This issue is arising because, in the latest Android version, if you reject dangerous permissions twice, the app won't be able to request them again or show the dialog for permission requests. However, the GrantPermissionsActivity still tries to create its activity, but no screen appears. As POST_NOTIFICATIONS has protection level: dangerous I have reproduced the issue and came to conclusion that it is caused by askNotificationPermission in PolicyManagementActivity. If you look closely, the askNotificationPermission is still in onResume, and it should only be called once. But after analyzing the logs, I realized that when we call askNotificationPermission, the PolicyManagementActivity loses focus (i.e., it stops). It then tries to create the GrantPermissionsActivity for the permission request, but since the permission has been rejected twice, it fails. This causes the flow to return to PolicyManagementActivity, and as it regains focus, it calls onResume again, leading to another call to askNotificationPermission. This results in an infinite loop, which causes the app to lag. To summarize, the flow looks like this: Logs: |
Hello. We use it when we don't want to use a real UEM. I've just installed the TestDPC app from the Google Play:
STRs:
Part of the filtered logs for
com.afwsamples.testdpc
:The notifications permission is mentioned. Granting the permission in the Settings -> Apps -> etc. makes the app working again :)
The text was updated successfully, but these errors were encountered: