Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d894e1d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "no_dupe_stuiff_qpr" into qt-qpr1-dev

* changes:
  Don't send duplicated user-start broadcast when booting on headless-system mode.
  Don't start first human user twice on headless-system mode.
parents f6a90fd2 4cb0ab9d
Loading
Loading
Loading
Loading
+48 −35
Original line number Diff line number Diff line
@@ -9023,7 +9023,16 @@ public class ActivityManagerService extends IActivityManager.Stub
                Integer.toString(currentUserId), currentUserId);
        mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_USER_FOREGROUND_START,
                Integer.toString(currentUserId), currentUserId);
        // On Automotive, at this point the system user has already been started and unlocked,
        // and some of the tasks we do here have already been done. So skip those in that case.
        // TODO(b/132262830): this workdound shouldn't be necessary once we move the
        // headless-user start logic to UserManager-land
        final boolean bootingSystemUser = currentUserId == UserHandle.USER_SYSTEM;
        if (bootingSystemUser) {
            mSystemServiceManager.startUser(currentUserId);
        }
        synchronized (this) {
            // Only start up encryption-aware persistent apps; once user is
@@ -9047,9 +9056,6 @@ public class ActivityManagerService extends IActivityManager.Stub
                    throw e.rethrowAsRuntimeException();
                }
            }
            // On Automotive, at this point the system user has already been started and unlocked,
            // and some of the tasks we do here have already been done. So skip those in that case.
            final boolean bootingSystemUser = currentUserId == UserHandle.USER_SYSTEM;
            if (bootingSystemUser) {
                mAtmInternal.startHomeOnAllDisplays(currentUserId, "systemReady");
@@ -9057,6 +9063,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            mAtmInternal.showSystemReadyErrorDialogsIfNeeded();
            if (bootingSystemUser) {
                final int callingUid = Binder.getCallingUid();
                final int callingPid = Binder.getCallingPid();
                long ident = Binder.clearCallingIdentity();
@@ -9088,8 +9095,14 @@ public class ActivityManagerService extends IActivityManager.Stub
                } finally {
                    Binder.restoreCallingIdentity(ident);
                }
            } else {
                Slog.i(TAG, "Not sending multi-user broadcasts for non-system user "
                        + currentUserId);
            }
            mAtmInternal.resumeTopActivities(false /* scheduleIdle */);
            if (bootingSystemUser) {
                mUserController.sendUserSwitchBroadcasts(-1, currentUserId);
            }
            BinderInternal.nSetBinderProxyCountWatermarks(BINDER_PROXY_HIGH_WATERMARK,
                    BINDER_PROXY_LOW_WATERMARK);