Merge "Settings: Profiles inherit call restrictions" into main
diff --git a/src/com/android/settings/users/UserDetailsSettings.java b/src/com/android/settings/users/UserDetailsSettings.java
index a758e34..a030d86 100644
--- a/src/com/android/settings/users/UserDetailsSettings.java
+++ b/src/com/android/settings/users/UserDetailsSettings.java
@@ -476,9 +476,12 @@
private void enableCallsAndSms(boolean enabled) {
mPhonePref.setChecked(enabled);
- UserHandle userHandle = UserHandle.of(mUserInfo.id);
- mUserManager.setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, !enabled, userHandle);
- mUserManager.setUserRestriction(UserManager.DISALLOW_SMS, !enabled, userHandle);
+ int[] userProfiles = mUserManager.getProfileIdsWithDisabled(mUserInfo.id);
+ for (int userId : userProfiles) {
+ UserHandle user = UserHandle.of(userId);
+ mUserManager.setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, !enabled, user);
+ mUserManager.setUserRestriction(UserManager.DISALLOW_SMS, !enabled, user);
+ }
}
/**