diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-11-29 14:28:24 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-29 14:28:24 -0800 |
commit | 84ea428d24dedc4b9a44bf6b2c9419b3545a03b8 (patch) | |
tree | e946f21bdcf6f57b2052647159e103e1af66c707 /core/java/android/util | |
parent | a3aef5ff62e1dbdf85c3a7498202d04c808a92da (diff) | |
parent | ed8c323a6c776540de356d6fc7d902cc5916fef5 (diff) | |
download | frameworks_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.java | 17 |
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; } |