summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Erik Wolsheimer <ewol@google.com> 2016-03-17 10:39:51 -0700
committer Erik Wolsheimer <ewol@google.com> 2016-03-17 10:49:28 -0700
commitec1a918f44d692271ea65cf5ec88bf79b9d1a96d (patch)
tree8ed94a8ba098d3c80e45b394b66e1f8320809cbc
parentce71deefca1f5fe53457f6092cda788023669693 (diff)
Prevent NPE via use of uninitialized mUserManager
BUG: 27718356 BUG: 27336841 Change-Id: Id603835b0463ca32f6a27ec255df7077f2427b06
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index d4dd50590c8a..8310c97de4aa 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -597,7 +597,7 @@ public class AccountManagerService
if (sharedAccounts == null || sharedAccounts.length == 0) return;
Account[] accounts = getAccountsAsUser(null, userId, mContext.getOpPackageName());
int parentUserId = UserManager.isSplitSystemUser()
- ? mUserManager.getUserInfo(userId).restrictedProfileParentId
+ ? getUserManager().getUserInfo(userId).restrictedProfileParentId
: UserHandle.USER_SYSTEM;
if (parentUserId < 0) {
Log.w(TAG, "User " + userId + " has shared accounts, but no parent user");
@@ -1061,7 +1061,7 @@ public class AccountManagerService
for (UserInfo user : users) {
if (user.isRestricted() && (parentUserId == user.restrictedProfileParentId)) {
addSharedAccountAsUser(account, user.id);
- if (mUserManager.isUserUnlocked(user.id)) {
+ if (getUserManager().isUserUnlocked(user.id)) {
mMessageHandler.sendMessage(mMessageHandler.obtainMessage(
MESSAGE_COPY_SHARED_ACCOUNT, parentUserId, user.id, account));
}
@@ -1270,7 +1270,7 @@ public class AccountManagerService
* Owner or system user account was renamed, rename the account for
* those users with which the account was shared.
*/
- List<UserInfo> users = mUserManager.getUsers(true);
+ List<UserInfo> users = getUserManager().getUsers(true);
for (UserInfo user : users) {
if (user.isRestricted()
&& (user.restrictedProfileParentId == parentUserId)) {
@@ -1286,7 +1286,7 @@ public class AccountManagerService
}
private boolean canHaveProfile(final int parentUserId) {
- final UserInfo userInfo = mUserManager.getUserInfo(parentUserId);
+ final UserInfo userInfo = getUserManager().getUserInfo(parentUserId);
return userInfo != null && userInfo.canHaveProfile();
}
@@ -1477,7 +1477,7 @@ public class AccountManagerService
int parentUserId = accounts.userId;
if (canHaveProfile(parentUserId)) {
// Remove from any restricted profiles that are sharing this account.
- List<UserInfo> users = mUserManager.getUsers(true);
+ List<UserInfo> users = getUserManager().getUsers(true);
for (UserInfo user : users) {
if (user.isRestricted() && parentUserId == (user.restrictedProfileParentId)) {
removeSharedAccountAsUser(account, user.id, callingUid);
@@ -4730,7 +4730,7 @@ public class AccountManagerService
|| callingUid == Process.myUid()) {
return unfiltered;
}
- UserInfo user = mUserManager.getUserInfo(userAccounts.userId);
+ UserInfo user = getUserManager().getUserInfo(userAccounts.userId);
if (user != null && user.isRestricted()) {
String[] packages = mPackageManager.getPackagesForUid(callingUid);
// If any of the packages is a white listed package, return the full set,