Loading core/java/android/app/Presentation.java +1 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ public class Presentation extends Dialog { private boolean isConfigurationStillValid() { DisplayMetrics dm = new DisplayMetrics(); mDisplay.getMetrics(dm); return dm.equals(getResources().getDisplayMetrics()); return dm.equalsPhysical(getResources().getDisplayMetrics()); } private static Context createPresentationContext( Loading core/java/android/util/DisplayMetrics.java +15 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading
core/java/android/app/Presentation.java +1 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ public class Presentation extends Dialog { private boolean isConfigurationStillValid() { DisplayMetrics dm = new DisplayMetrics(); mDisplay.getMetrics(dm); return dm.equals(getResources().getDisplayMetrics()); return dm.equalsPhysical(getResources().getDisplayMetrics()); } private static Context createPresentationContext( Loading
core/java/android/util/DisplayMetrics.java +15 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading