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

Commit abee62b6 authored by Jerry Chang's avatar Jerry Chang Committed by Android (Google) Code Review
Browse files

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

parents 78826d1e 5831db95
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -46,8 +46,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.internal.policy.DividerSnapAlgorithm;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.R;
import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.protolog.ShellProtoLogGroup;

/**
 * Divider for multi window splits.
@@ -364,8 +366,11 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
        mViewHost.relayout(lp);
    }

    void setInteractive(boolean interactive) {
    void setInteractive(boolean interactive, String from) {
        if (interactive == mInteractive) return;
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                "Set divider bar %s from %s", interactive ? "interactive" : "non-interactive",
                from);
        mInteractive = interactive;
        releaseTouching();
        mHandle.setVisibility(mInteractive ? View.VISIBLE : View.INVISIBLE);
+3 −2
Original line number Diff line number Diff line
@@ -1093,7 +1093,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
            // ImePositionProcessor#onImeVisibilityChanged directly in DividerView is not enough
            // because DividerView won't receive onImeVisibilityChanged callback after it being
            // re-inflated.
            mSplitWindowManager.setInteractive(!mImeShown || !mHasImeFocus);
            mSplitWindowManager.setInteractive(!mImeShown || !mHasImeFocus,
                    "onImeStartPositioning");

            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.
            if (!controlling && mImeShown) {
                reset();
                mSplitWindowManager.setInteractive(true);
                mSplitWindowManager.setInteractive(true, "onImeControlTargetChanged");
                mSplitLayoutHandler.setLayoutOffsetTarget(0, 0, SplitLayout.this);
                mSplitLayoutHandler.onLayoutPositionChanging(SplitLayout.this);
            }
+2 −2
Original line number Diff line number Diff line
@@ -166,9 +166,9 @@ public final class SplitWindowManager extends WindowlessWindowManager {
        }
    }

    void setInteractive(boolean interactive) {
    void setInteractive(boolean interactive, String from) {
        if (mDividerView == null) return;
        mDividerView.setInteractive(interactive);
        mDividerView.setInteractive(interactive, from);
    }

    View getDividerView() {
+3 −2
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ public enum ShellProtoLogGroup implements IProtoLogGroup {
            Consts.TAG_WM_SHELL),
    WM_SHELL_PICTURE_IN_PICTURE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM_SHELL),
    WM_SHELL_SPLIT_SCREEN(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM_SHELL),
    WM_SHELL_SPLIT_SCREEN(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
            Consts.TAG_WM_SPLIT_SCREEN),
    WM_SHELL_SYSUI_EVENTS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM_SHELL),
    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 final String TAG_WM_SHELL = "WindowManagerShell";
        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_LOG_TO_PROTO_DEBUG = true;
+6 −6
Original line number Diff line number Diff line
@@ -1097,7 +1097,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            activityTaskManagerService.setFocusedTask(getTaskId(stageToFocus));
        } catch (RemoteException | NullPointerException e) {
            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,
                "%s: Request to %s divider bar from %s.", TAG,
                "Request to %s divider bar from %s.",
                (visible ? "show" : "hide"), Debug.getCaller());

        // Defer showing divider bar after keyguard dismissed, so it won't interfere with keyguard
        // dismissing animation.
        if (visible && mKeyguardShowing) {
            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;
        }

@@ -1450,7 +1450,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,

        if (mIsDividerRemoteAnimating) {
            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;
        }

@@ -1465,12 +1465,12 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash();
        if (dividerLeash == null) {
            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;
        }
        if (mIsDividerRemoteAnimating) {
            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;
        }