Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3fb3eb9e authored by Eran Messeri's avatar Eran Messeri
Browse files

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
parent 008c51b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment