diff options
| author | Charles Chen <charlesccchen@google.com> | 2020-03-27 16:42:29 +0800 |
|---|---|---|
| committer | Charles Chen <charlesccchen@google.com> | 2020-04-14 16:57:18 +0800 |
| commit | 7ba8e26c87ff1fee827204dc076071590a657f8e (patch) | |
| tree | a329af70cb48f000b4b4b429fd48e85567f6b9bd /core/java/android/app/WindowTokenClient.java | |
| parent | 1a46294fdb9867d1a965c034ef46f281f7c9fe21 (diff) | |
Fix WindowContextTests
Previously, window token assigns last config to mLastReportedConfiguration
directly, which makes it share the same reference with getConfiguration(),
and blocks all config changes request to clients.
This CL uses Configuration#setTo instead.
fixes: 152227175
Bug: 150251036
Test: atest WindowContextTests
Change-Id: I44143aa558f223eb301e28f2e9110bfd66eac636
Diffstat (limited to 'core/java/android/app/WindowTokenClient.java')
| -rw-r--r-- | core/java/android/app/WindowTokenClient.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/java/android/app/WindowTokenClient.java b/core/java/android/app/WindowTokenClient.java index 301960ec53f9..b5d103959818 100644 --- a/core/java/android/app/WindowTokenClient.java +++ b/core/java/android/app/WindowTokenClient.java @@ -67,13 +67,11 @@ public class WindowTokenClient extends IWindowToken.Stub { } final int currentDisplayId = context.getDisplayId(); final boolean displayChanged = newDisplayId != currentDisplayId; - final Configuration config = new Configuration(context.getResources() - .getConfiguration()); - final boolean configChanged = config.isOtherSeqNewer(newConfig) - && config.updateFrom(newConfig) != 0; + final Configuration config = context.getResources().getConfiguration(); + final boolean configChanged = config.diff(newConfig) != 0; if (displayChanged || configChanged) { // TODO(ag/9789103): update resource manager logic to track non-activity tokens - mResourcesManager.updateResourcesForActivity(this, config, newDisplayId, + mResourcesManager.updateResourcesForActivity(this, newConfig, newDisplayId, displayChanged); } if (displayChanged) { |
