summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-04-20 00:29:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-20 00:29:45 +0000
commit7f801fe0d12ca68d5a2810d17c0e59efca9054db (patch)
tree0a51e6cbaf817ed789e707eab5eef326770f19dd /core/java/android
parent9bca3a380df5de411e361f698c11a3b1c78f04ea (diff)
parentb6415618f1c5e72c44bf342cf4bd8667ebb8abff (diff)
Merge "Try to reland Ib3ee007bc" into rvc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/Presentation.java6
-rw-r--r--core/java/android/app/ResourcesManager.java15
2 files changed, 9 insertions, 12 deletions
diff --git a/core/java/android/app/Presentation.java b/core/java/android/app/Presentation.java
index 7a18b8120d7e..bae6ab5ea80c 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.");
+ + "display metrics have changed since it was created while onStart.");
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.");
+ Log.i(TAG, "Presentation is being dismissed because the display metrics have changed "
+ + "since it was created while handleDisplayChanged.");
cancel();
}
}
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index 47ccc2f0badb..c2caa40ba950 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -1111,7 +1111,6 @@ 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
@@ -1121,17 +1120,15 @@ public class ResourcesManager {
daj = new DisplayAdjustments(daj);
daj.setCompatibilityInfo(compat);
}
- if (displayId == Display.DEFAULT_DISPLAY) {
- daj.setConfiguration(config);
- }
- DisplayMetrics dm = getDisplayMetrics(displayId, daj);
- if (displayId != Display.DEFAULT_DISPLAY) {
- applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
- }
-
+ tmpConfig.setTo(config);
if (hasOverrideConfiguration) {
tmpConfig.updateFrom(key.mOverrideConfiguration);
}
+ // Only apply for default display
+ if (displayId == Display.DEFAULT_DISPLAY) {
+ daj.setConfiguration(tmpConfig);
+ }
+ DisplayMetrics dm = getDisplayMetrics(displayId, daj);
resourcesImpl.updateConfiguration(tmpConfig, dm, compat);
}