diff options
| author | 2011-09-14 19:26:23 -0700 | |
|---|---|---|
| committer | 2011-09-14 19:26:23 -0700 | |
| commit | d32b472edfda62c8c2713c4c72da4cdba32dd5ff (patch) | |
| tree | 29326d39fffa55f4af1ca56e9f1d54045f97daef | |
| parent | bd3f8a2e38ab46b33fa8afc6c4d8d613db9a6b2a (diff) | |
| parent | ec537457cd2869e52b9b2c99e8c01dd96a9682e2 (diff) | |
Merge "Fix issue #5155678: Portrait > Landscape full-screen transition..."
| -rw-r--r-- | core/java/android/view/Display.java | 28 | ||||
| -rw-r--r-- | core/jni/android_view_Display.cpp | 12 | ||||
| -rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 21 |
3 files changed, 30 insertions, 31 deletions
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 85e990aa3680..3bd0f76dfc3b 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -30,7 +30,7 @@ import android.util.Slog; */ public class Display { static final String TAG = "Display"; - static final boolean DEBUG_COMPAT = false; + static final boolean DEBUG_DISPLAY_SIZE = false; /** * The default Display id. @@ -117,7 +117,8 @@ public class Display { outSize.x = getRawWidth(); outSize.y = getRawHeight(); } - if (DEBUG_COMPAT && doCompat) Slog.v(TAG, "Returning display size: " + outSize); + if (DEBUG_DISPLAY_SIZE && doCompat) Slog.v( + TAG, "Returning display size: " + outSize); } catch (RemoteException e) { Slog.w("Display", "Unable to get display size", e); } @@ -203,6 +204,8 @@ public class Display { outSize.x = getRawWidth(); outSize.y = getRawHeight(); } + if (DEBUG_DISPLAY_SIZE) Slog.v( + TAG, "Returning real display size: " + outSize); } catch (RemoteException e) { Slog.w("Display", "Unable to get real display size", e); } @@ -215,7 +218,13 @@ public class Display { * </p> * @hide */ - native public int getRawWidth(); + public int getRawWidth() { + int w = getRawWidthNative(); + if (DEBUG_DISPLAY_SIZE) Slog.v( + TAG, "Returning raw display width: " + w); + return w; + } + private native int getRawWidthNative(); /** * Gets the raw height of the display, in pixels. @@ -224,7 +233,13 @@ public class Display { * </p> * @hide */ - native public int getRawHeight(); + public int getRawHeight() { + int h = getRawHeightNative(); + if (DEBUG_DISPLAY_SIZE) Slog.v( + TAG, "Returning raw display height: " + h); + return h; + } + private native int getRawHeightNative(); /** * Returns the rotation of the screen from its "natural" orientation. @@ -293,8 +308,9 @@ public class Display { ci.applyToDisplayMetrics(outMetrics); } - if (DEBUG_COMPAT) Slog.v(TAG, "Returning DisplayMetrics: " + outMetrics.widthPixels - + "x" + outMetrics.heightPixels + " " + outMetrics.density); + if (DEBUG_DISPLAY_SIZE) Slog.v(TAG, "Returning DisplayMetrics: " + + outMetrics.widthPixels + "x" + outMetrics.heightPixels + + " " + outMetrics.density); } /** diff --git a/core/jni/android_view_Display.cpp b/core/jni/android_view_Display.cpp index 5e668b97f53c..366a52e1ba47 100644 --- a/core/jni/android_view_Display.cpp +++ b/core/jni/android_view_Display.cpp @@ -63,14 +63,14 @@ static void android_view_Display_init( env->SetFloatField(clazz, offsets.ydpi, info.ydpi); } -static jint android_view_Display_getRawWidth( +static jint android_view_Display_getRawWidthNative( JNIEnv* env, jobject clazz) { DisplayID dpy = env->GetIntField(clazz, offsets.display); return SurfaceComposerClient::getDisplayWidth(dpy); } -static jint android_view_Display_getRawHeight( +static jint android_view_Display_getRawHeightNative( JNIEnv* env, jobject clazz) { DisplayID dpy = env->GetIntField(clazz, offsets.display); @@ -103,10 +103,10 @@ static JNINativeMethod gMethods[] = { (void*)android_view_Display_getDisplayCount }, { "init", "(I)V", (void*)android_view_Display_init }, - { "getRawWidth", "()I", - (void*)android_view_Display_getRawWidth }, - { "getRawHeight", "()I", - (void*)android_view_Display_getRawHeight }, + { "getRawWidthNative", "()I", + (void*)android_view_Display_getRawWidthNative }, + { "getRawHeightNative", "()I", + (void*)android_view_Display_getRawHeightNative }, { "getOrientation", "()I", (void*)android_view_Display_getOrientation } }; diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 29a9ad4c8482..10447ad490f5 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1724,6 +1724,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { displayWidth, displayHeight); if (mNavigationBar.isVisibleLw()) { mDockBottom = mTmpNavigationFrame.top; + mRestrictedScreenHeight = mDockBottom - mDockTop; } } else { // Landscape screen; nav bar goes to the right. @@ -1731,6 +1732,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { displayWidth, displayHeight); if (mNavigationBar.isVisibleLw()) { mDockRight = mTmpNavigationFrame.left; + mRestrictedScreenWidth = mDockRight - mDockLeft; } } mNavigationBar.computeFrameLw(mTmpNavigationFrame, mTmpNavigationFrame, @@ -1748,25 +1750,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { mStatusBar.computeFrameLw(pf, df, vf, vf); - // now, let's consider the navigation bar; if it exists, it must be removed from the - // available screen real estate (like an un-hideable status bar) - if (navr != null) { - if (navr.top == 0) { - // Navigation bar is vertical - if (mRestrictedScreenLeft == navr.left) { - mRestrictedScreenLeft = navr.right; - mRestrictedScreenWidth -= (navr.right - navr.left); - } else if ((mRestrictedScreenLeft+mRestrictedScreenWidth) == navr.right) { - mRestrictedScreenWidth -= (navr.right - navr.left); - } - } else { - // Navigation bar horizontal, at bottom - if ((mRestrictedScreenHeight+mRestrictedScreenTop) == navr.bottom) { - mRestrictedScreenHeight -= (navr.bottom-navr.top); - } - } - } - if (mStatusBar.isVisibleLw()) { // If the status bar is hidden, we don't want to cause // windows behind it to scroll. |