summaryrefslogtreecommitdiffstats
path: root/core/java/android/util
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-11-29 14:28:24 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-11-29 14:28:24 -0800
commit84ea428d24dedc4b9a44bf6b2c9419b3545a03b8 (patch)
treee946f21bdcf6f57b2052647159e103e1af66c707 /core/java/android/util
parenta3aef5ff62e1dbdf85c3a7498202d04c808a92da (diff)
parented8c323a6c776540de356d6fc7d902cc5916fef5 (diff)
downloadframeworks_base-84ea428d24dedc4b9a44bf6b2c9419b3545a03b8.zip
frameworks_base-84ea428d24dedc4b9a44bf6b2c9419b3545a03b8.tar.gz
frameworks_base-84ea428d24dedc4b9a44bf6b2c9419b3545a03b8.tar.bz2
am ed8c323a: am 38e84700: Merge "Fix issue #7585876: When changing the font settings, the movie..." into jb-mr1.1-dev
* commit 'ed8c323a6c776540de356d6fc7d902cc5916fef5': Fix issue #7585876: When changing the font settings, the movie...
Diffstat (limited to 'core/java/android/util')
-rw-r--r--core/java/android/util/DisplayMetrics.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java
index 85e4b9d..e856501 100644
--- a/core/java/android/util/DisplayMetrics.java
+++ b/core/java/android/util/DisplayMetrics.java
@@ -232,19 +232,32 @@ public class DisplayMetrics {
* @return True if the display metrics are equal.
*/
public boolean equals(DisplayMetrics other) {
+ return equalsPhysical(other)
+ && scaledDensity == other.scaledDensity
+ && noncompatScaledDensity == other.noncompatScaledDensity;
+ }
+
+ /**
+ * Returns true if the physical aspects of the two display metrics
+ * are equal. This ignores the scaled density, which is a logical
+ * attribute based on the current desired font size.
+ *
+ * @param other The display metrics with which to compare.
+ * @return True if the display metrics are equal.
+ * @hide
+ */
+ public boolean equalsPhysical(DisplayMetrics other) {
return other != null
&& widthPixels == other.widthPixels
&& heightPixels == other.heightPixels
&& density == other.density
&& densityDpi == other.densityDpi
- && scaledDensity == other.scaledDensity
&& xdpi == other.xdpi
&& ydpi == other.ydpi
&& noncompatWidthPixels == other.noncompatWidthPixels
&& noncompatHeightPixels == other.noncompatHeightPixels
&& noncompatDensity == other.noncompatDensity
&& noncompatDensityDpi == other.noncompatDensityDpi
- && noncompatScaledDensity == other.noncompatScaledDensity
&& noncompatXdpi == other.noncompatXdpi
&& noncompatYdpi == other.noncompatYdpi;
}