Merge "Fix several small logging issues."
This commit is contained in:
committed by
Android (Google) Code Review
commit
a0b16caf88
@@ -1125,4 +1125,11 @@ public class ActivityOptions {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ActivityOptions(" + hashCode() + "), mPackageName=" + mPackageName
|
||||
+ ", mAnimationType=" + mAnimationType + ", mStartX=" + mStartX + ", mStartY="
|
||||
+ mStartY + ", mWidth=" + mWidth + ", mHeight=" + mHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpe
|
||||
import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation;
|
||||
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
|
||||
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||
|
||||
@@ -85,9 +87,6 @@ import java.util.concurrent.Executors;
|
||||
// made visible or hidden at the next transition.
|
||||
public class AppTransition implements Dump {
|
||||
private static final String TAG = TAG_WITH_CLASS_NAME ? "AppTransition" : TAG_WM;
|
||||
private static final boolean DEBUG_APP_TRANSITIONS =
|
||||
WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
|
||||
private static final boolean DEBUG_ANIM = WindowManagerDebugConfig.DEBUG_ANIM;
|
||||
private static final int CLIP_REVEAL_TRANSLATION_Y_DP = 8;
|
||||
|
||||
/** Not set up for a transition. */
|
||||
|
||||
@@ -247,7 +247,7 @@ public class AppWindowAnimator {
|
||||
thumbnailTransformation.getMatrix().getValues(tmpFloats);
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(thumbnail,
|
||||
"thumbnail", "POS " + tmpFloats[Matrix.MTRANS_X]
|
||||
+ ", " + tmpFloats[Matrix.MTRANS_Y], null);
|
||||
+ ", " + tmpFloats[Matrix.MTRANS_Y]);
|
||||
thumbnail.setPosition(tmpFloats[Matrix.MTRANS_X], tmpFloats[Matrix.MTRANS_Y]);
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(thumbnail,
|
||||
"thumbnail", "alpha=" + thumbnailTransformation.getAlpha()
|
||||
@@ -255,7 +255,7 @@ public class AppWindowAnimator {
|
||||
+ " matrix=[" + tmpFloats[Matrix.MSCALE_X]
|
||||
+ "," + tmpFloats[Matrix.MSKEW_Y]
|
||||
+ "][" + tmpFloats[Matrix.MSKEW_X]
|
||||
+ "," + tmpFloats[Matrix.MSCALE_Y] + "]", null);
|
||||
+ "," + tmpFloats[Matrix.MSCALE_Y] + "]");
|
||||
thumbnail.setAlpha(thumbnailTransformation.getAlpha());
|
||||
if (thumbnailForceAboveLayer > 0) {
|
||||
thumbnail.setLayer(thumbnailForceAboveLayer + 1);
|
||||
|
||||
@@ -71,6 +71,6 @@ public class WindowManagerDebugConfig {
|
||||
static final boolean SHOW_TRANSACTIONS = false;
|
||||
static final boolean SHOW_VERBOSE_TRANSACTIONS = false && SHOW_TRANSACTIONS;
|
||||
static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS;
|
||||
static final boolean HIDE_STACK_CRAWLS = true;
|
||||
static final boolean SHOW_STACK_CRAWLS = false;
|
||||
static final boolean DEBUG_WINDOW_CROP = false;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import android.Manifest;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.app.ActivityManager.StackId;
|
||||
import android.app.ActivityManagerNative;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.IActivityManager;
|
||||
@@ -57,7 +56,6 @@ import android.os.ParcelFileDescriptor;
|
||||
import android.os.PowerManager;
|
||||
import android.os.PowerManagerInternal;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteCallbackList;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.StrictMode;
|
||||
@@ -220,7 +218,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.HIDE_STACK_CRAWLS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_STACK_CRAWLS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
|
||||
@@ -1502,7 +1500,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
if (w != null) {
|
||||
if (willMove) {
|
||||
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to "
|
||||
+ w + (HIDE_STACK_CRAWLS ? "" : " Callers=" + Debug.getCallers(4)));
|
||||
+ w + (SHOW_STACK_CRAWLS ? " Callers=" + Debug.getCallers(4) : ""));
|
||||
mInputMethodTarget = w;
|
||||
mInputMethodTargetWaitingAnim = false;
|
||||
if (w.mAppToken != null) {
|
||||
@@ -1516,7 +1514,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
if (willMove) {
|
||||
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to null."
|
||||
+ (HIDE_STACK_CRAWLS ? "" : " Callers=" + Debug.getCallers(4)));
|
||||
+ (SHOW_STACK_CRAWLS ? " Callers=" + Debug.getCallers(4) : ""));
|
||||
mInputMethodTarget = null;
|
||||
mLayersController.setInputMethodAnimLayerAdjustment(0);
|
||||
}
|
||||
@@ -2391,22 +2389,27 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
}
|
||||
|
||||
static void logSurface(WindowState w, String msg, RuntimeException where) {
|
||||
static void logSurface(WindowState w, String msg, boolean withStackTrace) {
|
||||
String str = " SURFACE " + msg + ": " + w;
|
||||
if (where != null) {
|
||||
Slog.i(TAG_WM, str, where);
|
||||
if (withStackTrace) {
|
||||
logWithStack(TAG, str);
|
||||
} else {
|
||||
Slog.i(TAG_WM, str);
|
||||
}
|
||||
}
|
||||
|
||||
static void logSurface(SurfaceControl s, String title, String msg, RuntimeException where) {
|
||||
static void logSurface(SurfaceControl s, String title, String msg) {
|
||||
String str = " SURFACE " + s + ": " + msg + " / " + title;
|
||||
if (where != null) {
|
||||
Slog.i(TAG_WM, str, where);
|
||||
} else {
|
||||
Slog.i(TAG_WM, str);
|
||||
Slog.i(TAG_WM, str);
|
||||
}
|
||||
|
||||
static void logWithStack(String tag, String s) {
|
||||
RuntimeException e = null;
|
||||
if (SHOW_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
Slog.i(tag, s, e);
|
||||
}
|
||||
|
||||
void setTransparentRegionWindow(Session session, IWindow client, Region region) {
|
||||
@@ -2415,7 +2418,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
synchronized (mWindowMap) {
|
||||
WindowState w = windowForClientLocked(session, client, false);
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
|
||||
"transparentRegionHint=" + region, null);
|
||||
"transparentRegionHint=" + region, false);
|
||||
|
||||
if ((w != null) && w.mHasSurface) {
|
||||
w.mWinAnimator.setTransparentRegionHintLocked(region);
|
||||
@@ -2990,14 +2993,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
mCurConfiguration.orientation, frame, insets, surfaceInsets, isVoiceInteraction,
|
||||
!fullscreen, atoken.mTask.mTaskId);
|
||||
if (a != null) {
|
||||
if (DEBUG_ANIM) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
Slog.v(TAG_WM, "Loaded animation " + a + " for " + atoken, e);
|
||||
}
|
||||
if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + atoken);
|
||||
final int containingWidth = frame.width();
|
||||
final int containingHeight = frame.height();
|
||||
atoken.mAppAnimator.setAnimation(a, containingWidth, containingHeight,
|
||||
@@ -4306,16 +4302,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
|
||||
private void startAppFreezingScreenLocked(AppWindowToken wtoken) {
|
||||
if (DEBUG_ORIENTATION) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
Slog.i(TAG_WM, "Set freezing of " + wtoken.appToken
|
||||
+ ": hidden=" + wtoken.hidden + " freezing="
|
||||
+ wtoken.mAppAnimator.freezingScreen, e);
|
||||
}
|
||||
if (DEBUG_ORIENTATION) logWithStack(TAG, "Set freezing of " + wtoken.appToken + ": hidden="
|
||||
+ wtoken.hidden + " freezing=" + wtoken.mAppAnimator.freezingScreen);
|
||||
if (!wtoken.hiddenRequested) {
|
||||
if (!wtoken.mAppAnimator.freezingScreen) {
|
||||
wtoken.mAppAnimator.freezingScreen = true;
|
||||
@@ -8933,7 +8921,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
+ ws + " surface=" + wsa.mSurfaceController
|
||||
+ " token=" + ws.mAppToken
|
||||
+ " saved=" + ws.mAppToken.hasSavedSurface());
|
||||
if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null);
|
||||
if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", false);
|
||||
wsa.destroySurface();
|
||||
ws.setHasSurface(false);
|
||||
leakedSurface = true;
|
||||
@@ -8979,7 +8967,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
Slog.w(TAG_WM, "Looks like we have reclaimed some memory, clearing surface for retry.");
|
||||
if (surfaceController != null) {
|
||||
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) logSurface(winAnimator.mWin,
|
||||
"RECOVER DESTROY", null);
|
||||
"RECOVER DESTROY", false);
|
||||
surfaceController.destroyInTransaction();
|
||||
winAnimator.mWin.setHasSurface(false);
|
||||
scheduleRemoveStartingWindowLocked(winAnimator.mWin.mAppToken);
|
||||
|
||||
@@ -29,7 +29,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_CROP;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.HIDE_STACK_CRAWLS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_STACK_CRAWLS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
|
||||
@@ -37,6 +37,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
|
||||
import static com.android.server.wm.WindowManagerService.localLOGV;
|
||||
import static com.android.server.wm.WindowManagerService.logWithStack;
|
||||
import static com.android.server.wm.WindowState.DRAG_RESIZE_MODE_DOCKED_DIVIDER;
|
||||
import static com.android.server.wm.WindowState.DRAG_RESIZE_MODE_FREEFORM;
|
||||
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
|
||||
@@ -547,7 +548,7 @@ class WindowStateAnimator {
|
||||
if (mDestroyPreservedSurfaceUponRedraw) {
|
||||
return;
|
||||
}
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin, "SET FREEZE LAYER", null);
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin, "SET FREEZE LAYER", false);
|
||||
if (mSurfaceController != null) {
|
||||
mSurfaceController.setLayer(mAnimLayer + 1);
|
||||
}
|
||||
@@ -665,13 +666,13 @@ class WindowStateAnimator {
|
||||
Slog.i(TAG, ">>> OPEN TRANSACTION createSurfaceLocked");
|
||||
WindowManagerService.logSurface(w, "CREATE pos=("
|
||||
+ w.mFrame.left + "," + w.mFrame.top + ") ("
|
||||
+ width + "x" + height + "), layer=" + mAnimLayer + " HIDE", null);
|
||||
+ width + "x" + height + "), layer=" + mAnimLayer + " HIDE", false);
|
||||
}
|
||||
|
||||
// Start a new transaction and apply position & offset.
|
||||
final int layerStack = w.getDisplayContent().getDisplay().getLayerStack();
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
|
||||
"POS " + mTmpSize.left + ", " + mTmpSize.top, null);
|
||||
"POS " + mTmpSize.left + ", " + mTmpSize.top, false);
|
||||
mSurfaceController.setPositionAndLayer(mTmpSize.left, mTmpSize.top, layerStack,
|
||||
mAnimLayer);
|
||||
mLastHidden = true;
|
||||
@@ -758,25 +759,13 @@ class WindowStateAnimator {
|
||||
}
|
||||
|
||||
try {
|
||||
if (DEBUG_VISIBILITY) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
Slog.w(TAG, "Window " + this + " destroying surface "
|
||||
+ mSurfaceController + ", session " + mSession, e);
|
||||
}
|
||||
if (DEBUG_VISIBILITY) logWithStack(TAG, "Window " + this + " destroying surface "
|
||||
+ mSurfaceController + ", session " + mSession);
|
||||
if (mSurfaceDestroyDeferred) {
|
||||
if (mSurfaceController != null && mPendingDestroySurface != mSurfaceController) {
|
||||
if (mPendingDestroySurface != null) {
|
||||
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
WindowManagerService.logSurface(mWin, "DESTROY PENDING", e);
|
||||
WindowManagerService.logSurface(mWin, "DESTROY PENDING", true);
|
||||
}
|
||||
mPendingDestroySurface.destroyInTransaction();
|
||||
}
|
||||
@@ -784,12 +773,7 @@ class WindowStateAnimator {
|
||||
}
|
||||
} else {
|
||||
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
WindowManagerService.logSurface(mWin, "DESTROY", null);
|
||||
WindowManagerService.logSurface(mWin, "DESTROY", true);
|
||||
}
|
||||
destroySurface();
|
||||
}
|
||||
@@ -820,12 +804,7 @@ class WindowStateAnimator {
|
||||
try {
|
||||
if (mPendingDestroySurface != null) {
|
||||
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
WindowManagerService.logSurface(mWin, "DESTROY PENDING", e);
|
||||
WindowManagerService.logSurface(mWin, "DESTROY PENDING", true);
|
||||
}
|
||||
mPendingDestroySurface.destroyInTransaction();
|
||||
// Don't hide wallpaper if we're destroying a deferred surface
|
||||
@@ -1308,7 +1287,7 @@ class WindowStateAnimator {
|
||||
+ " matrix=[" + mDsDx + "*" + w.mHScale
|
||||
+ "," + mDtDx + "*" + w.mVScale
|
||||
+ "][" + mDsDy + "*" + w.mHScale
|
||||
+ "," + mDtDy + "*" + w.mVScale + "]", null);
|
||||
+ "," + mDtDy + "*" + w.mVScale + "]", false);
|
||||
|
||||
boolean prepared =
|
||||
mSurfaceController.prepareToShowInTransaction(mShownAlpha, mAnimLayer,
|
||||
@@ -1620,14 +1599,7 @@ class WindowStateAnimator {
|
||||
+ " transit=" + transit
|
||||
+ " isEntrance=" + isEntrance + " Callers " + Debug.getCallers(3));
|
||||
if (a != null) {
|
||||
if (DEBUG_ANIM) {
|
||||
RuntimeException e = null;
|
||||
if (!HIDE_STACK_CRAWLS) {
|
||||
e = new RuntimeException();
|
||||
e.fillInStackTrace();
|
||||
}
|
||||
Slog.v(TAG, "Loaded animation " + a + " for " + this, e);
|
||||
}
|
||||
if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + this);
|
||||
setAnimation(a);
|
||||
mAnimationIsEntrance = isEntrance;
|
||||
}
|
||||
|
||||
@@ -18,9 +18,7 @@ package com.android.server.wm;
|
||||
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.HIDE_STACK_CRAWLS;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||
|
||||
Reference in New Issue
Block a user