Merge "Work on issue #17381033: Program icon and shortcut disappear after..." into lmp-dev

This commit is contained in:
Dianne Hackborn
2014-09-19 23:24:18 +00:00
committed by Android (Google) Code Review
2 changed files with 60 additions and 13 deletions

View File

@@ -11190,6 +11190,7 @@ public class WindowManagerService extends IWindowManager.Stub
pw.println(" p[policy]: policy state");
pw.println(" a[animator]: animator state");
pw.println(" s[essions]: active sessions");
pw.println(" surfaces: active surfaces (debugging enabled only)");
pw.println(" d[isplays]: active display contents");
pw.println(" t[okens]: token list");
pw.println(" w[indows]: window list");
@@ -11229,6 +11230,11 @@ public class WindowManagerService extends IWindowManager.Stub
dumpSessionsLocked(pw, true);
}
return;
} else if ("surfaces".equals(cmd)) {
synchronized(mWindowMap) {
WindowStateAnimator.SurfaceTrace.dumpAllSurfaces(pw, null);
}
return;
} else if ("displays".equals(cmd) || "d".equals(cmd)) {
synchronized(mWindowMap) {
dumpDisplayContentsLocked(pw, true);
@@ -11284,6 +11290,13 @@ public class WindowManagerService extends IWindowManager.Stub
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
}
WindowStateAnimator.SurfaceTrace.dumpAllSurfaces(pw, dumpAll ?
"-------------------------------------------------------------------------------"
: null);
pw.println();
if (dumpAll) {
pw.println("-------------------------------------------------------------------------------");
}
dumpDisplayContentsLocked(pw, dumpAll);
pw.println();
if (dumpAll) {

View File

@@ -536,6 +536,9 @@ class WindowStateAnimator {
mSize.set(w, h);
Slog.v(SURFACE_TAG, "ctor: " + this + ". Called by "
+ Debug.getCallers(3));
synchronized (sSurfaces) {
sSurfaces.add(0, this);
}
}
@Override
@@ -557,15 +560,17 @@ class WindowStateAnimator {
}
super.setLayer(zorder);
sSurfaces.remove(this);
int i;
for (i = sSurfaces.size() - 1; i >= 0; i--) {
SurfaceTrace s = sSurfaces.get(i);
if (s.mLayer < zorder) {
break;
synchronized (sSurfaces) {
sSurfaces.remove(this);
int i;
for (i = sSurfaces.size() - 1; i >= 0; i--) {
SurfaceTrace s = sSurfaces.get(i);
if (s.mLayer < zorder) {
break;
}
}
sSurfaces.add(i + 1, this);
}
sSurfaces.add(i + 1, this);
}
@Override
@@ -655,7 +660,9 @@ class WindowStateAnimator {
public void destroy() {
super.destroy();
Slog.v(SURFACE_TAG, "destroy: " + this + ". Called by " + Debug.getCallers(3));
sSurfaces.remove(this);
synchronized (sSurfaces) {
sSurfaces.remove(this);
}
}
@Override
@@ -663,13 +670,40 @@ class WindowStateAnimator {
super.release();
Slog.v(SURFACE_TAG, "release: " + this + ". Called by "
+ Debug.getCallers(3));
sSurfaces.remove(this);
synchronized (sSurfaces) {
sSurfaces.remove(this);
}
}
static void dumpAllSurfaces() {
final int N = sSurfaces.size();
for (int i = 0; i < N; i++) {
Slog.i(TAG, "SurfaceDump: " + sSurfaces.get(i));
static void dumpAllSurfaces(PrintWriter pw, String header) {
synchronized (sSurfaces) {
final int N = sSurfaces.size();
if (N <= 0) {
return;
}
if (header != null) {
pw.println(header);
}
pw.println("WINDOW MANAGER SURFACES (dumpsys window surfaces)");
for (int i = 0; i < N; i++) {
SurfaceTrace s = sSurfaces.get(i);
pw.print(" Surface #"); pw.print(i); pw.print(": #");
pw.print(Integer.toHexString(System.identityHashCode(s)));
pw.print(" "); pw.println(s.mName);
pw.print(" mLayerStack="); pw.print(s.mLayerStack);
pw.print(" mLayer="); pw.println(s.mLayer);
pw.print(" mShown="); pw.print(s.mShown); pw.print(" mAlpha=");
pw.print(s.mSurfaceTraceAlpha); pw.print(" mIsOpaque=");
pw.println(s.mIsOpaque);
pw.print(" mPosition="); pw.print(s.mPosition.x); pw.print(",");
pw.print(s.mPosition.y);
pw.print(" mSize="); pw.print(s.mSize.x); pw.print("x");
pw.println(s.mSize.y);
pw.print(" mCrop="); s.mWindowCrop.printShortString(pw); pw.println();
pw.print(" Transform: ("); pw.print(s.mDsdx); pw.print(", ");
pw.print(s.mDtdx); pw.print(", "); pw.print(s.mDsdy);
pw.print(", "); pw.print(s.mDtdy); pw.println(")");
}
}
}