Loading core/java/android/view/InsetsSource.java +5 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,11 @@ public class InsetsSource implements Parcelable { if (getType() == ITYPE_CAPTION_BAR) { return Insets.of(0, frame.height(), 0, 0); } if (!getIntersection(frame, relativeFrame, mTmpFrame)) { // Checks for whether there is shared edge with insets for 0-width/height window. final boolean hasIntersection = relativeFrame.isEmpty() ? getIntersection(frame, relativeFrame, mTmpFrame) : mTmpFrame.setIntersect(frame, relativeFrame); if (!hasIntersection) { return Insets.NONE; } Loading core/tests/coretests/src/android/view/InsetsSourceTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,13 @@ public class InsetsSourceTest { assertEquals(Insets.NONE, insets); } @Test public void testCalculateInsetsForIme_noIntersection_horizontal() { mImeSource.setFrame(new Rect(0, 0, 100, 500)); Insets insets = mImeSource.calculateInsets(new Rect(100, 0, 500, 500), false); assertEquals(Insets.NONE, insets); } @Test public void testCalculateInsets_zeroWidthIntersection_horizontal_start() { mSource.setFrame(new Rect(0, 0, 100, 500)); Loading Loading
core/java/android/view/InsetsSource.java +5 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,11 @@ public class InsetsSource implements Parcelable { if (getType() == ITYPE_CAPTION_BAR) { return Insets.of(0, frame.height(), 0, 0); } if (!getIntersection(frame, relativeFrame, mTmpFrame)) { // Checks for whether there is shared edge with insets for 0-width/height window. final boolean hasIntersection = relativeFrame.isEmpty() ? getIntersection(frame, relativeFrame, mTmpFrame) : mTmpFrame.setIntersect(frame, relativeFrame); if (!hasIntersection) { return Insets.NONE; } Loading
core/tests/coretests/src/android/view/InsetsSourceTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,13 @@ public class InsetsSourceTest { assertEquals(Insets.NONE, insets); } @Test public void testCalculateInsetsForIme_noIntersection_horizontal() { mImeSource.setFrame(new Rect(0, 0, 100, 500)); Insets insets = mImeSource.calculateInsets(new Rect(100, 0, 500, 500), false); assertEquals(Insets.NONE, insets); } @Test public void testCalculateInsets_zeroWidthIntersection_horizontal_start() { mSource.setFrame(new Rect(0, 0, 100, 500)); Loading