am 731a5c1a: Merge "Fix parsing bug that affects reading back guest restrictions" into lmp-mr1-dev

* commit '731a5c1a29e5bdbf6e7e4bade9b80f7abe6ec37e':
  Fix parsing bug that affects reading back guest restrictions
This commit is contained in:
Amith Yamasani
2014-12-01 18:38:14 +00:00
committed by Android Git Automerger

View File

@@ -224,6 +224,7 @@ public class UserManagerService extends IUserManager.Stub {
|FileUtils.S_IROTH|FileUtils.S_IXOTH, |FileUtils.S_IROTH|FileUtils.S_IXOTH,
-1, -1); -1, -1);
mUserListFile = new File(mUsersDir, USER_LIST_FILENAME); mUserListFile = new File(mUsersDir, USER_LIST_FILENAME);
initDefaultGuestRestrictions();
readUserListLocked(); readUserListLocked();
// Prune out any partially created/partially removed users. // Prune out any partially created/partially removed users.
ArrayList<UserInfo> partials = new ArrayList<UserInfo>(); ArrayList<UserInfo> partials = new ArrayList<UserInfo>();
@@ -469,7 +470,7 @@ public class UserManagerService extends IUserManager.Stub {
private void initDefaultGuestRestrictions() { private void initDefaultGuestRestrictions() {
if (mGuestRestrictions.isEmpty()) { if (mGuestRestrictions.isEmpty()) {
mGuestRestrictions.putBoolean(UserManager.DISALLOW_OUTGOING_CALLS, true); mGuestRestrictions.putBoolean(UserManager.DISALLOW_OUTGOING_CALLS, true);
writeUserListLocked(); mGuestRestrictions.putBoolean(UserManager.DISALLOW_SMS, true);
} }
} }
@@ -653,8 +654,15 @@ public class UserManagerService extends IUserManager.Stub {
} }
} }
} else if (name.equals(TAG_GUEST_RESTRICTIONS)) { } else if (name.equals(TAG_GUEST_RESTRICTIONS)) {
mGuestRestrictions.clear(); while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
readRestrictionsLocked(parser, mGuestRestrictions); && type != XmlPullParser.END_TAG) {
if (type == XmlPullParser.START_TAG) {
if (parser.getName().equals(TAG_RESTRICTIONS)) {
readRestrictionsLocked(parser, mGuestRestrictions);
}
break;
}
}
} }
} }
} }