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

Commit 8058a411 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Guard against assumption of display areas when offset is requested" into main

parents fcec28aa 35481742
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -335,6 +335,9 @@ public class OneHandedDisplayAreaOrganizer extends DisplayAreaOrganizer {
    }

    void beginCUJTracing(@CujType int cujType, @Nullable String tag) {
        if (getDisplayAreaTokenMap().isEmpty()) {
            return;
        }
        final Map.Entry<WindowContainerToken, SurfaceControl> firstEntry =
                getDisplayAreaTokenMap().entrySet().iterator().next();
        final InteractionJankMonitor.Configuration.Builder builder =
+10 −0
Original line number Diff line number Diff line
@@ -190,6 +190,16 @@ public class OneHandedDisplayAreaOrganizerTest extends OneHandedTestCase {
                any());
    }

    @Test
    public void testScheduleOffsetWithoutDisplayArea() {
        mDisplayAreaAppearedInfoList.forEach(
                (info) -> mSpiedDisplayAreaOrganizer.onDisplayAreaVanished(
                        info.getDisplayAreaInfo()));

        // Schedule offset and ensure this doesn't throw
        mSpiedDisplayAreaOrganizer.scheduleOffset(0, 0);
    }

    @Test
    public void testRotation_portrait_0_to_landscape_90() {
        when(mMockLeash.isValid()).thenReturn(false);