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

Commit ea957827 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix RuntimeException in GestureDetector for Letterbox." into sc-v2-dev am: 8ad71b17

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

Change-Id: Ie56f97465779a95b60008d0e6a1a6356a07f265a
parents 5b8c2a6f 8ad71b17
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -247,7 +247,8 @@ public class Letterbox {
        TapEventReceiver(InputChannel inputChannel, Context context) {
        TapEventReceiver(InputChannel inputChannel, Context context) {
            super(inputChannel, UiThread.getHandler().getLooper());
            super(inputChannel, UiThread.getHandler().getLooper());
            mDoubleTapListener = new DoubleTapListener();
            mDoubleTapListener = new DoubleTapListener();
            mDoubleTapDetector = new GestureDetector(context, mDoubleTapListener);
            mDoubleTapDetector = new GestureDetector(
                    context, mDoubleTapListener, UiThread.getHandler());
        }
        }


        @Override
        @Override
+0 −4
Original line number Original line Diff line number Diff line
@@ -1171,7 +1171,6 @@ public class SizeCompatTests extends WindowTestsBase {
        final WindowState w = addWindowToActivity(mActivity);
        final WindowState w = addWindowToActivity(mActivity);
        // Compute the frames of the window and invoke {@link ActivityRecord#layoutLetterbox}.
        // Compute the frames of the window and invoke {@link ActivityRecord#layoutLetterbox}.
        mActivity.mRootWindowContainer.performSurfacePlacement();
        mActivity.mRootWindowContainer.performSurfacePlacement();
        mActivity.layoutLetterbox(null);
        // The letterbox insets should be [450, 0 - 250, 0].
        // The letterbox insets should be [450, 0 - 250, 0].
        assertEquals(new Rect(mActivity.getBounds().left, 0, dh - mActivity.getBounds().right, 0),
        assertEquals(new Rect(mActivity.getBounds().left, 0, dh - mActivity.getBounds().right, 0),
                mActivity.getLetterboxInsets());
                mActivity.getLetterboxInsets());
@@ -1833,9 +1832,6 @@ public class SizeCompatTests extends WindowTestsBase {
    }
    }


    private void assertLetterboxSurfacesDrawnBetweenActivityAndParentBounds(Rect parentBounds) {
    private void assertLetterboxSurfacesDrawnBetweenActivityAndParentBounds(Rect parentBounds) {
        // Ensure Letterbox is updated.
        mActivity.layoutLetterbox(null);

        // Letterbox should fill the gap between the parent bounds and the letterboxed activity.
        // Letterbox should fill the gap between the parent bounds and the letterboxed activity.
        final Rect letterboxedBounds = new Rect(mActivity.getBounds());
        final Rect letterboxedBounds = new Rect(mActivity.getBounds());
        assertTrue(parentBounds.contains(letterboxedBounds));
        assertTrue(parentBounds.contains(letterboxedBounds));