summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-03-10 16:01:58 -0800
committerDianne Hackborn <hackbod@google.com>2010-03-10 16:01:58 -0800
commit67accfd37face47d46d770aa3b7b6458b1e44a74 (patch)
tree6ac17a8984b141dac2fd4a38c461ec33c82ea0aa
parent537d6a16a3ebd1402662be761aa6270d6aacd750 (diff)
downloadbase-67accfd37face47d46d770aa3b7b6458b1e44a74.tar.gz
Update for new layout flow.
Now does lock screen and status bar management in the animation pass, to better match actual changes on screen. Change-Id: I9a68fcfa1968dfa71961bc164a6fda15b2cd7d47
-rw-r--r--mid/com/android/internal/policy/impl/MidWindowManager.java4
-rwxr-xr-xphone/com/android/internal/policy/impl/PhoneWindowManager.java111
2 files changed, 58 insertions, 57 deletions
diff --git a/mid/com/android/internal/policy/impl/MidWindowManager.java b/mid/com/android/internal/policy/impl/MidWindowManager.java
index 16f4cad..64895b5 100644
--- a/mid/com/android/internal/policy/impl/MidWindowManager.java
+++ b/mid/com/android/internal/policy/impl/MidWindowManager.java
@@ -797,7 +797,7 @@ public class MidWindowManager implements WindowManagerPolicy {
}
/** {@inheritDoc} */
- public boolean finishAnimationLw() {
+ public int finishAnimationLw() {
if (mStatusBar != null) {
if (mForceStatusBar) {
mStatusBar.showLw(true);
@@ -813,7 +813,7 @@ public class MidWindowManager implements WindowManagerPolicy {
}
}
}
- return false;
+ return 0;
}
public boolean allowAppAnimationsLw() {
diff --git a/phone/com/android/internal/policy/impl/PhoneWindowManager.java b/phone/com/android/internal/policy/impl/PhoneWindowManager.java
index 95fac9e..0699701 100755
--- a/phone/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/phone/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1233,12 +1233,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mDockBottom = mContentBottom = mCurBottom = displayHeight;
mDockLayer = 0x10000000;
- mTopFullscreenOpaqueWindowState = null;
- mForceStatusBar = false;
- mHideLockScreen = false;
- mAllowLockscreenWhenOn = false;
- mDismissKeyguard = false;
-
// decide where the status bar goes ahead of time
if (mStatusBar != null) {
final Rect pf = mTmpParentFrame;
@@ -1435,30 +1429,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
win.computeFrameLw(pf, df, cf, vf);
- if (mTopFullscreenOpaqueWindowState == null &&
- win.isVisibleOrBehindKeyguardLw()) {
- if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
- mForceStatusBar = true;
- }
- if (attrs.type >= FIRST_APPLICATION_WINDOW
- && attrs.type <= LAST_APPLICATION_WINDOW
- && win.fillsScreenLw(mW, mH, false, false)) {
- if (DEBUG_LAYOUT) Log.v(TAG, "Fullscreen window: " + win);
- mTopFullscreenOpaqueWindowState = win;
- if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
- if (localLOGV) Log.v(TAG, "Setting mHideLockScreen to true by win " + win);
- mHideLockScreen = true;
- }
- }
- if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) {
- if (localLOGV) Log.v(TAG, "Setting mDismissKeyguard to true by win " + win);
- mDismissKeyguard = true;
- }
- if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
- mAllowLockscreenWhenOn = true;
- }
- }
-
// Dock windows carve out the bottom of the screen, so normal windows
// can't appear underneath them.
if (attrs.type == TYPE_INPUT_METHOD && !win.getGivenInsetsPendingLw()) {
@@ -1480,7 +1450,51 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
public int finishLayoutLw() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public void beginAnimationLw(int displayWidth, int displayHeight) {
+ mTopFullscreenOpaqueWindowState = null;
+ mForceStatusBar = false;
+
+ mHideLockScreen = false;
+ mAllowLockscreenWhenOn = false;
+ mDismissKeyguard = false;
+ }
+
+ /** {@inheritDoc} */
+ public void animatingWindowLw(WindowState win,
+ WindowManager.LayoutParams attrs) {
+ if (mTopFullscreenOpaqueWindowState == null &&
+ win.isVisibleOrBehindKeyguardLw()) {
+ if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
+ mForceStatusBar = true;
+ }
+ if (attrs.type >= FIRST_APPLICATION_WINDOW
+ && attrs.type <= LAST_APPLICATION_WINDOW
+ && win.fillsScreenLw(mW, mH, false, false)) {
+ if (DEBUG_LAYOUT) Log.v(TAG, "Fullscreen window: " + win);
+ mTopFullscreenOpaqueWindowState = win;
+ if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
+ if (localLOGV) Log.v(TAG, "Setting mHideLockScreen to true by win " + win);
+ mHideLockScreen = true;
+ }
+ if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) {
+ if (localLOGV) Log.v(TAG, "Setting mDismissKeyguard to true by win " + win);
+ mDismissKeyguard = true;
+ }
+ if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
+ mAllowLockscreenWhenOn = true;
+ }
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ public int finishAnimationLw() {
int changes = 0;
+
boolean hiding = false;
if (mStatusBar != null) {
if (localLOGV) Log.i(TAG, "force=" + mForceStatusBar
@@ -1506,6 +1520,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
}
+
+ if (changes != 0 && hiding) {
+ IStatusBar sbs = IStatusBar.Stub.asInterface(ServiceManager.getService("statusbar"));
+ if (sbs != null) {
+ try {
+ // Make sure the window shade is hidden.
+ sbs.deactivate();
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
// Hide the key guard if a visible window explicitly specifies that it wants to be displayed
// when the screen is locked
if (mKeyguard != null) {
@@ -1540,36 +1566,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
- if (changes != 0 && hiding) {
- IStatusBar sbs = IStatusBar.Stub.asInterface(ServiceManager.getService("statusbar"));
- if (sbs != null) {
- try {
- // Make sure the window shade is hidden.
- sbs.deactivate();
- } catch (RemoteException e) {
- }
- }
- }
-
// update since mAllowLockscreenWhenOn might have changed
updateLockScreenTimeout();
return changes;
}
- /** {@inheritDoc} */
- public void beginAnimationLw(int displayWidth, int displayHeight) {
- }
-
- /** {@inheritDoc} */
- public void animatingWindowLw(WindowState win,
- WindowManager.LayoutParams attrs) {
- }
-
- /** {@inheritDoc} */
- public boolean finishAnimationLw() {
- return false;
- }
-
public boolean allowAppAnimationsLw() {
if (mKeyguard != null && mKeyguard.isVisibleLw()) {
// If keyguard is currently visible, no reason to animate