Loading services/core/java/com/android/server/location/UserInfoStore.java +30 −13 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.UserInfo; import android.os.Binder; import android.os.Build; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -152,7 +153,7 @@ public class UserInfoStore { // this intent is only sent to the current user if (mCachedParentUserId == mCurrentUserId) { mCachedParentUserId = UserHandle.USER_NULL; mCachedProfileUserIds = null; mCachedProfileUserIds = new int[]{UserHandle.USER_NULL}; } } Loading Loading @@ -185,6 +186,8 @@ public class UserInfoStore { } else { Preconditions.checkState(mUserManager != null); long identity = Binder.clearCallingIdentity(); try { UserInfo userInfo = mUserManager.getProfileParent(userId); if (userInfo != null) { parentUserId = userInfo.id; Loading @@ -195,6 +198,9 @@ public class UserInfoStore { // force profiles into cache getProfileUserIdsForParentUser(parentUserId); } finally { Binder.restoreCallingIdentity(identity); } } return parentUserId; Loading @@ -204,13 +210,24 @@ public class UserInfoStore { private int[] getProfileUserIdsForParentUser(@UserIdInt int parentUserId) { Preconditions.checkState(mUserManager != null); // only assert on debug builds as this is a more expensive check if (Build.IS_DEBUGGABLE) { long identity = Binder.clearCallingIdentity(); try { Preconditions.checkArgument(mUserManager.getProfileParent(parentUserId) == null); } finally { Binder.restoreCallingIdentity(identity); } } if (parentUserId != mCachedParentUserId) { long identity = Binder.clearCallingIdentity(); try { mCachedParentUserId = parentUserId; mCachedProfileUserIds = mUserManager.getProfileIdsWithDisabled(parentUserId); } finally { Binder.restoreCallingIdentity(identity); } } return mCachedProfileUserIds; Loading Loading
services/core/java/com/android/server/location/UserInfoStore.java +30 −13 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.UserInfo; import android.os.Binder; import android.os.Build; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -152,7 +153,7 @@ public class UserInfoStore { // this intent is only sent to the current user if (mCachedParentUserId == mCurrentUserId) { mCachedParentUserId = UserHandle.USER_NULL; mCachedProfileUserIds = null; mCachedProfileUserIds = new int[]{UserHandle.USER_NULL}; } } Loading Loading @@ -185,6 +186,8 @@ public class UserInfoStore { } else { Preconditions.checkState(mUserManager != null); long identity = Binder.clearCallingIdentity(); try { UserInfo userInfo = mUserManager.getProfileParent(userId); if (userInfo != null) { parentUserId = userInfo.id; Loading @@ -195,6 +198,9 @@ public class UserInfoStore { // force profiles into cache getProfileUserIdsForParentUser(parentUserId); } finally { Binder.restoreCallingIdentity(identity); } } return parentUserId; Loading @@ -204,13 +210,24 @@ public class UserInfoStore { private int[] getProfileUserIdsForParentUser(@UserIdInt int parentUserId) { Preconditions.checkState(mUserManager != null); // only assert on debug builds as this is a more expensive check if (Build.IS_DEBUGGABLE) { long identity = Binder.clearCallingIdentity(); try { Preconditions.checkArgument(mUserManager.getProfileParent(parentUserId) == null); } finally { Binder.restoreCallingIdentity(identity); } } if (parentUserId != mCachedParentUserId) { long identity = Binder.clearCallingIdentity(); try { mCachedParentUserId = parentUserId; mCachedProfileUserIds = mUserManager.getProfileIdsWithDisabled(parentUserId); } finally { Binder.restoreCallingIdentity(identity); } } return mCachedProfileUserIds; Loading