diff options
| author | Darryl Johnson <darryljohnson@google.com> | 2020-04-24 23:31:30 +0000 |
|---|---|---|
| committer | Darryl Johnson <darryljohnson@google.com> | 2020-04-24 23:50:53 +0000 |
| commit | 87f93a5585809ebf2979668ce08066a6c95fc4b3 (patch) | |
| tree | eccf794bfbefe61f9da7aa2a1651bc78b7a77653 /core/java | |
| parent | b6415618f1c5e72c44bf342cf4bd8667ebb8abff (diff) | |
Revert "Try to reland Ib3ee007bc"
This reverts commit b6415618f1c5e72c44bf342cf4bd8667ebb8abff.
Reason for revert: Caused regression of b/149213586
Bug: 148639826
Bug: 149213586
Change-Id: I5248e03b42e3f24a6e2abb134d0bf339e77f484b
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/Presentation.java | 6 | ||||
| -rw-r--r-- | core/java/android/app/ResourcesManager.java | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/core/java/android/app/Presentation.java b/core/java/android/app/Presentation.java index bae6ab5ea80c..7a18b8120d7e 100644 --- a/core/java/android/app/Presentation.java +++ b/core/java/android/app/Presentation.java @@ -236,7 +236,7 @@ public class Presentation extends Dialog { // to be rare but surprising, so we'll write a log message about it. if (!isConfigurationStillValid()) { Log.i(TAG, "Presentation is being dismissed because the " - + "display metrics have changed since it was created while onStart."); + + "display metrics have changed since it was created."); mHandler.sendEmptyMessage(MSG_CANCEL); } } @@ -296,8 +296,8 @@ public class Presentation extends Dialog { // is invalid and the application must recreate the presentation to get // a new context. if (!isConfigurationStillValid()) { - Log.i(TAG, "Presentation is being dismissed because the display metrics have changed " - + "since it was created while handleDisplayChanged."); + Log.i(TAG, "Presentation is being dismissed because the " + + "display metrics have changed since it was created."); cancel(); } } diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java index c2caa40ba950..47ccc2f0badb 100644 --- a/core/java/android/app/ResourcesManager.java +++ b/core/java/android/app/ResourcesManager.java @@ -1111,6 +1111,7 @@ public class ResourcesManager { } int displayId = key.mDisplayId; final boolean hasOverrideConfiguration = key.hasOverrideConfiguration(); + tmpConfig.setTo(config); // Get new DisplayMetrics based on the DisplayAdjustments given to the ResourcesImpl. Update // a copy if the CompatibilityInfo changed, because the ResourcesImpl object will handle the @@ -1120,15 +1121,17 @@ public class ResourcesManager { daj = new DisplayAdjustments(daj); daj.setCompatibilityInfo(compat); } - tmpConfig.setTo(config); - if (hasOverrideConfiguration) { - tmpConfig.updateFrom(key.mOverrideConfiguration); - } - // Only apply for default display if (displayId == Display.DEFAULT_DISPLAY) { - daj.setConfiguration(tmpConfig); + daj.setConfiguration(config); } DisplayMetrics dm = getDisplayMetrics(displayId, daj); + if (displayId != Display.DEFAULT_DISPLAY) { + applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig); + } + + if (hasOverrideConfiguration) { + tmpConfig.updateFrom(key.mOverrideConfiguration); + } resourcesImpl.updateConfiguration(tmpConfig, dm, compat); } |
