OSDN Git Service

Restrict when a window receives new Configurations.
authorBryce Lee <brycelee@google.com>
Thu, 21 Sep 2017 17:38:20 +0000 (10:38 -0700)
committerBryce Lee <brycelee@google.com>
Mon, 25 Sep 2017 20:17:10 +0000 (13:17 -0700)
commit2b17afd33075ddb81bbaa9616750cfeb5ee13665
treeece7c9281ff2feb29074cace60d2b117f3475601
parent082e11b28db6d1da074dad8a12591fabfce378ab
Restrict when a window receives new Configurations.

It is possible that a window will relayout while it's being hidden,
but after the Configuration has changed. In this case, the window can
receive an updated Configuration incompatible with its settings.
Additionally, an Activity's window may relayout and receive a
Configuration during resume after its visibility has changed but
before the Configuration has been updated based on the current
AppWindowTokens.

This changelist addresses these issues by first only sending an
updated Configuration to the client if the associated AppWindowToken
is not requested to be hidden. In this case, the last reported
Configuration is returned instead. For the resume issue, we
address the race condition by making setting the visibility and
updating the configuration synchronized.

Fixes: 64916689
Test: go/wm-smoke
Test: place clock widget on launcher, launch landscape only activity,
      return to launcher, verify layout.

Change-Id: Ie07068be64120c2fdbe380d58af330372df6a1ab
services/core/java/com/android/server/am/ActivityStack.java
services/core/java/com/android/server/wm/WindowManagerService.java
services/core/java/com/android/server/wm/WindowState.java
services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java