diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-05-16 13:10:23 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-16 13:10:23 -0700 |
commit | 0eac092766d7871b34927442ee0b6e27e7e1317b (patch) | |
tree | b3b3e548c6d1c01a94cb929cde9442c6fc0698ab /core/java | |
parent | 9d0f2c6d970a1d2c7f9de5c9e89737d7772f95d3 (diff) | |
parent | 68066c2f38e47b56f0510c56eafd827731a0dc08 (diff) | |
download | frameworks_base-0eac092766d7871b34927442ee0b6e27e7e1317b.zip frameworks_base-0eac092766d7871b34927442ee0b6e27e7e1317b.tar.gz frameworks_base-0eac092766d7871b34927442ee0b6e27e7e1317b.tar.bz2 |
Merge "DO NOT MERGE. From main -- Start work on simulating landscape/portrait when orientation is locked." into honeycomb-mr2
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/view/Display.java | 23 | ||||
-rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 9 |
2 files changed, 29 insertions, 3 deletions
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 0ea461b..1d60066 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -200,8 +200,27 @@ public class Display { * @param outMetrics */ public void getMetrics(DisplayMetrics outMetrics) { - outMetrics.widthPixels = getWidth(); - outMetrics.heightPixels = getHeight(); + synchronized (mTmpPoint) { + getSize(mTmpPoint); + outMetrics.widthPixels = mTmpPoint.x; + outMetrics.heightPixels = mTmpPoint.y; + } + getNonSizeMetrics(outMetrics); + } + + /** + * Initialize a DisplayMetrics object from this display's data. + * + * @param outMetrics + * @hide + */ + public void getRealMetrics(DisplayMetrics outMetrics) { + outMetrics.widthPixels = getRealWidth(); + outMetrics.heightPixels = getRealHeight(); + getNonSizeMetrics(outMetrics); + } + + private void getNonSizeMetrics(DisplayMetrics outMetrics) { outMetrics.density = mDensity; outMetrics.densityDpi = (int)((mDensity*DisplayMetrics.DENSITY_DEFAULT)+.5f); outMetrics.scaledDensity= outMetrics.density; diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 03b3553..c7cf459 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -398,7 +398,7 @@ public interface WindowManagerPolicy { * display dimensions. */ public void setInitialDisplaySize(int width, int height); - + /** * Check permissions when adding a window. * @@ -826,6 +826,13 @@ public interface WindowManagerPolicy { boolean displayEnabled); /** + * Return the currently locked screen rotation, if any. Return + * Surface.ROTATION_0, Surface.ROTATION_90, Surface.ROTATION_180, or + * Surface.ROTATION_270 if locked; return -1 if not locked. + */ + public int getLockedRotationLw(); + + /** * Called when the system is mostly done booting to determine whether * the system should go into safe mode. */ |