Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −4 Original line number Diff line number Diff line Loading @@ -2016,10 +2016,7 @@ final class ActivityRecord extends ConfigurationContainer { stopped = false; if (isActivityTypeHome()) { WindowProcessController app = task.mActivities.get(0).app; if (hasProcess() && app != mAtmService.mHomeProcess) { mAtmService.mHomeProcess = app; } mStackSupervisor.updateHomeProcess(task.mActivities.get(0).app); } if (nowVisible) { Loading services/core/java/com/android/server/wm/ActivityStackSupervisor.java +19 −1 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { static final int LAUNCH_TASK_BEHIND_COMPLETE = FIRST_SUPERVISOR_STACK_MSG + 12; static final int REPORT_MULTI_WINDOW_MODE_CHANGED_MSG = FIRST_SUPERVISOR_STACK_MSG + 14; static final int REPORT_PIP_MODE_CHANGED_MSG = FIRST_SUPERVISOR_STACK_MSG + 15; static final int REPORT_HOME_CHANGED_MSG = FIRST_SUPERVISOR_STACK_MSG + 16; // Used to indicate that windows of activities should be preserved during the resize. static final boolean PRESERVE_WINDOWS = true; Loading Loading @@ -793,7 +794,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { System.identityHashCode(r), task.taskId, r.shortComponentName); if (r.isActivityTypeHome()) { // Home process is the root process of the task. mService.mHomeProcess = task.mActivities.get(0).app; updateHomeProcess(task.mActivities.get(0).app); } mService.getPackageManagerInternalLocked().notifyPackageUse( r.intent.getComponent().getPackageName(), NOTIFY_PACKAGE_USE_ACTIVITY); Loading Loading @@ -915,6 +916,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { return true; } void updateHomeProcess(WindowProcessController app) { if (app != null && mService.mHomeProcess != app) { if (!mHandler.hasMessages(REPORT_HOME_CHANGED_MSG)) { mHandler.sendEmptyMessage(REPORT_HOME_CHANGED_MSG); } mService.mHomeProcess = app; } } private void logIfTransactionTooLarge(Intent intent, Bundle icicle) { int extrasSize = 0; if (intent != null) { Loading Loading @@ -2540,7 +2550,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { } } } break; case REPORT_HOME_CHANGED_MSG: { synchronized (mService.mGlobalLock) { mHandler.removeMessages(REPORT_HOME_CHANGED_MSG); // Start home activities on displays with no activities. mRootActivityContainer.startHomeOnEmptyDisplays("homeChanged"); } } break; } } } Loading services/core/java/com/android/server/wm/RootActivityContainer.java +9 −0 Original line number Diff line number Diff line Loading @@ -336,6 +336,15 @@ class RootActivityContainer extends ConfigurationContainer return homeStarted; } void startHomeOnEmptyDisplays(String reason) { for (int i = mActivityDisplays.size() - 1; i >= 0; i--) { final ActivityDisplay display = mActivityDisplays.get(i); if (display.topRunningActivity() == null) { startHomeOnDisplay(mCurrentUser, reason, display.mDisplayId); } } } /** * This starts home activity on displays that can have system decorations and only if the * home activity can have multiple instances. Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −4 Original line number Diff line number Diff line Loading @@ -2016,10 +2016,7 @@ final class ActivityRecord extends ConfigurationContainer { stopped = false; if (isActivityTypeHome()) { WindowProcessController app = task.mActivities.get(0).app; if (hasProcess() && app != mAtmService.mHomeProcess) { mAtmService.mHomeProcess = app; } mStackSupervisor.updateHomeProcess(task.mActivities.get(0).app); } if (nowVisible) { Loading
services/core/java/com/android/server/wm/ActivityStackSupervisor.java +19 −1 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { static final int LAUNCH_TASK_BEHIND_COMPLETE = FIRST_SUPERVISOR_STACK_MSG + 12; static final int REPORT_MULTI_WINDOW_MODE_CHANGED_MSG = FIRST_SUPERVISOR_STACK_MSG + 14; static final int REPORT_PIP_MODE_CHANGED_MSG = FIRST_SUPERVISOR_STACK_MSG + 15; static final int REPORT_HOME_CHANGED_MSG = FIRST_SUPERVISOR_STACK_MSG + 16; // Used to indicate that windows of activities should be preserved during the resize. static final boolean PRESERVE_WINDOWS = true; Loading Loading @@ -793,7 +794,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { System.identityHashCode(r), task.taskId, r.shortComponentName); if (r.isActivityTypeHome()) { // Home process is the root process of the task. mService.mHomeProcess = task.mActivities.get(0).app; updateHomeProcess(task.mActivities.get(0).app); } mService.getPackageManagerInternalLocked().notifyPackageUse( r.intent.getComponent().getPackageName(), NOTIFY_PACKAGE_USE_ACTIVITY); Loading Loading @@ -915,6 +916,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { return true; } void updateHomeProcess(WindowProcessController app) { if (app != null && mService.mHomeProcess != app) { if (!mHandler.hasMessages(REPORT_HOME_CHANGED_MSG)) { mHandler.sendEmptyMessage(REPORT_HOME_CHANGED_MSG); } mService.mHomeProcess = app; } } private void logIfTransactionTooLarge(Intent intent, Bundle icicle) { int extrasSize = 0; if (intent != null) { Loading Loading @@ -2540,7 +2550,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { } } } break; case REPORT_HOME_CHANGED_MSG: { synchronized (mService.mGlobalLock) { mHandler.removeMessages(REPORT_HOME_CHANGED_MSG); // Start home activities on displays with no activities. mRootActivityContainer.startHomeOnEmptyDisplays("homeChanged"); } } break; } } } Loading
services/core/java/com/android/server/wm/RootActivityContainer.java +9 −0 Original line number Diff line number Diff line Loading @@ -336,6 +336,15 @@ class RootActivityContainer extends ConfigurationContainer return homeStarted; } void startHomeOnEmptyDisplays(String reason) { for (int i = mActivityDisplays.size() - 1; i >= 0; i--) { final ActivityDisplay display = mActivityDisplays.get(i); if (display.topRunningActivity() == null) { startHomeOnDisplay(mCurrentUser, reason, display.mDisplayId); } } } /** * This starts home activity on displays that can have system decorations and only if the * home activity can have multiple instances. Loading