Permission Check For DPM.getPermittedAccessibilityServices

Require the callers of DPM.getPermittedAccessibilityServices(userId) to
hold the MANAGE_USERS permission.  The only known callers of this API
are settings apps that already hold this permission.

Bug: 62343414
Test: com.android.server.devicepolicy.DevicePolicyManagerTest
Test: com.google.android.gts.devicepolicy.DeviceOwnerTest
Test: Manually checked accessibility settings in DO and PO modes
Change-Id: I8ee3f876fcaffa63636645f0f59709cd147254ef
This commit is contained in:
Eric Sandness
2018-04-03 18:12:39 +01:00
parent 219e139651
commit 5ab98de315
2 changed files with 2 additions and 0 deletions

View File

@@ -6198,6 +6198,7 @@ public class DevicePolicyManager {
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
public @Nullable List<String> getPermittedAccessibilityServices(int userId) {
throwIfParentInstance("getPermittedAccessibilityServices");
if (mService != null) {

View File

@@ -8481,6 +8481,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
if (!mHasFeature) {
return null;
}
enforceManageUsers();
synchronized (getLockObject()) {
List<String> result = null;
// If we have multiple profiles we return the intersection of the