diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 5649876f2633d..aa3bb22a2d357 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8183,8 +8183,8 @@ public class ActivityManagerService extends IActivityManager.Stub // do this when the system user is not setup since the setup wizard should be the one // to handle home activity in this case. if (UserManager.isSplitSystemUser() && - Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.USER_SETUP_COMPLETE, 0) != 0 + Settings.Secure.getIntForUser(mContext.getContentResolver(), + Settings.Secure.USER_SETUP_COMPLETE, 0, currentUserId) != 0 || SystemProperties.getBoolean(SYSTEM_USER_HOME_NEEDED, false)) { t.traceBegin("enableHomeActivity"); ComponentName cName = new ComponentName(mContext, SystemUserHomeActivity.class); diff --git a/services/core/java/com/android/server/am/ActivityManagerUtils.java b/services/core/java/com/android/server/am/ActivityManagerUtils.java index 5506ad1b245b0..9be553c49a35c 100644 --- a/services/core/java/com/android/server/am/ActivityManagerUtils.java +++ b/services/core/java/com/android/server/am/ActivityManagerUtils.java @@ -16,6 +16,7 @@ package com.android.server.am; import android.app.ActivityThread; +import android.content.ContentResolver; import android.provider.Settings; import android.util.ArrayMap; @@ -53,9 +54,12 @@ public class ActivityManagerUtils { static int getAndroidIdHash() { // No synchronization is required. Double-initialization is fine here. if (sAndroidIdHash == null) { - final String androidId = Settings.Secure.getString( - ActivityThread.currentApplication().getContentResolver(), - Settings.Secure.ANDROID_ID); + final ContentResolver resolver = ActivityThread.currentApplication() + .getContentResolver(); + final String androidId = Settings.Secure.getStringForUser( + resolver, + Settings.Secure.ANDROID_ID, + resolver.getUserId()); sAndroidIdHash = getUnsignedHashUnCached( sInjectedAndroidId != null ? sInjectedAndroidId : androidId); } diff --git a/services/core/java/com/android/server/am/ProcessErrorStateRecord.java b/services/core/java/com/android/server/am/ProcessErrorStateRecord.java index 653ece4a883c2..35e29962a1ce7 100644 --- a/services/core/java/com/android/server/am/ProcessErrorStateRecord.java +++ b/services/core/java/com/android/server/am/ProcessErrorStateRecord.java @@ -28,6 +28,7 @@ import android.app.AnrController; import android.app.ApplicationErrorReport; import android.app.ApplicationExitInfo; import android.content.ComponentName; +import android.content.ContentResolver; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.IncrementalStatesInfo; @@ -626,8 +627,11 @@ class ProcessErrorStateRecord { } private boolean getShowBackground() { - return Settings.Secure.getInt(mService.mContext.getContentResolver(), - Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; + final ContentResolver resolver = mService.mContext.getContentResolver(); + return Settings.Secure.getIntForUser(resolver, + Settings.Secure.ANR_SHOW_BACKGROUND, + 0, + resolver.getUserId()) != 0; } /** diff --git a/services/core/java/com/android/server/wm/ActivityStartController.java b/services/core/java/com/android/server/wm/ActivityStartController.java index 32ed4725b3b45..b0ad5a9e4bb27 100644 --- a/services/core/java/com/android/server/wm/ActivityStartController.java +++ b/services/core/java/com/android/server/wm/ActivityStartController.java @@ -218,8 +218,8 @@ public class ActivityStartController { vers = ri.activityInfo.applicationInfo.metaData.getString( Intent.METADATA_SETUP_VERSION); } - String lastVers = Settings.Secure.getString( - resolver, Settings.Secure.LAST_SETUP_SHOWN); + String lastVers = Settings.Secure.getStringForUser( + resolver, Settings.Secure.LAST_SETUP_SHOWN, resolver.getUserId()); if (vers != null && !vers.equals(lastVers)) { intent.setFlags(FLAG_ACTIVITY_NEW_TASK); intent.setComponent(new ComponentName(