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

Commit 5dd54af2 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Automerger Merge Worker
Browse files

Merge "Fix usage of temporary restricted keep clear area for hotseat" into...

Merge "Fix usage of temporary restricted keep clear area for hotseat" into udc-qpr-dev am: 5b5df31e am: 84583371

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24235063



Change-Id: Ia1716e7b40d9d2008475de6c54e63f88a879e6f1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2fb1dcfb 84583371
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);