Merge "Fix call to get the current user id from a secondary SystemUI process." into oc-dev

am: 2349481d62

Change-Id: I65bea4faf799ea1b5d02ff1c4c514485f174ff1f
This commit is contained in:
Winson Chung
2017-05-17 19:26:24 +00:00
committed by android-build-merger
2 changed files with 7 additions and 2 deletions

View File

@@ -1029,7 +1029,12 @@ public class SystemServicesProxy {
* Returns the current user id.
*/
public int getCurrentUser() {
return KeyguardUpdateMonitor.getCurrentUser();
if (mAm == null) return 0;
// This must call through ActivityManager, as the SystemServicesProxy can be called in a
// secondary user's SystemUI process, and KeyguardUpdateMonitor is only updated in the
// primary user's SystemUI process
return mAm.getCurrentUser();
}
/**

View File

@@ -87,7 +87,7 @@ public class RecentsTaskLoadPlan {
mCurrentQuietProfiles.clear();
if (currentUserId == UserHandle.USER_CURRENT) {
currentUserId = KeyguardUpdateMonitor.getCurrentUser();
currentUserId = SystemServicesProxy.getInstance(mContext).getCurrentUser();
}
UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
List<UserInfo> profiles = userManager.getProfiles(currentUserId);