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

Commit 5b5df31e authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Android (Google) Code Review
Browse files

Merge "Fix usage of temporary restricted keep clear area for hotseat" into udc-qpr-dev

parents d5070970 f8771729
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -352,6 +352,10 @@ public class PipController implements PipTransitionController.PipTransitionCallb
                            mMainExecutor.executeDelayed(
                                    mMovePipInResponseToKeepClearAreasChangeCallback,
                                    PIP_KEEP_CLEAR_AREAS_DELAY);

                            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                                    "onKeepClearAreasChanged: restricted=%s, unrestricted=%s",
                                    restricted, unrestricted);
                        }
                    }
                }
@@ -950,6 +954,8 @@ public class PipController implements PipTransitionController.PipTransitionCallb
    }

    private void setLauncherKeepClearAreaHeight(boolean visible, int height) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "setLauncherKeepClearAreaHeight: visible=%b, height=%d", visible, height);
        if (visible) {
            Rect rect = new Rect(
                    0, mPipBoundsState.getDisplayBounds().bottom - height,
@@ -1007,9 +1013,10 @@ public class PipController implements PipTransitionController.PipTransitionCallb
            int launcherRotation, Rect hotseatKeepClearArea) {

        if (mEnablePipKeepClearAlgorithm) {
            // pre-emptively add the keep clear area for Hotseat, so that it is taken into account
            // preemptively add the keep clear area for Hotseat, so that it is taken into account
            // when calculating the entry destination bounds of PiP window
            mPipBoundsState.getRestrictedKeepClearAreas().add(hotseatKeepClearArea);
            mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG,
                    hotseatKeepClearArea);
        } else {
            int shelfHeight = hotseatKeepClearArea.height();
            setShelfHeightLocked(shelfHeight > 0 /* visible */, shelfHeight);