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

Commit d342e391 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Enable logcat for display rotation change" into main

parents aa043159 bf144d6c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ public enum WmProtoLogGroups implements IProtoLogGroup {
    WM_ERROR(true, true, true, Consts.TAG_WM),
    WM_DEBUG_ORIENTATION(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM),
    WM_DEBUG_ORIENTATION_CHANGE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
            Consts.TAG_WM),
    WM_DEBUG_FOCUS_LIGHT(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM),
    WM_DEBUG_BOOT(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
+5 −0
Original line number Diff line number Diff line
@@ -3674,6 +3674,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp

        pw.println();
        super.dump(pw, prefix, dumpAll);
        pw.print(prefix);
        if (mHasSetIgnoreOrientationRequest) {
            pw.print("mHasSetIgnoreOrientationRequest=true ");
        }
        pw.print("ignoreOrientationRequest="); pw.println(getIgnoreOrientationRequest());
        pw.print(prefix); pw.print("mLayoutSeq="); pw.println(mLayoutSeq);

        pw.print("  mCurrentFocus="); pw.println(mCurrentFocus);
+6 −8
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static android.view.Display.TYPE_VIRTUAL;
import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS;

import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_ORIENTATION;
import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_ORIENTATION_CHANGE;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.LID_OPEN;
import static com.android.server.wm.DisplayRotationProto.FIXED_TO_USER_ROTATION_MODE;
import static com.android.server.wm.DisplayRotationProto.FROZEN_TO_USER_ROTATION;
@@ -587,11 +588,6 @@ public class DisplayRotation {
                ActivityInfo.screenOrientationToString(lastOrientation), lastOrientation,
                Surface.rotationToString(oldRotation), oldRotation);

        ProtoLog.v(WM_DEBUG_ORIENTATION,
                "Display id=%d selected orientation %s (%d), got rotation %s (%d)", displayId,
                ActivityInfo.screenOrientationToString(lastOrientation), lastOrientation,
                Surface.rotationToString(rotation), rotation);

        if (oldRotation == rotation) {
            // No change.
            return false;
@@ -601,9 +597,11 @@ public class DisplayRotation {
            mDisplayRotationCoordinator.onDefaultDisplayRotationChanged(rotation);
        }

        ProtoLog.v(WM_DEBUG_ORIENTATION,
                "Display id=%d rotation changed to %d from %d, lastOrientation=%d",
                        displayId, rotation, oldRotation, lastOrientation);
        ProtoLog.i(WM_DEBUG_ORIENTATION_CHANGE, "Display id=%d rotation changed to %d from %d,"
                        + " lastOrientation=%d userRotationMode=%d userRotation=%d"
                        + " lastSensorRotation=%d",
                displayId, rotation, oldRotation, lastOrientation, mUserRotationMode, mUserRotation,
                mLastSensorRotation);

        mRotation = rotation;