AI 143173: am: CL 142879 Fix issue #1732012 (Only show screen rotation animation when triggered by sensor) -- set the new surface flag as appropriate.

Original author: hackbod
  Merged from: //branches/cupcake/...

Automated import of CL 143173
This commit is contained in:
Dianne Hackborn
2009-03-27 16:16:03 -07:00
committed by The Android Open Source Project
parent 03759ed36d
commit 32bc91d6f6

View File

@@ -236,7 +236,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
@Override public void onChange(boolean selfChange) {
update();
try {
mWindowManager.setRotation(USE_LAST_ROTATION, false, 1);
mWindowManager.setRotation(USE_LAST_ROTATION, false,
mFancyRotationAnimation);
} catch (RemoteException e) {
// Ignore
}
@@ -248,7 +249,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mEndcallBehavior = Settings.System.getInt(resolver,
Settings.System.END_BUTTON_BEHAVIOR, DEFAULT_ENDCALL_BEHAVIOR);
mFancyRotationAnimation = Settings.System.getInt(resolver,
"fancy_rotation_animation", 0);
"fancy_rotation_anim", 0) != 0 ? 0x80 : 0;
int accelerometerDefault = Settings.System.getInt(resolver,
Settings.System.ACCELEROMETER_ROTATION, DEFAULT_ACCELEROMETER_ROTATION);
if (mAccelerometerDefault != accelerometerDefault) {
@@ -260,7 +261,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean hasSoftInput = imId != null && imId.length() > 0;
if (mHasSoftInput != hasSoftInput) {
mHasSoftInput = hasSoftInput;
updateRotation(1);
updateRotation(0);
}
}
}
@@ -276,7 +277,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Send updates based on orientation value
if (true) Log.i(TAG, "onOrientationChanged, rotation changed to " +rotation);
try {
mWindowManager.setRotation(rotation, false, 1);
mWindowManager.setRotation(rotation, false,
mFancyRotationAnimation);
} catch (RemoteException e) {
// Ignore
}
@@ -1266,7 +1268,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (event.keycode == 0) {
// lid changed state
mLidOpen = event.value == 0;
updateRotation(0);
updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
if (keyguardIsShowingTq()) {
if (mLidOpen) {
// only do this if it's opening -- closing the device shouldn't turn it
@@ -1742,7 +1744,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
public void enableScreenAfterBoot() {
readLidState();
updateRotation(0);
updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
}
void updateRotation(int animFlags) {
@@ -1755,7 +1757,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
//if lid is closed orientation will be portrait
try {
//set orientation on WindowManager
mWindowManager.setRotation(rotation, true, animFlags);
mWindowManager.setRotation(rotation, true,
mFancyRotationAnimation | animFlags);
} catch (RemoteException e) {
// Ignore
}