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

Skip to content
Commit 961c7d4d authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Reduce updating focus when moving an activity which is not resumed yet

When starting an existing activity:
startActivityInner
 -> recycleTask
  -> setTargetRootTaskIfNeeded
   -> moveTaskToFront
     -> moveFocusableActivityToTop
The activity state is still STOPPED because it hasn't reached
resumeTopActivity. But getTopResumedActivity will also return
top focusable activity if there is no resumed activity. That causes
the focus is updated too early.

The focus will still be updated when setState(RESUMED) which also
invoke setLastResumedActivityUncheckLocked.

This can reduce duplicated window traversal for updating focus and
assigning layer.

Bug: 297502610
Test: ActivityTaskSupervisorTests#testUpdatePendingTopForTopResumed
      TestFragmentTests# \
      testIgnoreRequestedOrientationForActivityEmbeddingSplit
Change-Id: I795ba6d16b9668f772e47fc0415c296487074cdb
parent 7b193950
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment