am 44251a70
: Merge "Work on issue #7343200: Fails to show wallpaper in the background..." into jb-mr1-dev
* commit '44251a70edba3e950aab1f706e1ff34e2fa4dfae': Work on issue #7343200: Fails to show wallpaper in the background...
This commit is contained in:
@ -1362,6 +1362,23 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Like {@link #getCallers(int)}, but each location is append to the string
|
||||||
|
* as a new line with <var>linePrefix</var> in front of it.
|
||||||
|
* @param depth the number of levels to return, starting with the immediate caller.
|
||||||
|
* @param linePrefix prefix to put in front of each location.
|
||||||
|
* @return a string describing the call stack.
|
||||||
|
* {@hide}
|
||||||
|
*/
|
||||||
|
public static String getCallers(final int depth, String linePrefix) {
|
||||||
|
final StackTraceElement[] callStack = Thread.currentThread().getStackTrace();
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < depth; i++) {
|
||||||
|
sb.append(linePrefix).append(getCaller(callStack, i)).append("\n");
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a String describing the immediate caller of the calling function.
|
* @return a String describing the immediate caller of the calling function.
|
||||||
* {@hide}
|
* {@hide}
|
||||||
|
@ -264,6 +264,8 @@ public class WindowAnimator {
|
|||||||
WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER);
|
WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (WindowManagerService.DEBUG_WALLPAPER_LIGHT && !token.hidden) Slog.d(TAG,
|
||||||
|
"Hiding wallpaper " + token + " from " + w);
|
||||||
token.hidden = true;
|
token.hidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
static final boolean DEBUG_STARTING_WINDOW = false;
|
static final boolean DEBUG_STARTING_WINDOW = false;
|
||||||
static final boolean DEBUG_REORDER = false;
|
static final boolean DEBUG_REORDER = false;
|
||||||
static final boolean DEBUG_WALLPAPER = false;
|
static final boolean DEBUG_WALLPAPER = false;
|
||||||
|
static final boolean DEBUG_WALLPAPER_LIGHT = true || DEBUG_WALLPAPER;
|
||||||
static final boolean DEBUG_DRAG = false;
|
static final boolean DEBUG_DRAG = false;
|
||||||
static final boolean DEBUG_SCREEN_ON = false;
|
static final boolean DEBUG_SCREEN_ON = false;
|
||||||
static final boolean DEBUG_SCREENSHOT = false;
|
static final boolean DEBUG_SCREENSHOT = false;
|
||||||
@ -1625,7 +1626,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (foundW == null && windowDetachedI >= 0) {
|
if (foundW == null && windowDetachedI >= 0) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Found animating detached wallpaper activity: #" + i + "=" + w);
|
"Found animating detached wallpaper activity: #" + i + "=" + w);
|
||||||
foundW = w;
|
foundW = w;
|
||||||
foundI = windowDetachedI;
|
foundI = windowDetachedI;
|
||||||
@ -1641,12 +1642,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// enough (we'll just wait until whatever transition is pending
|
// enough (we'll just wait until whatever transition is pending
|
||||||
// executes).
|
// executes).
|
||||||
if (mWallpaperTarget != null && mWallpaperTarget.mAppToken != null) {
|
if (mWallpaperTarget != null && mWallpaperTarget.mAppToken != null) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Wallpaper not changing: waiting for app anim in current target");
|
"Wallpaper not changing: waiting for app anim in current target");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (foundW != null && foundW.mAppToken != null) {
|
if (foundW != null && foundW.mAppToken != null) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Wallpaper not changing: waiting for app anim in found target");
|
"Wallpaper not changing: waiting for app anim in found target");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1654,7 +1655,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
if (mWallpaperTarget != foundW
|
if (mWallpaperTarget != foundW
|
||||||
&& (mLowerWallpaperTarget == null || mLowerWallpaperTarget != foundW)) {
|
&& (mLowerWallpaperTarget == null || mLowerWallpaperTarget != foundW)) {
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "New wallpaper target: " + foundW
|
Slog.v(TAG, "New wallpaper target: " + foundW
|
||||||
+ " oldTarget: " + mWallpaperTarget);
|
+ " oldTarget: " + mWallpaperTarget);
|
||||||
}
|
}
|
||||||
@ -1674,17 +1675,17 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
boolean foundAnim = foundW.mWinAnimator.mAnimation != null
|
boolean foundAnim = foundW.mWinAnimator.mAnimation != null
|
||||||
|| (foundW.mAppToken != null &&
|
|| (foundW.mAppToken != null &&
|
||||||
foundW.mAppToken.mAppAnimator.animation != null);
|
foundW.mAppToken.mAppAnimator.animation != null);
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "New animation: " + foundAnim
|
Slog.v(TAG, "New animation: " + foundAnim
|
||||||
+ " old animation: " + oldAnim);
|
+ " old animation: " + oldAnim);
|
||||||
}
|
}
|
||||||
if (foundAnim && oldAnim) {
|
if (foundAnim && oldAnim) {
|
||||||
int oldI = windows.indexOf(oldW);
|
int oldI = windows.indexOf(oldW);
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "New i: " + foundI + " old i: " + oldI);
|
Slog.v(TAG, "New i: " + foundI + " old i: " + oldI);
|
||||||
}
|
}
|
||||||
if (oldI >= 0) {
|
if (oldI >= 0) {
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "Animating wallpapers: old#" + oldI
|
Slog.v(TAG, "Animating wallpapers: old#" + oldI
|
||||||
+ "=" + oldW + "; new#" + foundI
|
+ "=" + oldW + "; new#" + foundI
|
||||||
+ "=" + foundW);
|
+ "=" + foundW);
|
||||||
@ -1692,7 +1693,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
// Set the new target correctly.
|
// Set the new target correctly.
|
||||||
if (foundW.mAppToken != null && foundW.mAppToken.hiddenRequested) {
|
if (foundW.mAppToken != null && foundW.mAppToken.hiddenRequested) {
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "Old wallpaper still the target.");
|
Slog.v(TAG, "Old wallpaper still the target.");
|
||||||
}
|
}
|
||||||
mWallpaperTarget = oldW;
|
mWallpaperTarget = oldW;
|
||||||
@ -1704,7 +1705,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// the wallpaper below the lower.
|
// the wallpaper below the lower.
|
||||||
else if (foundI > oldI) {
|
else if (foundI > oldI) {
|
||||||
// The new target is on top of the old one.
|
// The new target is on top of the old one.
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "Found target above old target.");
|
Slog.v(TAG, "Found target above old target.");
|
||||||
}
|
}
|
||||||
mUpperWallpaperTarget = foundW;
|
mUpperWallpaperTarget = foundW;
|
||||||
@ -1713,7 +1714,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
foundI = oldI;
|
foundI = oldI;
|
||||||
} else {
|
} else {
|
||||||
// The new target is below the old one.
|
// The new target is below the old one.
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "Found target below old target.");
|
Slog.v(TAG, "Found target below old target.");
|
||||||
}
|
}
|
||||||
mUpperWallpaperTarget = oldW;
|
mUpperWallpaperTarget = oldW;
|
||||||
@ -1732,7 +1733,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|| (mUpperWallpaperTarget.mAppToken != null
|
|| (mUpperWallpaperTarget.mAppToken != null
|
||||||
&& mUpperWallpaperTarget.mAppToken.mAppAnimator.animation != null);
|
&& mUpperWallpaperTarget.mAppToken.mAppAnimator.animation != null);
|
||||||
if (!lowerAnimating || !upperAnimating) {
|
if (!lowerAnimating || !upperAnimating) {
|
||||||
if (DEBUG_WALLPAPER) {
|
if (DEBUG_WALLPAPER_LIGHT) {
|
||||||
Slog.v(TAG, "No longer animating wallpaper targets!");
|
Slog.v(TAG, "No longer animating wallpaper targets!");
|
||||||
}
|
}
|
||||||
mLowerWallpaperTarget = null;
|
mLowerWallpaperTarget = null;
|
||||||
@ -1810,6 +1811,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
curTokenIndex--;
|
curTokenIndex--;
|
||||||
WindowToken token = mWallpaperTokens.get(curTokenIndex);
|
WindowToken token = mWallpaperTokens.get(curTokenIndex);
|
||||||
if (token.hidden == visible) {
|
if (token.hidden == visible) {
|
||||||
|
if (DEBUG_WALLPAPER_LIGHT) Slog.d(TAG,
|
||||||
|
"Wallpaper token " + token + " hidden=" + !visible);
|
||||||
changed |= ADJUST_WALLPAPER_VISIBILITY_CHANGED;
|
changed |= ADJUST_WALLPAPER_VISIBILITY_CHANGED;
|
||||||
token.hidden = !visible;
|
token.hidden = !visible;
|
||||||
// Need to do a layout to ensure the wallpaper now has the
|
// Need to do a layout to ensure the wallpaper now has the
|
||||||
@ -1831,7 +1834,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
dispatchWallpaperVisibility(wallpaper, visible);
|
dispatchWallpaperVisibility(wallpaper, visible);
|
||||||
|
|
||||||
wallpaper.mWinAnimator.mAnimLayer = wallpaper.mLayer + mWallpaperAnimLayerAdjustment;
|
wallpaper.mWinAnimator.mAnimLayer = wallpaper.mLayer + mWallpaperAnimLayerAdjustment;
|
||||||
if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "adjustWallpaper win "
|
if (DEBUG_LAYERS || DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "adjustWallpaper win "
|
||||||
+ wallpaper + " anim layer: " + wallpaper.mWinAnimator.mAnimLayer);
|
+ wallpaper + " anim layer: " + wallpaper.mWinAnimator.mAnimLayer);
|
||||||
|
|
||||||
// First, if this window is at the current index, then all
|
// First, if this window is at the current index, then all
|
||||||
@ -1858,7 +1861,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now stick it in.
|
// Now stick it in.
|
||||||
if (DEBUG_WALLPAPER || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) {
|
if (DEBUG_WALLPAPER_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) {
|
||||||
Slog.v(TAG, "Moving wallpaper " + wallpaper
|
Slog.v(TAG, "Moving wallpaper " + wallpaper
|
||||||
+ " from " + oldIndex + " to " + foundI);
|
+ " from " + oldIndex + " to " + foundI);
|
||||||
}
|
}
|
||||||
@ -2033,9 +2036,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (wallpaper.mWallpaperVisible != visible) {
|
if (wallpaper.mWallpaperVisible != visible) {
|
||||||
wallpaper.mWallpaperVisible = visible;
|
wallpaper.mWallpaperVisible = visible;
|
||||||
try {
|
try {
|
||||||
if (DEBUG_VISIBILITY || DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_VISIBILITY || DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Updating visibility of wallpaper " + wallpaper
|
"Updating vis of wallpaper " + wallpaper
|
||||||
+ ": " + visible + " Callers=" + Debug.getCallers(2));
|
+ ": " + visible + " from:\n" + Debug.getCallers(4, " "));
|
||||||
wallpaper.mClient.dispatchAppVisibility(visible);
|
wallpaper.mClient.dispatchAppVisibility(visible);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
@ -8800,10 +8803,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
WindowState oldWallpaper = mWallpaperTarget;
|
WindowState oldWallpaper = mWallpaperTarget;
|
||||||
if (mLowerWallpaperTarget != null
|
if (mLowerWallpaperTarget != null
|
||||||
&& mLowerWallpaperTarget.mAppToken != null) {
|
&& mLowerWallpaperTarget.mAppToken != null) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"wallpaperForceHiding changed with lower="
|
"wallpaperForceHiding changed with lower="
|
||||||
+ mLowerWallpaperTarget);
|
+ mLowerWallpaperTarget);
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"hidden=" + mLowerWallpaperTarget.mAppToken.hidden +
|
"hidden=" + mLowerWallpaperTarget.mAppToken.hidden +
|
||||||
" hiddenRequested=" + mLowerWallpaperTarget.mAppToken.hiddenRequested);
|
" hiddenRequested=" + mLowerWallpaperTarget.mAppToken.hiddenRequested);
|
||||||
if (mLowerWallpaperTarget.mAppToken.hidden) {
|
if (mLowerWallpaperTarget.mAppToken.hidden) {
|
||||||
@ -8815,7 +8818,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mInnerFields.mAdjResult |= adjustWallpaperWindowsLocked();
|
mInnerFields.mAdjResult |= adjustWallpaperWindowsLocked();
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG, "****** OLD: " + oldWallpaper
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "****** OLD: " + oldWallpaper
|
||||||
+ " NEW: " + mWallpaperTarget
|
+ " NEW: " + mWallpaperTarget
|
||||||
+ " LOWER: " + mLowerWallpaperTarget);
|
+ " LOWER: " + mLowerWallpaperTarget);
|
||||||
return changes;
|
return changes;
|
||||||
@ -9189,7 +9192,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((w.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0) {
|
if ((w.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"First draw done in potential wallpaper target " + w);
|
"First draw done in potential wallpaper target " + w);
|
||||||
mInnerFields.mWallpaperMayChange = true;
|
mInnerFields.mWallpaperMayChange = true;
|
||||||
displayContent.pendingLayoutChanges |=
|
displayContent.pendingLayoutChanges |=
|
||||||
@ -9340,18 +9343,18 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
mInnerFields.mWallpaperForceHidingChanged = false;
|
mInnerFields.mWallpaperForceHidingChanged = false;
|
||||||
|
|
||||||
if (mInnerFields.mWallpaperMayChange) {
|
if (mInnerFields.mWallpaperMayChange) {
|
||||||
if (WindowManagerService.DEBUG_WALLPAPER) Slog.v(TAG,
|
if (WindowManagerService.DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Wallpaper may change! Adjusting");
|
"Wallpaper may change! Adjusting");
|
||||||
mInnerFields.mAdjResult |= adjustWallpaperWindowsLocked();
|
mInnerFields.mAdjResult |= adjustWallpaperWindowsLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mInnerFields.mAdjResult&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
|
if ((mInnerFields.mAdjResult&ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Wallpaper layer changed: assigning layers + relayout");
|
"Wallpaper layer changed: assigning layers + relayout");
|
||||||
defaultDisplay.pendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
|
defaultDisplay.pendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
|
||||||
assignLayersLocked(defaultWindows);
|
assignLayersLocked(defaultWindows);
|
||||||
} else if ((mInnerFields.mAdjResult&ADJUST_WALLPAPER_VISIBILITY_CHANGED) != 0) {
|
} else if ((mInnerFields.mAdjResult&ADJUST_WALLPAPER_VISIBILITY_CHANGED) != 0) {
|
||||||
if (DEBUG_WALLPAPER) Slog.v(TAG,
|
if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
|
||||||
"Wallpaper visibility changed: relayout");
|
"Wallpaper visibility changed: relayout");
|
||||||
defaultDisplay.pendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
|
defaultDisplay.pendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
|
||||||
}
|
}
|
||||||
@ -10326,7 +10329,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
Iterator<WindowToken> it = mTokenMap.values().iterator();
|
Iterator<WindowToken> it = mTokenMap.values().iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
WindowToken token = it.next();
|
WindowToken token = it.next();
|
||||||
pw.print(" Token "); pw.print(token.token);
|
pw.print(" "); pw.print(token);
|
||||||
if (dumpAll) {
|
if (dumpAll) {
|
||||||
pw.println(':');
|
pw.println(':');
|
||||||
token.dump(pw, " ");
|
token.dump(pw, " ");
|
||||||
@ -10354,8 +10357,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
pw.println();
|
pw.println();
|
||||||
pw.println(" Application tokens in Z order:");
|
pw.println(" Application tokens in Z order:");
|
||||||
for (int i=mAppTokens.size()-1; i>=0; i--) {
|
for (int i=mAppTokens.size()-1; i>=0; i--) {
|
||||||
pw.print(" App #"); pw.print(i); pw.println(": ");
|
pw.print(" App #"); pw.print(i);
|
||||||
mAppTokens.get(i).dump(pw, " ");
|
pw.print(' '); pw.print(mAppTokens.get(i)); pw.println(":");
|
||||||
|
mAppTokens.get(i).dump(pw, " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mFinishedStarting.size() > 0) {
|
if (mFinishedStarting.size() > 0) {
|
||||||
|
@ -79,7 +79,6 @@ class WindowToken {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dump(PrintWriter pw, String prefix) {
|
void dump(PrintWriter pw, String prefix) {
|
||||||
pw.print(prefix); pw.print("token="); pw.println(token);
|
|
||||||
pw.print(prefix); pw.print("windows="); pw.println(windows);
|
pw.print(prefix); pw.print("windows="); pw.println(windows);
|
||||||
pw.print(prefix); pw.print("windowType="); pw.print(windowType);
|
pw.print(prefix); pw.print("windowType="); pw.print(windowType);
|
||||||
pw.print(" hidden="); pw.print(hidden);
|
pw.print(" hidden="); pw.print(hidden);
|
||||||
@ -97,7 +96,7 @@ class WindowToken {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("WindowToken{");
|
sb.append("WindowToken{");
|
||||||
sb.append(Integer.toHexString(System.identityHashCode(this)));
|
sb.append(Integer.toHexString(System.identityHashCode(this)));
|
||||||
sb.append(" token="); sb.append(token); sb.append('}');
|
sb.append(" "); sb.append(token); sb.append('}');
|
||||||
stringName = sb.toString();
|
stringName = sb.toString();
|
||||||
}
|
}
|
||||||
return stringName;
|
return stringName;
|
||||||
|
Reference in New Issue
Block a user