Update DisplayMetrics even on default display
am: 4309721843
Change-Id: Ib79935f0b80df42db789d94e0a88ac7a0b0b40d5
This commit is contained in:
@@ -839,19 +839,19 @@ public class ResourcesManager {
|
||||
tmpConfig = new Configuration();
|
||||
}
|
||||
tmpConfig.setTo(config);
|
||||
if (!isDefaultDisplay) {
|
||||
// Get new DisplayMetrics based on the DisplayAdjustments given
|
||||
// to the ResourcesImpl. Udate a copy if the CompatibilityInfo
|
||||
// changed, because the ResourcesImpl object will handle the
|
||||
// update internally.
|
||||
DisplayAdjustments daj = r.getDisplayAdjustments();
|
||||
if (compat != null) {
|
||||
daj = new DisplayAdjustments(daj);
|
||||
daj.setCompatibilityInfo(compat);
|
||||
}
|
||||
dm = getDisplayMetrics(displayId, daj);
|
||||
applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
|
||||
|
||||
// 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
|
||||
// update internally.
|
||||
DisplayAdjustments daj = r.getDisplayAdjustments();
|
||||
if (compat != null) {
|
||||
daj = new DisplayAdjustments(daj);
|
||||
daj.setCompatibilityInfo(compat);
|
||||
}
|
||||
dm = getDisplayMetrics(displayId, daj);
|
||||
applyNonDefaultDisplayMetricsToConfiguration(dm, tmpConfig);
|
||||
|
||||
if (hasOverrideConfiguration) {
|
||||
tmpConfig.updateFrom(key.mOverrideConfiguration);
|
||||
}
|
||||
|
||||
@@ -268,6 +268,10 @@ public class DisplayMetrics {
|
||||
}
|
||||
|
||||
public void setTo(DisplayMetrics o) {
|
||||
if (this == o) {
|
||||
return;
|
||||
}
|
||||
|
||||
widthPixels = o.widthPixels;
|
||||
heightPixels = o.heightPixels;
|
||||
density = o.density;
|
||||
|
||||
Reference in New Issue
Block a user