Skip to content
Commit ab67294b authored by wilsonshih's avatar wilsonshih
Browse files

Fix displayId unsynced between app and system server.

If an activity is launched on non-default display and calls setVrModeEnabled
at onCreate stage, the server will move this task to default display. Then
ActivityThread.handleResumeActivity will crash because ViewRootImpl still
use the old display.

First, the launch activity process will create a ClientTransaction
object, with first transaction item is LaunchActivityItem, and lifecycle state
set as ResumeActivityItem. When client side starts to execute this
transaction, ensureActivityConfiguration will schedule MoveToDisplayItem
to another transaction, however, it cannot be execute before first transaction
completes.

We can resolve this problem by using the display ID associated with the
WindowToken for a Window (when available), this will always have the most
up-to-date value from the server.

Also re-sort imports.

bug: 72181603
bug: 112330955
Test: atest CtsActivityManagerDeviceTestCases
Test: atest CtsWindowManagerDeviceTestCases
Test: wm-smoke
Change-Id: I39a59cf3520a15b486e675284f9aed275343d3cf
parent a2e28a4b
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