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

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

Merge "Enable ENABLE_PIP_KEEP_CLEAR_ALGORITHM for teamfood" into tm-qpr-dev...

Merge "Enable ENABLE_PIP_KEEP_CLEAR_ALGORITHM for teamfood" into tm-qpr-dev am: 47614ae1 am: d262ca6c am: 5cd53a99

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



Change-Id: If8d80f2874541a7a2bd9a06b298b854559f84cdf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 51145636 5cd53a99
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -124,7 +124,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
            SystemProperties.getLong("persist.wm.debug.pip_keep_clear_areas_delay", 200);
            SystemProperties.getLong("persist.wm.debug.pip_keep_clear_areas_delay", 200);


    private boolean mEnablePipKeepClearAlgorithm =
    private boolean mEnablePipKeepClearAlgorithm =
            SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", false);
            SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", true);


    @VisibleForTesting
    @VisibleForTesting
    void setEnablePipKeepClearAlgorithm(boolean value) {
    void setEnablePipKeepClearAlgorithm(boolean value) {
+8 −3
Original line number Original line Diff line number Diff line
@@ -71,8 +71,13 @@ public class PipTouchHandler {
    private static final String TAG = "PipTouchHandler";
    private static final String TAG = "PipTouchHandler";
    private static final float DEFAULT_STASH_VELOCITY_THRESHOLD = 18000.f;
    private static final float DEFAULT_STASH_VELOCITY_THRESHOLD = 18000.f;


    private static final boolean ENABLE_PIP_KEEP_CLEAR_ALGORITHM =
    private boolean mEnablePipKeepClearAlgorithm =
            SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", false);
            SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", true);

    @VisibleForTesting
    void setEnablePipKeepClearAlgorithm(boolean value) {
        mEnablePipKeepClearAlgorithm = value;
    }


    // Allow PIP to resize to a slightly bigger state upon touch
    // Allow PIP to resize to a slightly bigger state upon touch
    private boolean mEnableResize;
    private boolean mEnableResize;
@@ -427,7 +432,7 @@ public class PipTouchHandler {
            if (mTouchState.isUserInteracting() && mTouchState.isDragging()) {
            if (mTouchState.isUserInteracting() && mTouchState.isDragging()) {
                // Defer the update of the current movement bounds until after the user finishes
                // Defer the update of the current movement bounds until after the user finishes
                // touching the screen
                // touching the screen
            } else if (ENABLE_PIP_KEEP_CLEAR_ALGORITHM) {
            } else if (mEnablePipKeepClearAlgorithm) {
                // Ignore moving PiP if keep clear algorithm is enabled, since IME and shelf height
                // Ignore moving PiP if keep clear algorithm is enabled, since IME and shelf height
                // now are accounted for in the keep clear algorithm calculations
                // now are accounted for in the keep clear algorithm calculations
            } else {
            } else {
+1 −0
Original line number Original line Diff line number Diff line
@@ -318,6 +318,7 @@ public class PipControllerTest extends ShellTestCase {


    @Test
    @Test
    public void onKeepClearAreasChanged_featureDisabled_pipBoundsStateDoesntChange() {
    public void onKeepClearAreasChanged_featureDisabled_pipBoundsStateDoesntChange() {
        mPipController.setEnablePipKeepClearAlgorithm(false);
        final int displayId = 1;
        final int displayId = 1;
        final Rect keepClearArea = new Rect(0, 0, 10, 10);
        final Rect keepClearArea = new Rect(0, 0, 10, 10);
        when(mMockPipDisplayLayoutState.getDisplayId()).thenReturn(displayId);
        when(mMockPipDisplayLayoutState.getDisplayId()).thenReturn(displayId);
+1 −0
Original line number Original line Diff line number Diff line
@@ -175,6 +175,7 @@ public class PipTouchHandlerTest extends ShellTestCase {


    @Test
    @Test
    public void updateMovementBounds_withImeAdjustment_movesPip() {
    public void updateMovementBounds_withImeAdjustment_movesPip() {
        mPipTouchHandler.setEnablePipKeepClearAlgorithm(false);
        mFromImeAdjustment = true;
        mFromImeAdjustment = true;
        mPipTouchHandler.onImeVisibilityChanged(true /* imeVisible */, mImeHeight);
        mPipTouchHandler.onImeVisibilityChanged(true /* imeVisible */, mImeHeight);


+1 −1
Original line number Original line Diff line number Diff line
@@ -470,7 +470,7 @@ object Flags {
        sysPropBooleanFlag(
        sysPropBooleanFlag(
            1110,
            1110,
            "persist.wm.debug.enable_pip_keep_clear_algorithm",
            "persist.wm.debug.enable_pip_keep_clear_algorithm",
            default = false
            default = true
        )
        )


    // TODO(b/256873975): Tracking Bug
    // TODO(b/256873975): Tracking Bug