summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/DisplayInfo.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-12-05 12:28:25 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-05 12:28:25 -0800
commit384e6fe84d446067dccec69404e4a3ca507ebe07 (patch)
tree27c2cead41faada62dec81aa56025eb88f9c230d /core/java/android/view/DisplayInfo.java
parentfb21aa84a804c8d7dd0aad7df1e4a336ed59f991 (diff)
parent1edc61119d145b05f0b5e1323a2fc0fa6a29d4bc (diff)
downloadframeworks_base-384e6fe84d446067dccec69404e4a3ca507ebe07.zip
frameworks_base-384e6fe84d446067dccec69404e4a3ca507ebe07.tar.gz
frameworks_base-384e6fe84d446067dccec69404e4a3ca507ebe07.tar.bz2
am 1edc6111: am 61e21940: am 7fcb5dc5: Merge "Pin electron beam surface to natural orientation." into jb-mr1.1-dev
* commit '1edc61119d145b05f0b5e1323a2fc0fa6a29d4bc': Pin electron beam surface to natural orientation.
Diffstat (limited to 'core/java/android/view/DisplayInfo.java')
-rw-r--r--core/java/android/view/DisplayInfo.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java
index f3841d5..305fd5c 100644
--- a/core/java/android/view/DisplayInfo.java
+++ b/core/java/android/view/DisplayInfo.java
@@ -285,6 +285,16 @@ public final class DisplayInfo implements Parcelable {
getMetricsWithSize(outMetrics, cih, logicalWidth, logicalHeight);
}
+ public int getNaturalWidth() {
+ return rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180 ?
+ logicalWidth : logicalHeight;
+ }
+
+ public int getNaturalHeight() {
+ return rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180 ?
+ logicalHeight : logicalWidth;
+ }
+
private void getMetricsWithSize(DisplayMetrics outMetrics, CompatibilityInfoHolder cih,
int width, int height) {
outMetrics.densityDpi = outMetrics.noncompatDensityDpi = logicalDensityDpi;