Loading core/java/android/view/InsetsSource.java +4 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,9 @@ public class InsetsSource implements Parcelable { mType = other.mType; mFrame = new Rect(other.mFrame); mVisible = other.mVisible; mVisibleFrame = other.mVisibleFrame != null ? new Rect(other.mVisibleFrame) : null; } public void setFrame(Rect frame) { Loading Loading @@ -165,6 +168,7 @@ public class InsetsSource implements Parcelable { public int hashCode() { int result = mType; result = 31 * result + mFrame.hashCode(); result = 31 * result + (mVisibleFrame != null ? mVisibleFrame.hashCode() : 0); result = 31 * result + (mVisible ? 1 : 0); return result; } Loading core/tests/coretests/src/android/view/InsetsStateTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,7 @@ public class InsetsStateTest { @Test public void testParcelUnparcel() { mState.getSource(ITYPE_IME).setFrame(new Rect(0, 0, 100, 100)); mState.getSource(ITYPE_IME).setVisibleFrame(new Rect(0, 0, 50, 10)); mState.getSource(ITYPE_IME).setVisible(true); mState.getSource(ITYPE_STATUS_BAR).setFrame(new Rect(0, 0, 100, 100)); Parcel p = Parcel.obtain(); Loading @@ -223,6 +224,16 @@ public class InsetsStateTest { assertEquals(mState, mState2); } @Test public void testCopy() { mState.getSource(ITYPE_IME).setFrame(new Rect(0, 0, 100, 100)); mState.getSource(ITYPE_IME).setVisibleFrame(new Rect(0, 0, 50, 10)); mState.getSource(ITYPE_IME).setVisible(true); mState.getSource(ITYPE_STATUS_BAR).setFrame(new Rect(0, 0, 100, 100)); mState2.set(mState, true); assertEquals(mState, mState2); } @Test public void testGetDefaultVisibility() { assertTrue(InsetsState.getDefaultVisibility(ITYPE_STATUS_BAR)); Loading Loading
core/java/android/view/InsetsSource.java +4 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,9 @@ public class InsetsSource implements Parcelable { mType = other.mType; mFrame = new Rect(other.mFrame); mVisible = other.mVisible; mVisibleFrame = other.mVisibleFrame != null ? new Rect(other.mVisibleFrame) : null; } public void setFrame(Rect frame) { Loading Loading @@ -165,6 +168,7 @@ public class InsetsSource implements Parcelable { public int hashCode() { int result = mType; result = 31 * result + mFrame.hashCode(); result = 31 * result + (mVisibleFrame != null ? mVisibleFrame.hashCode() : 0); result = 31 * result + (mVisible ? 1 : 0); return result; } Loading
core/tests/coretests/src/android/view/InsetsStateTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,7 @@ public class InsetsStateTest { @Test public void testParcelUnparcel() { mState.getSource(ITYPE_IME).setFrame(new Rect(0, 0, 100, 100)); mState.getSource(ITYPE_IME).setVisibleFrame(new Rect(0, 0, 50, 10)); mState.getSource(ITYPE_IME).setVisible(true); mState.getSource(ITYPE_STATUS_BAR).setFrame(new Rect(0, 0, 100, 100)); Parcel p = Parcel.obtain(); Loading @@ -223,6 +224,16 @@ public class InsetsStateTest { assertEquals(mState, mState2); } @Test public void testCopy() { mState.getSource(ITYPE_IME).setFrame(new Rect(0, 0, 100, 100)); mState.getSource(ITYPE_IME).setVisibleFrame(new Rect(0, 0, 50, 10)); mState.getSource(ITYPE_IME).setVisible(true); mState.getSource(ITYPE_STATUS_BAR).setFrame(new Rect(0, 0, 100, 100)); mState2.set(mState, true); assertEquals(mState, mState2); } @Test public void testGetDefaultVisibility() { assertTrue(InsetsState.getDefaultVisibility(ITYPE_STATUS_BAR)); Loading