summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorNicolas Prevot <nprevot@google.com>2015-02-26 16:51:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-26 16:51:56 +0000
commitabc03c7ae8c9c628de319819a10ce2cbaedf1c86 (patch)
treeb5e10c3006b66c675e83f1531d0109ba35d15652 /services/devicepolicy
parent6cdb27e7324b43d5e907f2be1de46d8b4db02398 (diff)
parent41916d492c38055928ae5ad1e0b815ff79dc4f5c (diff)
downloadframeworks_base-abc03c7ae8c9c628de319819a10ce2cbaedf1c86.zip
frameworks_base-abc03c7ae8c9c628de319819a10ce2cbaedf1c86.tar.gz
frameworks_base-abc03c7ae8c9c628de319819a10ce2cbaedf1c86.tar.bz2
Merge "Fail silently when changing BLUETOOTH_ON/WIFI_ON directly"
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 6dc54ce..a19cd9f 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -196,13 +196,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.ADB_ENABLED);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.AUTO_TIME);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.AUTO_TIME_ZONE);
- GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.BLUETOOTH_ON);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.DATA_ROAMING);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.MODE_RINGER);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.NETWORK_PREFERENCE);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
- GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.WIFI_ON);
GLOBAL_SETTINGS_WHITELIST.add(Settings.Global.WIFI_SLEEP_POLICY);
}
@@ -5269,8 +5267,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
if (!GLOBAL_SETTINGS_WHITELIST.contains(setting)) {
- throw new SecurityException(String.format(
- "Permission denial: device owners cannot update %1$s", setting));
+ // BLUETOOTH_ON and WIFI_ON used to be supported but not any more. We do not want to
+ // throw a SecurityException not to break apps.
+ if (!Settings.Global.BLUETOOTH_ON.equals(setting)
+ && !Settings.Global.WIFI_ON.equals(setting)) {
+ throw new SecurityException(String.format(
+ "Permission denial: device owners cannot update %1$s", setting));
+ }
}
long id = Binder.clearCallingIdentity();