Notify users when location permissions are auto granted
When the admin has set an auto-accept permissions policy, notify the user when an app is granted location-related permissions due to this policy. Implementation: A new class, AutoGrantPermissionsNotifier, was created, to present the notification to the user. The GrantPermissionsActivity class calls the AutoGrantPermissionsNotifier every time a permission was auto-granted, and once at the end of dealing with all permission requests by the app (so notifications can be coalesced and displayed only once). Tapping the notification sends the user to the Settings screen where app permissions can be seen (but not controlled, because of the admin-set policy). Testing: * Install TestDPC. * Set TestDPC as Device Owner * Find "Get/Set permissions policy" and toggle to "Auto accept" * Get the BasicLocation app by checking out https://github.com/android/location-samples and building it from there. * Install the app onto the device and start it. * Observe notification Bug: 148631522 Test: Manual, see above Change-Id: Iffbef902a936404f7d8df7e6264ed829c040df9f
Loading
Please register or sign in to comment