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

Skip to content
Commit 752c49b6 authored by Zimuzo Ezeozue's avatar Zimuzo Ezeozue
Browse files

Fix bindApplication starting activities late

With the attachApplication split introduced in
I659f2083f460701d858ebb7a8af9fa748ff4bfe9 apps send
a finishAttachApplication back to the system after
their initialization (Application#onCreate). The system
then dispatches Broadcast, Service and Activity starts
to the app. The delayed dispatch of Activity has 2 side
effects:

1. Apps could post messages on their main thread that will
run before activity start message which could slow down their
ttff.
2. The setFocusedApplication call is delayed and the system
doesn't know the focused application until after app init.

To mitigate this, we dispatch Activity start early before
app init.

Test: atest ActivityManagerTest
Bug: 319519089
Bug: 333663697
Bug: 382378705
Bug: 366147979
Bug: 358102320
Flag: com.android.server.am.expedite_activity_launch_on_cold_start

Change-Id: I762d6e943530133f8031a16f40eda97b4f476cd0
parent 5054fff0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment