From 52c39a16db077f5017ab20214e60a205e075f2d7 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Tue, 21 Oct 2014 11:14:04 -0700 Subject: [PATCH] Allow profile owners to set the unknown source setting This allows work profile MDM to enable unknown sources even if the user doesn't have UI for it. Installing an app from an unknown source will still prompt the user with the package installer dialog, so it's not like the MDM can now quietly install apps from non-market sources. Bug: 18316350 Change-Id: Ia8f4fe36f12a258aa888e085acc0b358925f4817 --- core/java/android/app/admin/DevicePolicyManager.java | 1 + .../android/server/devicepolicy/DevicePolicyManagerService.java | 1 + 2 files changed, 2 insertions(+) diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 9157b1b16b7d0..33cac75027e8f 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -3306,6 +3306,7 @@ public class DevicePolicyManager { *

The settings that can be updated by a profile or device owner with this method are: *

*

A device owner can additionally update the following settings: diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index b3c2155d7f463..07137724b6991 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -179,6 +179,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { SECURE_SETTINGS_WHITELIST = new HashSet(); SECURE_SETTINGS_WHITELIST.add(Settings.Secure.DEFAULT_INPUT_METHOD); SECURE_SETTINGS_WHITELIST.add(Settings.Secure.SKIP_FIRST_USE_HINTS); + SECURE_SETTINGS_WHITELIST.add(Settings.Secure.INSTALL_NON_MARKET_APPS); SECURE_SETTINGS_DEVICEOWNER_WHITELIST = new HashSet(); SECURE_SETTINGS_DEVICEOWNER_WHITELIST.addAll(SECURE_SETTINGS_WHITELIST);