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

Commit b13eb63b authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Use Divider ShellRoot to ferry divider to Accessibility" into rvc-dev am: 9c5a02c2

Change-Id: If2b9bd5ef5ee5ff535aad3fc340c99b7200a9668
parents 2b54d7f6 9c5a02c2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1245,6 +1245,16 @@ final class AccessibilityController {
                    }
                }

                for (int i = dc.mShellRoots.size() - 1; i >= 0; --i) {
                    final WindowInfo info = dc.mShellRoots.valueAt(i).getWindowInfo();
                    if (info == null) {
                        continue;
                    }
                    info.layer = addedWindows.size();
                    windows.add(info);
                    addedWindows.add(info.token);
                }

                // Remove child/parent references to windows that were not added.
                final int windowCount = windows.size();
                for (int i = 0; i < windowCount; i++) {
+1 −2
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
@@ -574,7 +573,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    /** Corner radius that windows should have in order to match the display. */
    private final float mWindowCornerRadius;

    private final SparseArray<ShellRoot> mShellRoots = new SparseArray<>();
    final SparseArray<ShellRoot> mShellRoots = new SparseArray<>();
    RemoteInsetsControlTarget mRemoteInsetsControlTarget = null;
    private final IBinder.DeathRecipient mRemoteInsetsDeath =
            () -> {
+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ public class DockedStackDividerController {

    void setTouchRegion(Rect touchRegion) {
        mTouchRegion.set(touchRegion);
        // We need to report touchable region changes to accessibility.
        if (mDisplayContent.mWmService.mAccessibilityController != null) {
            mDisplayContent.mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(
                    mDisplayContent.getDisplayId());
        }
    }

    void getTouchRegion(Rect outRegion) {
+24 −0
Original line number Diff line number Diff line
@@ -23,12 +23,14 @@ import static com.android.server.wm.WindowManagerService.MAX_ANIMATION_DURATION;

import android.annotation.NonNull;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.IWindow;
import android.view.SurfaceControl;
import android.view.WindowInfo;
import android.view.animation.Animation;

/**
@@ -102,5 +104,27 @@ public class ShellRoot {
        mToken.startAnimation(mToken.getPendingTransaction(), adapter, false /* hidden */,
                ANIMATION_TYPE_WINDOW_ANIMATION, null /* animationFinishedCallback */);
    }

    WindowInfo getWindowInfo() {
        if (mToken.windowType != TYPE_DOCK_DIVIDER) {
            return null;
        }
        if (!mDisplayContent.getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
            return null;
        }
        WindowInfo windowInfo = WindowInfo.obtain();
        windowInfo.displayId = mToken.getDisplayArea().getDisplayContent().mDisplayId;
        windowInfo.type = mToken.windowType;
        windowInfo.layer = mToken.getWindowLayerFromType();
        windowInfo.token = mClient.asBinder();
        windowInfo.title = "Splitscreen Divider";
        windowInfo.focused = false;
        windowInfo.inPictureInPicture = false;
        windowInfo.hasFlagWatchOutsideTouch = false;
        final Rect regionRect = new Rect();
        mDisplayContent.getDockedDividerController().getTouchRegion(regionRect);
        windowInfo.regionInScreen.set(regionRect);
        return windowInfo;
    }
}