summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-05-27 12:02:11 -0700
committerCraig Mautner <cmautner@google.com>2012-05-29 13:00:25 -0700
commit1d961d46d68eb3134e4bd6c3751f9730e9d32f17 (patch)
treecf7e519cb02ba8e05539f895e25d0be31665bf1b /services
parent6385ff511dd998f1fbb189621270e2c19577f66e (diff)
downloadframeworks_base-1d961d46d68eb3134e4bd6c3751f9730e9d32f17.zip
frameworks_base-1d961d46d68eb3134e4bd6c3751f9730e9d32f17.tar.gz
frameworks_base-1d961d46d68eb3134e4bd6c3751f9730e9d32f17.tar.bz2
Better handle changing app transitions.
When we are in the middle of an app transition and need to change to a new one we were not ending the old one in a clean state. Also, wallpapers were defaulting to the wrong animation in certain situations. Remove ':' style iterators. Fixes bug 6486708. Change-Id: Ied17e8410486020295db380ff68df5dad08bc5cc
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/AppWindowAnimator.java9
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java31
2 files changed, 29 insertions, 11 deletions
diff --git a/services/java/com/android/server/wm/AppWindowAnimator.java b/services/java/com/android/server/wm/AppWindowAnimator.java
index de756b1..1953ad7 100644
--- a/services/java/com/android/server/wm/AppWindowAnimator.java
+++ b/services/java/com/android/server/wm/AppWindowAnimator.java
@@ -79,12 +79,9 @@ public class AppWindowAnimator {
}
public void setDummyAnimation() {
- if (animation == null) {
- if (WindowManagerService.localLOGV) Slog.v(
- TAG, "Setting dummy animation in " + mAppToken);
- animation = sDummyAnimation;
- animInitialized = false;
- }
+ if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken);
+ animation = sDummyAnimation;
+ animInitialized = false;
hasTransformation = true;
transformation.clear();
transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0);
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index d9e0ec6..917cd66 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -1638,7 +1638,7 @@ public class WindowManagerService extends IWindowManager.Stub
// it is of no interest to us.
if (w.mAppToken.hidden && w.mAppToken.mAppAnimator.animation == null) {
if (DEBUG_WALLPAPER) Slog.v(TAG,
- "Skipping not hidden or animating token: " + w);
+ "Skipping hidden and not animating token: " + w);
continue;
}
}
@@ -3864,6 +3864,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_APP_TRANSITIONS) Slog.v(
TAG, "Prepare app transition: transit=" + transit
+ " mNextAppTransition=" + mNextAppTransition
+ + " alwaysKeepCurrent=" + alwaysKeepCurrent
+ " Callers=" + Debug.getCallers(3));
if (okToDisplay()) {
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
@@ -3933,6 +3934,15 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ private void cancelWindowAnimations(final AppWindowToken wtoken) {
+ for (int i = wtoken.windows.size() - 1; i >= 0; i--) {
+ final WindowStateAnimator winAnimator = wtoken.windows.get(i).mWinAnimator;
+ if (winAnimator.isAnimating()) {
+ winAnimator.clearAnimation();
+ }
+ }
+ }
+
public void executeAppTransition() {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"executeAppTransition()")) {
@@ -3948,6 +3958,12 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
mAppTransitionReady = true;
+ for (int i = mOpeningApps.size() - 1; i >= 0; i--) {
+ cancelWindowAnimations(mOpeningApps.get(i));
+ }
+ for (int i = mClosingApps.size() - 1; i >= 0; i--) {
+ cancelWindowAnimations(mClosingApps.get(i));
+ }
final long origId = Binder.clearCallingIdentity();
performLayoutAndPlaceSurfacesLocked();
Binder.restoreCallingIdentity(origId);
@@ -4295,6 +4311,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_APP_TRANSITIONS) Slog.v(
TAG, "Setting dummy animation on: " + wtoken);
+ cancelWindowAnimations(wtoken);
wtoken.mAppAnimator.setDummyAnimation();
mOpeningApps.remove(wtoken);
mClosingApps.remove(wtoken);
@@ -5321,7 +5338,8 @@ public class WindowManagerService extends IWindowManager.Stub
// the background..)
if (on) {
boolean isVisible = false;
- for (WindowState ws : mWindows) {
+ for (int i = mWindows.size() - 1; i >= 0; i--) {
+ final WindowState ws = mWindows.get(i);
if (ws.mSession.mPid == pid && ws.isVisibleLw()) {
isVisible = true;
break;
@@ -6439,7 +6457,10 @@ public class WindowManagerService extends IWindowManager.Stub
int keyboardPresence = 0;
int navigationPresence = 0;
- for (InputDevice device : mInputManager.getInputDevices()) {
+ final InputDevice[] devices = mInputManager.getInputDevices();
+ final int len = devices.length;
+ for (int i = 0; i < len; i++) {
+ InputDevice device = devices[i];
if (!device.isVirtual()) {
final int sources = device.getSources();
final int presenceFlag = device.isExternal() ?
@@ -7949,7 +7970,7 @@ public class WindowManagerService extends IWindowManager.Stub
for (i=0; i<NN && goodToGo; i++) {
AppWindowToken wtoken = mOpeningApps.get(i);
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
- "Check opening app" + wtoken + ": allDrawn="
+ "Check opening app=" + wtoken + ": allDrawn="
+ wtoken.allDrawn + " startingDisplayed="
+ wtoken.startingDisplayed + " startingMoved="
+ wtoken.startingMoved);
@@ -8059,7 +8080,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
"New transit: " + transit);
- } else if (oldWallpaper != null) {
+ } else if ((oldWallpaper != null) && (oldWallpaper != mWallpaperTarget)) {
// We are transitioning from an activity with
// a wallpaper to one without.
transit = WindowManagerPolicy.TRANSIT_WALLPAPER_CLOSE;