diff options
author | Amith Yamasani <yamasani@google.com> | 2014-10-07 17:43:08 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-07 17:43:08 +0000 |
commit | 4797554ab8522ffc3dbf6f4ede111dcbbb7bb757 (patch) | |
tree | 912b42db7664facda4bd2d39aa60a1feb55aa024 /services | |
parent | 97e9a034b99dfacf64dec38be608d7db24a31e9e (diff) | |
parent | b86671f4b8263affaa561796862bd4149235b1d3 (diff) | |
download | frameworks_base-4797554ab8522ffc3dbf6f4ede111dcbbb7bb757.zip frameworks_base-4797554ab8522ffc3dbf6f4ede111dcbbb7bb757.tar.gz frameworks_base-4797554ab8522ffc3dbf6f4ede111dcbbb7bb757.tar.bz2 |
am b86671f4: am 41bb3455: Merge "Set the default user restrictions to disallow calling and sms" into lmp-dev
* commit 'b86671f4b8263affaa561796862bd4149235b1d3':
Set the default user restrictions to disallow calling and sms
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/UserManagerService.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index 26e0db3..0cf2249 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -119,7 +119,7 @@ public class UserManagerService extends IUserManager.Stub { private static final int MIN_USER_ID = 10; - private static final int USER_VERSION = 4; + private static final int USER_VERSION = 5; private static final long EPOCH_PLUS_30_YEARS = 30L * 365 * 24 * 60 * 60 * 1000L; // ms @@ -462,6 +462,17 @@ public class UserManagerService extends IUserManager.Stub { } } + /** + * If default guest restrictions haven't been initialized yet, add the basic + * restrictions. + */ + private void initDefaultGuestRestrictions() { + if (mGuestRestrictions.isEmpty()) { + mGuestRestrictions.putBoolean(UserManager.DISALLOW_OUTGOING_CALLS, true); + writeUserListLocked(); + } + } + @Override public Bundle getDefaultGuestRestrictions() { checkManageUsersPermission("getDefaultGuestRestrictions"); @@ -693,6 +704,11 @@ public class UserManagerService extends IUserManager.Stub { userVersion = 4; } + if (userVersion < 5) { + initDefaultGuestRestrictions(); + userVersion = 5; + } + if (userVersion < USER_VERSION) { Slog.w(LOG_TAG, "User version " + mUserVersion + " didn't upgrade as expected to " + USER_VERSION); @@ -715,6 +731,7 @@ public class UserManagerService extends IUserManager.Stub { mUserRestrictions.append(UserHandle.USER_OWNER, restrictions); updateUserIdsLocked(); + initDefaultGuestRestrictions(); writeUserListLocked(); writeUserLocked(primary); |