Merge "Notify the profile when cloned settings are changed." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5a81b61e87
@@ -1774,6 +1774,26 @@ public class SettingsProvider extends ContentProvider {
|
|||||||
Uri uri = getNotificationUriFor(key, name);
|
Uri uri = getNotificationUriFor(key, name);
|
||||||
|
|
||||||
sendNotify(uri, userId);
|
sendNotify(uri, userId);
|
||||||
|
if (isSecureSettingsKey(key)) {
|
||||||
|
maybeNotifyProfiles(userId, uri, name, sSecureCloneToManagedSettings);
|
||||||
|
} else if (isSystemSettingsKey(key)) {
|
||||||
|
maybeNotifyProfiles(userId, uri, name, sSystemCloneToManagedSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void maybeNotifyProfiles(int userId, Uri uri, String name,
|
||||||
|
Set<String> keysCloned) {
|
||||||
|
if (keysCloned.contains(name)) {
|
||||||
|
List<UserInfo> profiles = mUserManager.getProfiles(userId);
|
||||||
|
int size = profiles.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
UserInfo profile = profiles.get(i);
|
||||||
|
// the notification for userId has already been sent.
|
||||||
|
if (profile.id != userId) {
|
||||||
|
sendNotify(uri, profile.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int makeKey(int type, int userId) {
|
private int makeKey(int type, int userId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user