summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2015-01-26 10:36:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-26 10:36:14 +0000
commit414ea81ea364d7b961cbfb885c30729595e3a7b2 (patch)
tree7985f47e0a98f0adb690d7a4f0e673ec7a04a839 /services
parentc309688bfaf204c892635783aad96443a41fdffb (diff)
parent871fa7343a2ff8de837a721eacfc576b19438e54 (diff)
downloadframeworks_base-414ea81ea364d7b961cbfb885c30729595e3a7b2.zip
frameworks_base-414ea81ea364d7b961cbfb885c30729595e3a7b2.tar.gz
frameworks_base-414ea81ea364d7b961cbfb885c30729595e3a7b2.tar.bz2
Merge "Ensure notifications are sent when locking/unlocking location share" into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 2ca5629..c52b571 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4893,6 +4893,19 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
}
mUserManager.setUserRestriction(key, enabled, user);
+ if (enabled != alreadyRestricted) {
+ if (UserManager.DISALLOW_SHARE_LOCATION.equals(key)) {
+ // Send out notifications however as some clients may want to reread the
+ // value which actually changed due to a restriction having been applied.
+ final String property = Settings.Secure.SYS_PROP_SETTING_VERSION;
+ long version = SystemProperties.getLong(property, 0) + 1;
+ SystemProperties.set(property, Long.toString(version));
+
+ final String name = Settings.Secure.LOCATION_PROVIDERS_ALLOWED;
+ Uri url = Uri.withAppendedPath(Settings.Secure.CONTENT_URI, name);
+ mContext.getContentResolver().notifyChange(url, null, true, userHandle);
+ }
+ }
} finally {
restoreCallingIdentity(id);
}