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

Commit 050cb7ed authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Direct set activity type to requested config when creating task

The simple setter is >10 times faster.

The setActivityType will invoke onConfigurationChanged that runs
the config resolving logic. It is unnecessary for a task which is
not attached yet, because when the task is added to a parent,
the onConfigurationChanged will run again to handle latest state.

Bug: 297502610
Flag: EXEMPT reduce duplicated invocation
Test: TaskTests
Change-Id: Ib11bbe19ab025665485b0448d24e6f1ad625f3c5
parent ea8e96ba
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6891,7 +6891,9 @@ class Task extends TaskFragment {
            // Set activity type before adding the root task to TaskDisplayArea, so home task can
            // be cached, see TaskDisplayArea#addRootTaskReferenceIfNeeded().
            if (mActivityType != ACTIVITY_TYPE_UNDEFINED) {
                task.setActivityType(mActivityType);
                // Set directly because onParentChanged will propagate it.
                task.getRequestedOverrideConfiguration().windowConfiguration.setActivityType(
                        mActivityType);
            }

            if (mParent != null) {