Skip to content

Commit 6704a48

Browse files
Craig MautnerAndroid (Google) Code Review
authored andcommitted
Merge "Fixes to Starting window and Wallpaper windows." into jb-mr1-dev
2 parents 52716de + 8863cca commit 6704a48

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,8 @@ int adjustWallpaperWindowsLocked() {
16431643
}
16441644
}
16451645

1646-
if (mWallpaperTarget != foundW) {
1646+
if (mWallpaperTarget != foundW
1647+
&& (mLowerWallpaperTarget == null || mLowerWallpaperTarget != foundW)) {
16471648
if (DEBUG_WALLPAPER) {
16481649
Slog.v(TAG, "New wallpaper target: " + foundW
16491650
+ " oldTarget: " + mWallpaperTarget);
@@ -3386,7 +3387,7 @@ private Animation createThumbnailAnimationLocked(int transit,
33863387
// Exiting app
33873388
if (scaleUp) {
33883389
// noop animation
3389-
a = new AlphaAnimation(1, 1);
3390+
a = new AlphaAnimation(1, 0);
33903391
a.setDuration(duration);
33913392
} else {
33923393
float scaleW = thumbWidth / displayInfo.appWidth;
@@ -3435,15 +3436,15 @@ private boolean applyAnimationLocked(AppWindowToken atoken,
34353436
"applyAnimation: atoken=" + atoken
34363437
+ " anim=" + a + " nextAppTransition=ANIM_CUSTOM"
34373438
+ " transit=" + transit + " isEntrance=" + enter
3438-
+ " Callers " + Debug.getCallers(3));
3439+
+ " Callers=" + Debug.getCallers(3));
34393440
} else if (mNextAppTransitionType == ActivityOptions.ANIM_SCALE_UP) {
34403441
a = createScaleUpAnimationLocked(transit, enter);
34413442
initialized = true;
34423443
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
34433444
"applyAnimation: atoken=" + atoken
34443445
+ " anim=" + a + " nextAppTransition=ANIM_SCALE_UP"
34453446
+ " transit=" + transit + " isEntrance=" + enter
3446-
+ " Callers " + Debug.getCallers(3));
3447+
+ " Callers=" + Debug.getCallers(3));
34473448
} else if (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_UP ||
34483449
mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN) {
34493450
boolean scaleUp = (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_UP);
@@ -3454,7 +3455,7 @@ private boolean applyAnimationLocked(AppWindowToken atoken,
34543455
Slog.v(TAG, "applyAnimation: atoken=" + atoken
34553456
+ " anim=" + a + " nextAppTransition=" + animName
34563457
+ " transit=" + transit + " isEntrance=" + enter
3457-
+ " Callers " + Debug.getCallers(3));
3458+
+ " Callers=" + Debug.getCallers(3));
34583459
}
34593460
} else {
34603461
int animAttr = 0;
@@ -3516,7 +3517,7 @@ private boolean applyAnimationLocked(AppWindowToken atoken,
35163517
+ " anim=" + a
35173518
+ " animAttr=0x" + Integer.toHexString(animAttr)
35183519
+ " transit=" + transit + " isEntrance=" + enter
3519-
+ " Callers " + Debug.getCallers(3));
3520+
+ " Callers=" + Debug.getCallers(3));
35203521
}
35213522
if (a != null) {
35223523
if (DEBUG_ANIM) {
@@ -4188,7 +4189,7 @@ public void setAppStartingWindow(IBinder token, String pkg,
41884189

41894190
synchronized(mWindowMap) {
41904191
if (DEBUG_STARTING_WINDOW) Slog.v(
4191-
TAG, "setAppStartingIcon: token=" + token + " pkg=" + pkg
4192+
TAG, "setAppStartingWindow: token=" + token + " pkg=" + pkg
41924193
+ " transferFrom=" + transferFrom);
41934194

41944195
AppWindowToken wtoken = findAppWindowToken(token);
@@ -4220,7 +4221,7 @@ public void setAppStartingWindow(IBinder token, String pkg,
42204221
mSkipAppTransitionAnimation = true;
42214222
}
42224223
if (DEBUG_STARTING_WINDOW) Slog.v(TAG,
4223-
"Moving existing starting from " + ttoken
4224+
"Moving existing starting " + startingWindow + " from " + ttoken
42244225
+ " to " + wtoken);
42254226
final long origId = Binder.clearCallingIdentity();
42264227

@@ -4229,6 +4230,7 @@ public void setAppStartingWindow(IBinder token, String pkg,
42294230
wtoken.startingData = ttoken.startingData;
42304231
wtoken.startingView = ttoken.startingView;
42314232
wtoken.startingDisplayed = ttoken.startingDisplayed;
4233+
ttoken.startingDisplayed = false;
42324234
wtoken.startingWindow = startingWindow;
42334235
wtoken.reportedVisible = ttoken.reportedVisible;
42344236
ttoken.startingData = null;
@@ -4238,6 +4240,8 @@ public void setAppStartingWindow(IBinder token, String pkg,
42384240
startingWindow.mToken = wtoken;
42394241
startingWindow.mRootToken = wtoken;
42404242
startingWindow.mAppToken = wtoken;
4243+
startingWindow.mWinAnimator.mAppAnimator = wtoken.mAppAnimator;
4244+
42414245
if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) {
42424246
Slog.v(TAG, "Removing starting window: " + startingWindow);
42434247
}
@@ -4545,9 +4549,9 @@ public void setAppVisibility(IBinder token, boolean visible) {
45454549
}
45464550
wtoken.hiddenRequested = !visible;
45474551

4548-
if (DEBUG_APP_TRANSITIONS) Slog.v(
4549-
TAG, "Setting dummy animation on: " + wtoken);
45504552
if (!wtoken.startingDisplayed) {
4553+
if (DEBUG_APP_TRANSITIONS) Slog.v(
4554+
TAG, "Setting dummy animation on: " + wtoken);
45514555
wtoken.mAppAnimator.setDummyAnimation();
45524556
}
45534557
mOpeningApps.remove(wtoken);
@@ -8149,7 +8153,11 @@ private final void assignLayersLocked(WindowList windows) {
81498153
updateLayoutToAnimationLocked();
81508154
}
81518155
if (DEBUG_LAYERS) Slog.v(TAG, "Assign layer " + w + ": "
8152-
+ winAnimator.mAnimLayer);
8156+
+ "mBase=" + w.mBaseLayer
8157+
+ " mLayer=" + w.mLayer
8158+
+ (w.mAppToken == null ?
8159+
"" : " mAppLayer=" + w.mAppToken.mAppAnimator.animLayerAdjustment)
8160+
+ " =mAnimLayer=" + winAnimator.mAnimLayer);
81538161
//System.out.println(
81548162
// "Assigned layer " + curLayer + " to " + w.mClient.asBinder());
81558163
}
@@ -8541,7 +8549,7 @@ public int handleAppTransitionReadyLocked(WindowList windows) {
85418549
transit = WindowManagerPolicy.TRANSIT_WALLPAPER_CLOSE;
85428550
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
85438551
"New transit away from wallpaper: " + transit);
8544-
} else if (mWallpaperTarget != null) {
8552+
} else if (mWallpaperTarget != null && mWallpaperTarget.isVisibleLw()) {
85458553
// We are transitioning from an activity without
85468554
// a wallpaper to now showing the wallpaper
85478555
transit = WindowManagerPolicy.TRANSIT_WALLPAPER_OPEN;
@@ -8598,7 +8606,7 @@ public int handleAppTransitionReadyLocked(WindowList windows) {
85988606
for (i=0; i<NN; i++) {
85998607
AppWindowToken wtoken = mClosingApps.get(i);
86008608
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
8601-
"Now closing app" + wtoken);
8609+
"Now closing app " + wtoken);
86028610
wtoken.mAppAnimator.clearThumbnail();
86038611
wtoken.inPendingTransaction = false;
86048612
wtoken.mAppAnimator.animation = null;

services/java/com/android/server/wm/WindowStateAnimator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class WindowStateAnimator {
6262
final WindowState mWin;
6363
final WindowStateAnimator mAttachedWinAnimator;
6464
final WindowAnimator mAnimator;
65-
final AppWindowAnimator mAppAnimator;
65+
AppWindowAnimator mAppAnimator;
6666
final Session mSession;
6767
final WindowManagerPolicy mPolicy;
6868
final Context mContext;
@@ -1520,7 +1520,7 @@ boolean applyAnimationLocked(int transit, boolean isEntrance) {
15201520
"applyAnimation: win=" + this
15211521
+ " anim=" + anim + " attr=0x" + Integer.toHexString(attr)
15221522
+ " a=" + a
1523-
+ " mAnimation=" + mAnimation
1523+
+ " transit=" + transit
15241524
+ " isEntrance=" + isEntrance + " Callers " + Debug.getCallers(3));
15251525
if (a != null) {
15261526
if (WindowManagerService.DEBUG_ANIM) {

0 commit comments

Comments
 (0)