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

Commit 2f9ea1ec authored by Mark Renouf's avatar Mark Renouf
Browse files

Only call -rerouted callback if displayId changed

This moves the new listener callback method inside
the displayId conditional. Without this, the callback
is invoked for the initial Bubble activity start by
SystemUI.

Test: atest ActivityManagerMultiDisplayTests#testSingleTaskInstanceDisplay
Bug: 127322070
Change-Id: Ie8d0f4cef82ce77c2b806e9349ec60bc296ef726
parent 14696c13
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2430,17 +2430,17 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
            final boolean singleTaskInstance = preferredDisplay != null
                    && preferredDisplay.isSingleTaskInstance();

            if (singleTaskInstance) {
            if (preferredDisplayId != actualDisplayId) {
                // Suppress the warning toast if the preferredDisplay was set to singleTask.
                // The singleTaskInstance displays will only contain one task and any attempt to
                // launch new task will re-route to the default display.
                if (singleTaskInstance) {
                    mService.getTaskChangeNotificationController()
                            .notifyActivityLaunchOnSecondaryDisplayRerouted(task.getTaskInfo(),
                                    preferredDisplayId);
                    return;
                }

            if (preferredDisplayId != actualDisplayId) {
                Slog.w(TAG, "Failed to put " + task + " on display " + preferredDisplayId);
                // Display a warning toast that we failed to put a task on a secondary display.
                mService.getTaskChangeNotificationController()