diff options
author | Roman Birg <roman@cyngn.com> | 2016-03-11 15:12:53 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-03-14 08:38:56 -0700 |
commit | ea229d417f4ef641564c535246c41cdf96284ffd (patch) | |
tree | c744b26f3eb7dac1750d53aa4a4c8fb410f8f307 | |
parent | 7f6a0c2e36aa4567477622757c220c163b48f633 (diff) | |
download | frameworks_base-ea229d417f4ef641564c535246c41cdf96284ffd.zip frameworks_base-ea229d417f4ef641564c535246c41cdf96284ffd.tar.gz frameworks_base-ea229d417f4ef641564c535246c41cdf96284ffd.tar.bz2 |
fix metrics density comparisons
In Resources.java, we explicitly call setDensity() on the local
DisplayMetircs object when there is a configuration update - which
sets some more fields than the original implementation.
In fw/b/core/java/android/app/Presentation.java there is a DisplayInfo
comparison which fails because our getMetricsWithSize() did not always
set those fields that updateConfiguration would always set.
So now we always return a DisplayMetrics object with the fields filled
out as expected.
Ref: OPO-539
Change-Id: Ie80e7a9cfd249ec59d31b4044ad09e07e34d1194
Signed-off-by: Roman Birg <roman@cyngn.com>
-rw-r--r-- | core/java/android/view/DisplayInfo.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java index d43b962..85321f9 100644 --- a/core/java/android/view/DisplayInfo.java +++ b/core/java/android/view/DisplayInfo.java @@ -567,6 +567,8 @@ public final class DisplayInfo implements Parcelable { } else if (type == Display.TYPE_BUILT_IN && (flags & Display.FLAG_PRESENTATION) == 0) { outMetrics.setDensity(DisplayMetrics.DENSITY_PREFERRED); + } else { + outMetrics.setDensity(logicalDensityDpi); } } |