History log of /frameworks/base/core/tests/utiltests/src/android/util/IntArrayTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
112962a6b09310c58093b9a8af341cbeaa612a48 27-Mar-2017 Hugo Benichi <hugobenichi@google.com> Improve utility of IntArray and LongArray

This patch adds several utility methods to IntArray and LongArray to
make them more useful in the context of a Parcelable class.

More specifically, it is now possible to parcel and unparcel a
{Int, Long}Array with the following one liners:
- mIntArray = IntArray.wrap(parcel.createIntArray());
- parcel.writeIntArray(mIntArray.toArray());

This patch also
- adds unit tests for IntArray and LongArray.
- adds a method for setting a field at a given index.
- adds a method for changing the effective array length.
- adds missing bound checks for negative index values.

Test: added test coverage
Bug: 34901696
Change-Id: Ia0febf4dae048b0a45c75310b5d90b56499320da
/frameworks/base/core/tests/utiltests/src/android/util/IntArrayTest.java