Merge "Log PiP protolog to logcat" into udc-dev

This commit is contained in:
Hongwei Wang
2023-05-13 20:09:02 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 15 deletions

View File

@@ -64,7 +64,6 @@ import android.content.res.Configuration;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.util.Log;
import android.view.Choreographer; import android.view.Choreographer;
import android.view.Display; import android.view.Display;
import android.view.Surface; import android.view.Surface;
@@ -109,7 +108,6 @@ import java.util.function.IntConsumer;
public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
DisplayController.OnDisplaysChangedListener, ShellTaskOrganizer.FocusListener { DisplayController.OnDisplaysChangedListener, ShellTaskOrganizer.FocusListener {
private static final String TAG = PipTaskOrganizer.class.getSimpleName(); private static final String TAG = PipTaskOrganizer.class.getSimpleName();
private static final boolean DEBUG = false;
/** /**
* The fixed start delay in ms when fading out the content overlay from bounds animation. * The fixed start delay in ms when fading out the content overlay from bounds animation.
@@ -1045,7 +1043,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
void onExitPipFinished(TaskInfo info) { void onExitPipFinished(TaskInfo info) {
if (mLeash == null) { if (mLeash == null) {
// TODO(239461594): Remove once the double call to onExitPipFinished() is fixed // TODO(239461594): Remove once the double call to onExitPipFinished() is fixed
Log.w(TAG, "Warning, onExitPipFinished() called multiple times in the same sessino"); ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
"Warning, onExitPipFinished() called multiple times in the same session");
return; return;
} }
@@ -1134,15 +1133,13 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
&& (mPipTransitionState.getTransitionState() != PipTransitionState.ENTERED_PIP); && (mPipTransitionState.getTransitionState() != PipTransitionState.ENTERED_PIP);
if ((mPipTransitionState.getInSwipePipToHomeTransition() if ((mPipTransitionState.getInSwipePipToHomeTransition()
|| waitForFixedRotationOnEnteringPip) && fromRotation) { || waitForFixedRotationOnEnteringPip) && fromRotation) {
if (DEBUG) { ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "%s: Skip onMovementBoundsChanged on rotation change"
"%s: Skip onMovementBoundsChanged on rotation change" + " InSwipePipToHomeTransition=%b"
+ " InSwipePipToHomeTransition=%b" + " mWaitForFixedRotation=%b"
+ " mWaitForFixedRotation=%b" + " getTransitionState=%d", TAG,
+ " getTransitionState=%d", TAG, mPipTransitionState.getInSwipePipToHomeTransition(), mWaitForFixedRotation,
mPipTransitionState.getInSwipePipToHomeTransition(), mWaitForFixedRotation, mPipTransitionState.getTransitionState());
mPipTransitionState.getTransitionState());
}
return; return;
} }
final PipAnimationController.PipTransitionAnimator animator = final PipAnimationController.PipTransitionAnimator animator =
@@ -1437,8 +1434,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
} }
if (mLeash == null || !mLeash.isValid()) { if (mLeash == null || !mLeash.isValid()) {
Log.e(TAG, String.format("scheduleFinishResizePip with null leash! mState=%d", ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
mPipTransitionState.getTransitionState())); "%s: scheduleFinishResizePip with null leash! mState=%d",
TAG, mPipTransitionState.getTransitionState());
return; return;
} }

View File

@@ -42,7 +42,8 @@ public enum ShellProtoLogGroup implements IProtoLogGroup {
"ShellBackPreview"), "ShellBackPreview"),
WM_SHELL_RECENT_TASKS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, WM_SHELL_RECENT_TASKS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
Consts.TAG_WM_SHELL), Consts.TAG_WM_SHELL),
WM_SHELL_PICTURE_IN_PICTURE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, // TODO(b/282232877): turn logToLogcat to false.
WM_SHELL_PICTURE_IN_PICTURE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
Consts.TAG_WM_SHELL), Consts.TAG_WM_SHELL),
WM_SHELL_SPLIT_SCREEN(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true, WM_SHELL_SPLIT_SCREEN(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
Consts.TAG_WM_SPLIT_SCREEN), Consts.TAG_WM_SPLIT_SCREEN),