Merge "Enable shell split screen logging to diagnose not interactable divider" into tm-qpr-dev

This commit is contained in:
Jerry Chang
2022-11-09 10:52:03 +00:00
committed by Android (Google) Code Review
5 changed files with 20 additions and 13 deletions

View File

@@ -46,8 +46,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.android.internal.policy.DividerSnapAlgorithm; import com.android.internal.policy.DividerSnapAlgorithm;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.R; import com.android.wm.shell.R;
import com.android.wm.shell.animation.Interpolators; import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
/** /**
* Divider for multi window splits. * Divider for multi window splits.
@@ -364,8 +366,11 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
mViewHost.relayout(lp); mViewHost.relayout(lp);
} }
void setInteractive(boolean interactive) { void setInteractive(boolean interactive, String from) {
if (interactive == mInteractive) return; if (interactive == mInteractive) return;
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"Set divider bar %s from %s", interactive ? "interactive" : "non-interactive",
from);
mInteractive = interactive; mInteractive = interactive;
releaseTouching(); releaseTouching();
mHandle.setVisibility(mInteractive ? View.VISIBLE : View.INVISIBLE); mHandle.setVisibility(mInteractive ? View.VISIBLE : View.INVISIBLE);

View File

@@ -1093,7 +1093,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
// ImePositionProcessor#onImeVisibilityChanged directly in DividerView is not enough // ImePositionProcessor#onImeVisibilityChanged directly in DividerView is not enough
// because DividerView won't receive onImeVisibilityChanged callback after it being // because DividerView won't receive onImeVisibilityChanged callback after it being
// re-inflated. // re-inflated.
mSplitWindowManager.setInteractive(!mImeShown || !mHasImeFocus); mSplitWindowManager.setInteractive(!mImeShown || !mHasImeFocus,
"onImeStartPositioning");
return needOffset ? IME_ANIMATION_NO_ALPHA : 0; return needOffset ? IME_ANIMATION_NO_ALPHA : 0;
} }
@@ -1119,7 +1120,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
// Restore the split layout when wm-shell is not controlling IME insets anymore. // Restore the split layout when wm-shell is not controlling IME insets anymore.
if (!controlling && mImeShown) { if (!controlling && mImeShown) {
reset(); reset();
mSplitWindowManager.setInteractive(true); mSplitWindowManager.setInteractive(true, "onImeControlTargetChanged");
mSplitLayoutHandler.setLayoutOffsetTarget(0, 0, SplitLayout.this); mSplitLayoutHandler.setLayoutOffsetTarget(0, 0, SplitLayout.this);
mSplitLayoutHandler.onLayoutPositionChanging(SplitLayout.this); mSplitLayoutHandler.onLayoutPositionChanging(SplitLayout.this);
} }

View File

@@ -166,9 +166,9 @@ public final class SplitWindowManager extends WindowlessWindowManager {
} }
} }
void setInteractive(boolean interactive) { void setInteractive(boolean interactive, String from) {
if (mDividerView == null) return; if (mDividerView == null) return;
mDividerView.setInteractive(interactive); mDividerView.setInteractive(interactive, from);
} }
View getDividerView() { View getDividerView() {

View File

@@ -42,8 +42,8 @@ public enum ShellProtoLogGroup implements IProtoLogGroup {
Consts.TAG_WM_SHELL), Consts.TAG_WM_SHELL),
WM_SHELL_PICTURE_IN_PICTURE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, WM_SHELL_PICTURE_IN_PICTURE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
Consts.TAG_WM_SHELL), Consts.TAG_WM_SHELL),
WM_SHELL_SPLIT_SCREEN(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, WM_SHELL_SPLIT_SCREEN(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
Consts.TAG_WM_SHELL), Consts.TAG_WM_SPLIT_SCREEN),
WM_SHELL_SYSUI_EVENTS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, WM_SHELL_SYSUI_EVENTS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
Consts.TAG_WM_SHELL), Consts.TAG_WM_SHELL),
WM_SHELL_DESKTOP_MODE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, WM_SHELL_DESKTOP_MODE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
@@ -110,6 +110,7 @@ public enum ShellProtoLogGroup implements IProtoLogGroup {
private static class Consts { private static class Consts {
private static final String TAG_WM_SHELL = "WindowManagerShell"; private static final String TAG_WM_SHELL = "WindowManagerShell";
private static final String TAG_WM_STARTING_WINDOW = "ShellStartingWindow"; private static final String TAG_WM_STARTING_WINDOW = "ShellStartingWindow";
private static final String TAG_WM_SPLIT_SCREEN = "ShellSplitScreen";
private static final boolean ENABLE_DEBUG = true; private static final boolean ENABLE_DEBUG = true;
private static final boolean ENABLE_LOG_TO_PROTO_DEBUG = true; private static final boolean ENABLE_LOG_TO_PROTO_DEBUG = true;

View File

@@ -1097,7 +1097,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
activityTaskManagerService.setFocusedTask(getTaskId(stageToFocus)); activityTaskManagerService.setFocusedTask(getTaskId(stageToFocus));
} catch (RemoteException | NullPointerException e) { } catch (RemoteException | NullPointerException e) {
ProtoLog.e(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, ProtoLog.e(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"%s: Unable to update focus on the chosen stage, %s", TAG, e); "Unable to update focus on the chosen stage: %s", e.getMessage());
} }
} }
@@ -1434,14 +1434,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
} }
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"%s: Request to %s divider bar from %s.", TAG, "Request to %s divider bar from %s.",
(visible ? "show" : "hide"), Debug.getCaller()); (visible ? "show" : "hide"), Debug.getCaller());
// Defer showing divider bar after keyguard dismissed, so it won't interfere with keyguard // Defer showing divider bar after keyguard dismissed, so it won't interfere with keyguard
// dismissing animation. // dismissing animation.
if (visible && mKeyguardShowing) { if (visible && mKeyguardShowing) {
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"%s: Defer showing divider bar due to keyguard showing.", TAG); " Defer showing divider bar due to keyguard showing.");
return; return;
} }
@@ -1450,7 +1450,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
if (mIsDividerRemoteAnimating) { if (mIsDividerRemoteAnimating) {
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"%s: Skip animating divider bar due to it's remote animating.", TAG); " Skip animating divider bar due to it's remote animating.");
return; return;
} }
@@ -1465,12 +1465,12 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash(); final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash();
if (dividerLeash == null) { if (dividerLeash == null) {
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"%s: Skip animating divider bar due to divider leash not ready.", TAG); " Skip animating divider bar due to divider leash not ready.");
return; return;
} }
if (mIsDividerRemoteAnimating) { if (mIsDividerRemoteAnimating) {
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"%s: Skip animating divider bar due to it's remote animating.", TAG); " Skip animating divider bar due to it's remote animating.");
return; return;
} }