summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy/java
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2015-01-26 10:54:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-26 10:54:55 +0000
commit43daa008f3e5287b6bec27289c96440e71b5fbf7 (patch)
tree15cb96927559caa664ac5a6aef45bebbbe305bac /services/devicepolicy/java
parentc4be6461b3e281e70a5c1e20f55244eb1c81c343 (diff)
parent20bd0c232cd4421affc871ccd01492ecd04316d0 (diff)
downloadframeworks_base-43daa008f3e5287b6bec27289c96440e71b5fbf7.zip
frameworks_base-43daa008f3e5287b6bec27289c96440e71b5fbf7.tar.gz
frameworks_base-43daa008f3e5287b6bec27289c96440e71b5fbf7.tar.bz2
am 20bd0c23: am 059b8ab6: am 414ea81e: Merge "Ensure notifications are sent when locking/unlocking location share" into lmp-mr1-dev
* commit '20bd0c232cd4421affc871ccd01492ecd04316d0': Ensure notifications are sent when locking/unlocking location share
Diffstat (limited to 'services/devicepolicy/java')
-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 f5eadf5..8e66325 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4882,6 +4882,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);
}