Home
last modified time | relevance | path

Searched refs:sparseArray (Results 1 – 7 of 7) sorted by relevance

/packages/apps/TV/tests/robotests/src/com/android/tv/util/
DMultiLongSparseArrayTest.java34 MultiLongSparseArray<String> sparseArray = new MultiLongSparseArray<>(); in testEmpty() local
35 assertThat(sparseArray.get(0)).isEmpty(); in testEmpty()
40 MultiLongSparseArray<String> sparseArray = new MultiLongSparseArray<>(); in testOneElement() local
41 sparseArray.put(0, "foo"); in testOneElement()
42 assertThat(sparseArray.get(0)).containsExactly("foo"); in testOneElement()
47 MultiLongSparseArray<String> sparseArray = new MultiLongSparseArray<>(); in testTwoElements() local
48 sparseArray.put(0, "foo"); in testTwoElements()
49 sparseArray.put(0, "bar"); in testTwoElements()
50 assertThat(sparseArray.get(0)).containsExactly("foo", "bar"); in testTwoElements()
55 MultiLongSparseArray<String> sparseArray = new MultiLongSparseArray<>(); in testClearEmptyCache() local
[all …]
/packages/modules/AppSearch/testing/safeparceltests/src/android/app/appsearch/safeparcel/
DSafeParcelableSparseArrayTest.java50 SparseArray<Bundle> sparseArray = new SparseArray<>(keys.length); in newBundleSparseArray() local
52 sparseArray.put(keys[i], newTestBundle(keys[i])); in newBundleSparseArray()
54 return sparseArray; in newBundleSparseArray()
60 SparseArray<byte[]> sparseArray = new SparseArray<>(); in testReadWriteBytesSparseArray() local
61 sparseArray.append(20, new byte[] {1}); in testReadWriteBytesSparseArray()
62 sparseArray.append(200, new byte[] {2}); in testReadWriteBytesSparseArray()
65 mParcel, TEST_ID, sparseArray, /* writeNull= */ false); in testReadWriteBytesSparseArray()
71 assertByteArrayEquals(sparseArray, readSparseArray); in testReadWriteBytesSparseArray()
78 SparseArray<Bundle> sparseArray = newBundleSparseArray(keys); in testReadWriteBundleSparseArray() local
81 mParcel, TEST_ID, sparseArray, /* writeNull= */ false); in testReadWriteBundleSparseArray()
[all …]
/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/
DCollectionUtilsTest.kt186 val sparseArray = SparseArray<String>(); in testGetIndexForValue() constant
187 sparseArray.put(5, "hello"); in testGetIndexForValue()
188 sparseArray.put(10, "abcd"); in testGetIndexForValue()
189 sparseArray.put(20, null); in testGetIndexForValue()
195 assertEquals(1, CollectionUtils.getIndexForValue(sparseArray, value1)); in testGetIndexForValue()
196 assertEquals(1, CollectionUtils.getIndexForValue(sparseArray, value1Copy)); in testGetIndexForValue()
197 assertEquals(2, CollectionUtils.getIndexForValue(sparseArray, value2)); in testGetIndexForValue()
/packages/modules/AppSearch/testing/coretests/src/android/app/appsearch/external/util/
DBundleUtilTest.java269 SparseArray<Parcelable> sparseArray = new SparseArray<>(); in createThoroughBundle() local
270 sparseArray.put(24, toy1); in createThoroughBundle()
271 sparseArray.put(1025, toy2); in createThoroughBundle()
272 b.putSparseParcelableArray("sparceParcelableArray", sparseArray); in createThoroughBundle()
/packages/modules/Connectivity/staticlibs/framework/com/android/net/module/util/
DCollectionUtils.java403 public static <T> int getIndexForValue(SparseArray<T> sparseArray, T value) { in getIndexForValue() argument
404 for(int i = 0, nsize = sparseArray.size(); i < nsize; i++) { in getIndexForValue()
405 T valueAt = sparseArray.valueAt(i); in getIndexForValue()
/packages/apps/Launcher3/src/com/android/launcher3/widget/picker/
DWidgetsFullSheet.java686 public void saveHierarchyState(SparseArray<Parcelable> sparseArray) { in saveHierarchyState() argument
696 sparseArray.put(0, bundle); in saveHierarchyState()
700 public void restoreHierarchyState(SparseArray<Parcelable> sparseArray) { in restoreHierarchyState() argument
701 Bundle state = (Bundle) sparseArray.get(0); in restoreHierarchyState()
/packages/apps/Launcher3/src/com/android/launcher3/allapps/
DActivityAllAppsContainerView.java940 protected void dispatchRestoreInstanceState(SparseArray<Parcelable> sparseArray) { in dispatchRestoreInstanceState() argument
946 super.dispatchRestoreInstanceState(sparseArray); in dispatchRestoreInstanceState()
951 Bundle state = (Bundle) sparseArray.get(R.id.work_tab_state_id, null); in dispatchRestoreInstanceState()