diff options
5 files changed, 48 insertions, 46 deletions
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 4ac72fd..0de08f2 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -303,9 +303,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration public String toString() { StringBuilder sb = new StringBuilder(128); - sb.append("{ fnt="); + sb.append("{"); sb.append(fontScale); - sb.append(" imsi="); + sb.append("x imsi="); sb.append(mcc); sb.append("/"); sb.append(mnc); diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 2058991..03b3553 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -394,6 +394,12 @@ public interface WindowManagerPolicy { LocalPowerManager powerManager); /** + * Called by window manager once it has the initial, default native + * display dimensions. + */ + public void setInitialDisplaySize(int width, int height); + + /** * Check permissions when adding a window. * * @param attrs The window's LayoutParams. diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 29c5741..bf602c6 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -55,11 +55,9 @@ import com.android.internal.telephony.ITelephony; import com.android.internal.view.BaseInputHandler; import com.android.internal.widget.PointerLocationView; -import android.util.Config; import android.util.EventLog; import android.util.Log; import android.util.Slog; -import android.view.Display; import android.view.Gravity; import android.view.HapticFeedbackConstants; import android.view.IWindowManager; @@ -138,7 +136,7 @@ import java.util.ArrayList; public class PhoneWindowManager implements WindowManagerPolicy { static final String TAG = "WindowManager"; static final boolean DEBUG = false; - static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV; + static final boolean localLOGV = false; static final boolean DEBUG_LAYOUT = false; static final boolean DEBUG_FALLBACK = false; static final boolean SHOW_STARTING_ANIMATIONS = true; @@ -348,10 +346,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { // (See Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR.) int mIncallPowerBehavior; - int mLandscapeRotation = -1; // default landscape rotation - int mSeascapeRotation = -1; // "other" landscape rotation, 180 degrees from mLandscapeRotation - int mPortraitRotation = -1; // default portrait rotation - int mUpsideDownRotation = -1; // "other" portrait rotation + int mLandscapeRotation = 0; // default landscape rotation + int mSeascapeRotation = 0; // "other" landscape rotation, 180 degrees from mLandscapeRotation + int mPortraitRotation = 0; // default portrait rotation + int mUpsideDownRotation = 0; // "other" portrait rotation // Nothing to see here, move along... int mFancyRotationAnimation; @@ -733,6 +731,32 @@ public class PhoneWindowManager implements WindowManagerPolicy { // config_statusBarCanHide because the latter depends on the screen size } + public void setInitialDisplaySize(int width, int height) { + if (width > height) { + mLandscapeRotation = Surface.ROTATION_0; + mSeascapeRotation = Surface.ROTATION_180; + if (mContext.getResources().getBoolean( + com.android.internal.R.bool.config_reverseDefaultRotation)) { + mPortraitRotation = Surface.ROTATION_90; + mUpsideDownRotation = Surface.ROTATION_270; + } else { + mPortraitRotation = Surface.ROTATION_270; + mUpsideDownRotation = Surface.ROTATION_90; + } + } else { + mPortraitRotation = Surface.ROTATION_0; + mUpsideDownRotation = Surface.ROTATION_180; + if (mContext.getResources().getBoolean( + com.android.internal.R.bool.config_reverseDefaultRotation)) { + mLandscapeRotation = Surface.ROTATION_270; + mSeascapeRotation = Surface.ROTATION_90; + } else { + mLandscapeRotation = Surface.ROTATION_90; + mSeascapeRotation = Surface.ROTATION_270; + } + } + } + public void updateSettings() { ContentResolver resolver = mContext.getContentResolver(); boolean updateRotation = false; @@ -2506,7 +2530,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } } - + public int rotationForOrientationLw(int orientation, int lastRotation, boolean displayEnabled) { @@ -2519,35 +2543,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { ); } - if (mPortraitRotation < 0) { - // Initialize the rotation angles for each orientation once. - Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) - .getDefaultDisplay(); - if (d.getWidth() > d.getHeight()) { - mLandscapeRotation = Surface.ROTATION_0; - mSeascapeRotation = Surface.ROTATION_180; - if (mContext.getResources().getBoolean( - com.android.internal.R.bool.config_reverseDefaultRotation)) { - mPortraitRotation = Surface.ROTATION_90; - mUpsideDownRotation = Surface.ROTATION_270; - } else { - mPortraitRotation = Surface.ROTATION_270; - mUpsideDownRotation = Surface.ROTATION_90; - } - } else { - mPortraitRotation = Surface.ROTATION_0; - mUpsideDownRotation = Surface.ROTATION_180; - if (mContext.getResources().getBoolean( - com.android.internal.R.bool.config_reverseDefaultRotation)) { - mLandscapeRotation = Surface.ROTATION_270; - mSeascapeRotation = Surface.ROTATION_90; - } else { - mLandscapeRotation = Surface.ROTATION_90; - mSeascapeRotation = Surface.ROTATION_270; - } - } - } - synchronized (mLock) { switch (orientation) { case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT: diff --git a/services/java/com/android/server/wm/DimSurface.java b/services/java/com/android/server/wm/DimSurface.java index 084ac6f..220c7fb 100644 --- a/services/java/com/android/server/wm/DimSurface.java +++ b/services/java/com/android/server/wm/DimSurface.java @@ -89,7 +89,7 @@ class DimSurface { public void printTo(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("mDimSurface="); pw.println(mDimSurface); pw.print(prefix); pw.print("mDimShown="); pw.print(mDimShown); - pw.print(" mLayer="); pw.println(mLayer); + pw.print(" mLayer="); pw.print(mLayer); pw.print(" mDimColor=0x"); pw.println(Integer.toHexString(mDimColor)); pw.print(prefix); pw.print("mLastDimWidth="); pw.print(mLastDimWidth); pw.print(" mLastDimWidth="); pw.println(mLastDimWidth); diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 980696d..4b9ce90 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -5854,6 +5854,7 @@ public class WindowManagerService extends IWindowManager.Stub mInitialDisplayWidth = mCurDisplayWidth = mDisplay.getRealWidth(); mInitialDisplayHeight = mCurDisplayHeight = mDisplay.getRealHeight(); mInputManager.setDisplaySize(0, mDisplay.getRawWidth(), mDisplay.getRawHeight()); + mPolicy.setInitialDisplaySize(mInitialDisplayWidth, mInitialDisplayHeight); } try { @@ -8730,21 +8731,21 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(", mForcedAppOrientation="); pw.print(mForcedAppOrientation); pw.print(", mRequestedRotation="); pw.println(mRequestedRotation); pw.print(" mDeferredRotation="); pw.print(mDeferredRotation); - pw.print(", mDeferredRotationAnimFlags="); pw.print(mDeferredRotationAnimFlags); + pw.print(", mDeferredRotationAnimFlags="); pw.println(mDeferredRotationAnimFlags); pw.print(" mAnimationPending="); pw.print(mAnimationPending); pw.print(" mWindowAnimationScale="); pw.print(mWindowAnimationScale); pw.print(" mTransitionWindowAnimationScale="); pw.println(mTransitionAnimationScale); pw.print(" mNextAppTransition=0x"); pw.print(Integer.toHexString(mNextAppTransition)); - pw.print(", mAppTransitionReady="); pw.print(mAppTransitionReady); - pw.print(", mAppTransitionRunning="); pw.print(mAppTransitionRunning); - pw.print(", mAppTransitionTimeout="); pw.println( mAppTransitionTimeout); + pw.print(" mAppTransitionReady="); pw.println(mAppTransitionReady); + pw.print(" mAppTransitionRunning="); pw.print(mAppTransitionRunning); + pw.print(" mAppTransitionTimeout="); pw.println( mAppTransitionTimeout); if (mNextAppTransitionPackage != null) { pw.print(" mNextAppTransitionPackage="); pw.print(mNextAppTransitionPackage); - pw.print(", mNextAppTransitionEnter=0x"); + pw.print(" mNextAppTransitionEnter=0x"); pw.print(Integer.toHexString(mNextAppTransitionEnter)); - pw.print(", mNextAppTransitionExit=0x"); + pw.print(" mNextAppTransitionExit=0x"); pw.print(Integer.toHexString(mNextAppTransitionExit)); } pw.print(" mStartingIconInTransition="); pw.print(mStartingIconInTransition); |