OSDN Git Service

Fix regression with defaultDisplay adjustments
authorAdam Lesinski <adamlesinski@google.com>
Tue, 18 Oct 2016 19:58:27 +0000 (12:58 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Tue, 18 Oct 2016 20:13:57 +0000 (20:13 +0000)
ag/1542219 introduced a regression where if the display was the default
display, the configuration would still be adjusted as if it were
a non-default display. This fixes that logic to only adjust the
configuration if the display is non-default.

Bug:32133693
Test: cts-tradefed run cts --module CtsServicesHostTestCases --test android.server.cts.ActivityManagerAppConfigurationTests#testConfigurationUpdatesWhenRotatingToSideFromDocked
Change-Id: Ib2fda8c1651609efa9d20b3e2dace8a122864916

core/java/android/app/ResourcesManager.java

index 8adec03..5cc064e 100644 (file)
@@ -850,7 +850,10 @@ public class ResourcesManager {
                             daj.setCompatibilityInfo(compat);
                         }
                         dm = getDisplayMetrics(displayId, daj);
-                        applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
+
+                        if (!isDefaultDisplay) {
+                            applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
+                        }
 
                         if (hasOverrideConfiguration) {
                             tmpConfig.updateFrom(key.mOverrideConfiguration);