Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0b16caf authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "Fix several small logging issues."

parents 4ba6303a 198dcbf5
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1125,4 +1125,11 @@ public class ActivityOptions {
        return null;
        return null;
    }
    }


    /** @hide */
    @Override
    public String toString() {
        return "ActivityOptions(" + hashCode() + "), mPackageName=" + mPackageName
                + ", mAnimationType=" + mAnimationType + ", mStartX=" + mStartX + ", mStartY="
                + mStartY + ", mWidth=" + mWidth + ", mHeight=" + mHeight;
    }
}
}
+2 −3
Original line number Original line Diff line number Diff line
@@ -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_wallpaperIntraOpenExitAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
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_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
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.
// made visible or hidden at the next transition.
public class AppTransition implements Dump {
public class AppTransition implements Dump {
    private static final String TAG = TAG_WITH_CLASS_NAME ? "AppTransition" : TAG_WM;
    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;
    private static final int CLIP_REVEAL_TRANSLATION_Y_DP = 8;


    /** Not set up for a transition. */
    /** Not set up for a transition. */
+2 −2
Original line number Original line Diff line number Diff line
@@ -247,7 +247,7 @@ public class AppWindowAnimator {
        thumbnailTransformation.getMatrix().getValues(tmpFloats);
        thumbnailTransformation.getMatrix().getValues(tmpFloats);
        if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(thumbnail,
        if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(thumbnail,
                "thumbnail", "POS " + tmpFloats[Matrix.MTRANS_X]
                "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]);
        thumbnail.setPosition(tmpFloats[Matrix.MTRANS_X], tmpFloats[Matrix.MTRANS_Y]);
        if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(thumbnail,
        if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(thumbnail,
                "thumbnail", "alpha=" + thumbnailTransformation.getAlpha()
                "thumbnail", "alpha=" + thumbnailTransformation.getAlpha()
@@ -255,7 +255,7 @@ public class AppWindowAnimator {
                + " matrix=[" + tmpFloats[Matrix.MSCALE_X]
                + " matrix=[" + tmpFloats[Matrix.MSCALE_X]
                + "," + tmpFloats[Matrix.MSKEW_Y]
                + "," + tmpFloats[Matrix.MSKEW_Y]
                + "][" + tmpFloats[Matrix.MSKEW_X]
                + "][" + tmpFloats[Matrix.MSKEW_X]
                + "," + tmpFloats[Matrix.MSCALE_Y] + "]", null);
                + "," + tmpFloats[Matrix.MSCALE_Y] + "]");
        thumbnail.setAlpha(thumbnailTransformation.getAlpha());
        thumbnail.setAlpha(thumbnailTransformation.getAlpha());
        if (thumbnailForceAboveLayer > 0) {
        if (thumbnailForceAboveLayer > 0) {
            thumbnail.setLayer(thumbnailForceAboveLayer + 1);
            thumbnail.setLayer(thumbnailForceAboveLayer + 1);
+1 −1
Original line number Original line Diff line number Diff line
@@ -71,6 +71,6 @@ public class WindowManagerDebugConfig {
    static final boolean SHOW_TRANSACTIONS = false;
    static final boolean SHOW_TRANSACTIONS = false;
    static final boolean SHOW_VERBOSE_TRANSACTIONS = false && SHOW_TRANSACTIONS;
    static final boolean SHOW_VERBOSE_TRANSACTIONS = false && SHOW_TRANSACTIONS;
    static final boolean SHOW_LIGHT_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;
    static final boolean DEBUG_WINDOW_CROP = false;
}
}
+22 −34
Original line number Original line Diff line number Diff line
@@ -20,7 +20,6 @@ import android.Manifest;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.app.ActivityManager.StackId;
import android.app.ActivityManagerNative;
import android.app.ActivityManagerNative;
import android.app.AppOpsManager;
import android.app.AppOpsManager;
import android.app.IActivityManager;
import android.app.IActivityManager;
@@ -57,7 +56,6 @@ import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.PowerManagerInternal;
import android.os.PowerManagerInternal;
import android.os.Process;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager;
import android.os.StrictMode;
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_WALLPAPER_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT;
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.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_LIGHT_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
@@ -1502,7 +1500,7 @@ public class WindowManagerService extends IWindowManager.Stub
        if (w != null) {
        if (w != null) {
            if (willMove) {
            if (willMove) {
                if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to "
                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;
                mInputMethodTarget = w;
                mInputMethodTargetWaitingAnim = false;
                mInputMethodTargetWaitingAnim = false;
                if (w.mAppToken != null) {
                if (w.mAppToken != null) {
@@ -1516,7 +1514,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
        }
        if (willMove) {
        if (willMove) {
            if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to null."
            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;
            mInputMethodTarget = null;
            mLayersController.setInputMethodAnimLayerAdjustment(0);
            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;
        String str = "  SURFACE " + msg + ": " + w;
        if (where != null) {
        if (withStackTrace) {
            Slog.i(TAG_WM, str, where);
            logWithStack(TAG, str);
        } else {
        } else {
            Slog.i(TAG_WM, str);
            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;
        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) {
    void setTransparentRegionWindow(Session session, IWindow client, Region region) {
@@ -2415,7 +2418,7 @@ public class WindowManagerService extends IWindowManager.Stub
            synchronized (mWindowMap) {
            synchronized (mWindowMap) {
                WindowState w = windowForClientLocked(session, client, false);
                WindowState w = windowForClientLocked(session, client, false);
                if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
                if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
                        "transparentRegionHint=" + region, null);
                        "transparentRegionHint=" + region, false);


                if ((w != null) && w.mHasSurface) {
                if ((w != null) && w.mHasSurface) {
                    w.mWinAnimator.setTransparentRegionHintLocked(region);
                    w.mWinAnimator.setTransparentRegionHintLocked(region);
@@ -2990,14 +2993,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    mCurConfiguration.orientation, frame, insets, surfaceInsets, isVoiceInteraction,
                    mCurConfiguration.orientation, frame, insets, surfaceInsets, isVoiceInteraction,
                    !fullscreen, atoken.mTask.mTaskId);
                    !fullscreen, atoken.mTask.mTaskId);
            if (a != null) {
            if (a != null) {
                if (DEBUG_ANIM) {
                if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + atoken);
                    RuntimeException e = null;
                    if (!HIDE_STACK_CRAWLS) {
                        e = new RuntimeException();
                        e.fillInStackTrace();
                    }
                    Slog.v(TAG_WM, "Loaded animation " + a + " for " + atoken, e);
                }
                final int containingWidth = frame.width();
                final int containingWidth = frame.width();
                final int containingHeight = frame.height();
                final int containingHeight = frame.height();
                atoken.mAppAnimator.setAnimation(a, containingWidth, containingHeight,
                atoken.mAppAnimator.setAnimation(a, containingWidth, containingHeight,
@@ -4306,16 +4302,8 @@ public class WindowManagerService extends IWindowManager.Stub
    }
    }


    private void startAppFreezingScreenLocked(AppWindowToken wtoken) {
    private void startAppFreezingScreenLocked(AppWindowToken wtoken) {
        if (DEBUG_ORIENTATION) {
        if (DEBUG_ORIENTATION) logWithStack(TAG, "Set freezing of " + wtoken.appToken + ": hidden="
            RuntimeException e = null;
                + wtoken.hidden + " freezing=" + wtoken.mAppAnimator.freezingScreen);
            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 (!wtoken.hiddenRequested) {
        if (!wtoken.hiddenRequested) {
            if (!wtoken.mAppAnimator.freezingScreen) {
            if (!wtoken.mAppAnimator.freezingScreen) {
                wtoken.mAppAnimator.freezingScreen = true;
                wtoken.mAppAnimator.freezingScreen = true;
@@ -8933,7 +8921,7 @@ public class WindowManagerService extends IWindowManager.Stub
                                    + ws + " surface=" + wsa.mSurfaceController
                                    + ws + " surface=" + wsa.mSurfaceController
                                    + " token=" + ws.mAppToken
                                    + " token=" + ws.mAppToken
                                    + " saved=" + ws.mAppToken.hasSavedSurface());
                                    + " saved=" + ws.mAppToken.hasSavedSurface());
                            if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null);
                            if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", false);
                            wsa.destroySurface();
                            wsa.destroySurface();
                            ws.setHasSurface(false);
                            ws.setHasSurface(false);
                            leakedSurface = true;
                            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.");
                Slog.w(TAG_WM, "Looks like we have reclaimed some memory, clearing surface for retry.");
                if (surfaceController != null) {
                if (surfaceController != null) {
                    if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) logSurface(winAnimator.mWin,
                    if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) logSurface(winAnimator.mWin,
                            "RECOVER DESTROY", null);
                            "RECOVER DESTROY", false);
                    surfaceController.destroyInTransaction();
                    surfaceController.destroyInTransaction();
                    winAnimator.mWin.setHasSurface(false);
                    winAnimator.mWin.setHasSurface(false);
                    scheduleRemoveStartingWindowLocked(winAnimator.mWin.mAppToken);
                    scheduleRemoveStartingWindowLocked(winAnimator.mWin.mAppToken);
Loading