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

Commit 37fc6b90 authored by Chilun's avatar Chilun
Browse files

Re-route to default display if the home activity doesn't support multi-display

If a user operates on secondary display to change the default home,
system will launch the home activity on secondary display even if the
home activity is not support multi-display.

Add more conditions to re-route to default display if the home activity
doesn't support multi-display when deciding the prefer task display
area.

Bug: 179329207
Test: atest ActivityStarterTests
Change-Id: I32e3f369f03f60c6e8891f2876272c5e6b375eb5
parent f18be559
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -439,6 +439,13 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier {
            taskDisplayArea = mSupervisor.mRootWindowContainer.getDefaultTaskDisplayArea();
        }

        // Re-route to default display if the home activity doesn't support multi-display
        if (taskDisplayArea != null && activityRecord.isActivityTypeHome()
                && !mSupervisor.mRootWindowContainer.canStartHomeOnDisplayArea(activityRecord.info,
                        taskDisplayArea, false /* allowInstrumenting */)) {
            taskDisplayArea = mSupervisor.mRootWindowContainer.getDefaultTaskDisplayArea();
        }

        return (taskDisplayArea != null)
                ? taskDisplayArea
                : getFallbackDisplayAreaForActivity(activityRecord, request);