Skip to content
Commit 003453b3 authored by Eran Messeri's avatar Eran Messeri
Browse files

Restrict Admin grant of sensors-related permissions

Restrict the admin of a fully-managed device or managed profile from
granting sensors-related permissions.

The admin of a managed profile cannot control permission grants for
sensors-related permissions at all.

The admin of a  fully-managed device can opt-out of having said control
by providing a provisioning extra.

This change passes the boolean flag in ActiveAdmin indicating whether
the admin has control over sensor permission grants into the permission
controller.

Manual testing:
* Install TestDPC
* Create a work profile using TestDPC.
* Get the BasicLocation app by checking out
  https://github.com/android/location-samples and building it from there.
* Install the app onto the device but do not start it.
* In TestDPC, Find "Manage app permissions", choose "Basic Location Sample"
  from the drop-down menu.
* Toggle each of the "ACCESS_COARSE_LOCATION" and
  "ACCESS_BACKGROUND_LOCATION" to "Allow".
* Observe that no notification appears.
* Start the BasicLocation app and observe the runtime permission prompt
  shows up.

Bug: 158735247
Test: Manual (more to be added).
Test: cts (see topic)
Change-Id: I12d9f7e24ad4bc09651a5e5f60b864298506c2c4
parent d014bb74
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment