Home
last modified time | relevance | path

Searched refs:array (Results 1 – 25 of 867) sorted by relevance

12345678910>>...35

/frameworks/base/core/java/com/android/internal/util/
DGrowingArrayUtils.java44 public static <T> T[] append(T[] array, int currentSize, T element) { in append() argument
45 assert currentSize <= array.length; in append()
47 if (currentSize + 1 > array.length) { in append()
50 (Class<T>) array.getClass().getComponentType(), growSize(currentSize)); in append()
51 System.arraycopy(array, 0, newArray, 0, currentSize); in append()
52 array = newArray; in append()
54 array[currentSize] = element; in append()
55 return array; in append()
62 public static int[] append(int[] array, int currentSize, int element) { in append() argument
63 assert currentSize <= array.length; in append()
[all …]
DHexDump.java27 public static String dumpHexString(@Nullable byte[] array) { in dumpHexString() argument
28 if (array == null) return "(null)"; in dumpHexString()
29 return dumpHexString(array, 0, array.length); in dumpHexString()
32 public static String dumpHexString(@Nullable byte[] array, int offset, int length) in dumpHexString() argument
34 if (array == null) return "(null)"; in dumpHexString()
66 byte b = array[i]; in dumpHexString()
105 public static String toHexString(byte[] array) in toHexString() argument
107 return toHexString(array, 0, array.length, true); in toHexString()
111 public static String toHexString(byte[] array, boolean upperCase) in toHexString() argument
113 return toHexString(array, 0, array.length, upperCase); in toHexString()
[all …]
DArrayUtils.java150 public static boolean isEmpty(@Nullable Collection<?> array) { in isEmpty() argument
151 return array == null || array.isEmpty(); in isEmpty()
165 public static <T> boolean isEmpty(@Nullable T[] array) { in isEmpty() argument
166 return array == null || array.length == 0; in isEmpty()
172 public static boolean isEmpty(@Nullable int[] array) { in isEmpty() argument
173 return array == null || array.length == 0; in isEmpty()
179 public static boolean isEmpty(@Nullable long[] array) { in isEmpty() argument
180 return array == null || array.length == 0; in isEmpty()
186 public static boolean isEmpty(@Nullable byte[] array) { in isEmpty() argument
187 return array == null || array.length == 0; in isEmpty()
[all …]
/frameworks/base/core/tests/utiltests/src/android/util/
DMemoryIntArrayTest.java49 MemoryIntArray array = null; in testSize() local
51 array = new MemoryIntArray(3); in testSize()
52 assertEquals("size must be three", 3, array.size()); in testSize()
54 IoUtils.closeQuietly(array); in testSize()
60 MemoryIntArray array = null; in testGetSet() local
62 array = new MemoryIntArray(3); in testGetSet()
64 array.set(0, 1); in testGetSet()
65 array.set(1, 2); in testGetSet()
66 array.set(2, 3); in testGetSet()
68 assertEquals("First element should be 1", 1, array.get(0)); in testGetSet()
[all …]
/frameworks/base/telephony/common/com/android/internal/telephony/util/
DArrayUtils.java40 public static <T> T[] appendElement(Class<T> kind, @Nullable T[] array, T element) { in appendElement() argument
41 return appendElement(kind, array, element, false); in appendElement()
55 public static <T> T[] appendElement(Class<T> kind, @Nullable T[] array, T element, in appendElement() argument
59 if (array != null) { in appendElement()
60 if (!allowDuplicates && contains(array, element)) return array; in appendElement()
61 end = array.length; in appendElement()
63 System.arraycopy(array, 0, result, 0, end); in appendElement()
133 public static boolean contains(@Nullable char[] array, char value) { in contains() argument
134 if (array == null) return false; in contains()
135 for (char element : array) { in contains()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/utils/
DWatcherTest.java195 WatchedArrayMap<Integer, Leaf> array = new WatchedArrayMap<>(); in testWatchedArrayMap() local
196 array.put(INDEX_A, leafA); in testWatchedArrayMap()
197 array.put(INDEX_B, leafB); in testWatchedArrayMap()
198 tester = new WatchableTester(array, name); in testWatchedArrayMap()
208 array.remove(INDEX_B); in testWatchedArrayMap()
212 array.put(INDEX_B, leafB); in testWatchedArrayMap()
213 array.put(INDEX_C, leafB); in testWatchedArrayMap()
217 array.remove(INDEX_C); in testWatchedArrayMap()
221 array.remove(INDEX_B); in testWatchedArrayMap()
225 array.clear(); in testWatchedArrayMap()
[all …]
/frameworks/base/core/java/android/os/
DHwBlob.java112 public native final void copyToBoolArray(long offset, boolean[] array, int size); in copyToBoolArray() argument
123 public native final void copyToInt8Array(long offset, byte[] array, int size); in copyToInt8Array() argument
134 public native final void copyToInt16Array(long offset, short[] array, int size); in copyToInt16Array() argument
145 public native final void copyToInt32Array(long offset, int[] array, int size); in copyToInt32Array() argument
156 public native final void copyToInt64Array(long offset, long[] array, int size); in copyToInt64Array() argument
167 public native final void copyToFloatArray(long offset, float[] array, int size); in copyToFloatArray() argument
178 public native final void copyToDoubleArray(long offset, double[] array, int size); in copyToDoubleArray() argument
345 public static Boolean[] wrapArray(@NonNull boolean[] array) { in wrapArray() argument
346 final int n = array.length; in wrapArray()
349 wrappedArray[i] = array[i]; in wrapArray()
[all …]
DHwParcel.java210 boolean[] array = new boolean[n]; in writeBoolVector()
212 array[i] = val.get(i); in writeBoolVector()
215 writeBoolVector(array); in writeBoolVector()
224 byte[] array = new byte[n]; in writeInt8Vector()
226 array[i] = val.get(i); in writeInt8Vector()
229 writeInt8Vector(array); in writeInt8Vector()
238 short[] array = new short[n]; in writeInt16Vector() local
240 array[i] = val.get(i); in writeInt16Vector()
243 writeInt16Vector(array); in writeInt16Vector()
252 int[] array = new int[n]; in writeInt32Vector() local
[all …]
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/
DByteArrayHelpers.java40 public static byte[] toByteArray(byte[] array) { in toByteArray() argument
41 return array; in toByteArray()
50 public static byte[] toByteArray(short[] array) { in toByteArray() argument
51 return toByteArray(array, Short.SIZE); in toByteArray()
60 public static byte[] toByteArray(char[] array) { in toByteArray() argument
61 return toByteArray(array, Character.SIZE); in toByteArray()
69 public static byte[] toByteArray(int[] array) { in toByteArray() argument
70 return toByteArray(array, Integer.SIZE); in toByteArray()
78 public static byte[] toByteArray(long[] array) { in toByteArray() argument
79 return toByteArray(array, Long.SIZE); in toByteArray()
[all …]
/frameworks/libs/net/common/device/com/android/net/module/util/
DHexDump.java35 public static String dumpHexString(@Nullable byte[] array) { in dumpHexString() argument
36 if (array == null) return "(null)"; in dumpHexString()
37 return dumpHexString(array, 0, array.length); in dumpHexString()
47 public static String dumpHexString(@Nullable byte[] array, int offset, int length) { in dumpHexString() argument
48 if (array == null) return "(null)"; in dumpHexString()
74 byte b = array[i]; in dumpHexString()
115 public static String toHexString(byte[] array) { in toHexString() argument
116 return toHexString(array, 0, array.length, true); in toHexString()
125 public static String toHexString(byte[] array, boolean upperCase) { in toHexString() argument
126 return toHexString(array, 0, array.length, upperCase); in toHexString()
[all …]
/frameworks/base/services/core/java/com/android/server/biometrics/
DHardwareAuthTokenUtils.java32 final byte[] array = new byte[69]; in toByteArray()
35 array[0] = 0; in toByteArray()
38 writeLong(hat.challenge, array, 1 /* offset */); in toByteArray()
41 writeLong(hat.userId, array, 9 /* offset */); in toByteArray()
44 writeLong(hat.authenticatorId, array, 17 /* offset */); in toByteArray()
47 writeInt(flipIfNativelyLittle(hat.authenticatorType), array, 25 /* offset */); in toByteArray() local
50 writeLong(flipIfNativelyLittle(hat.timestamp.milliSeconds), array, 29 /* offset */); in toByteArray() local
53 System.arraycopy(hat.mac, 0 /* srcPos */, array, 37 /* destPos */, hat.mac.length); in toByteArray()
55 return array; in toByteArray()
58 public static HardwareAuthToken toHardwareAuthToken(byte[] array) { in toHardwareAuthToken() argument
[all …]
/frameworks/base/keystore/java/android/security/keystore/
DArrayUtils.java29 public static String[] nullToEmpty(String[] array) { in nullToEmpty() argument
30 return (array != null) ? array : EmptyArray.STRING; in nullToEmpty()
33 public static String[] cloneIfNotEmpty(String[] array) { in cloneIfNotEmpty() argument
34 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty()
41 public static int[] cloneIfNotEmpty(int[] array) { in cloneIfNotEmpty() argument
42 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty()
45 public static byte[] cloneIfNotEmpty(byte[] array) { in cloneIfNotEmpty() argument
46 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty()
127 public static void forEach(int[] array, Consumer<Integer> consumer) { in forEach() argument
128 for (int i : array) { in forEach()
/frameworks/libs/net/common/framework/com/android/net/module/util/
DCollectionUtils.java38 public static <T> boolean isEmpty(@Nullable T[] array) { in isEmpty() argument
39 return array == null || array.length == 0; in isEmpty()
54 int[] array = new int[list.size()]; in toIntArray() local
57 array[i] = item; in toIntArray()
60 return array; in toIntArray()
68 long[] array = new long[list.size()]; in toLongArray() local
71 array[i] = item; in toLongArray()
74 return array; in toLongArray()
114 public static <T> boolean any(@NonNull SparseArray<T> array, @NonNull Predicate<T> predicate) { in any() argument
115 for (int i = 0; i < array.size(); ++i) { in any()
[all …]
DNetUtils.java78 byte[] array = address.getAddress(); in getNetworkPart()
79 maskRawAddress(array, prefixLength); in getNetworkPart()
83 netPart = InetAddress.getByAddress(array); in getNetworkPart()
93 public static void maskRawAddress(byte[] array, int prefixLength) { in maskRawAddress() argument
94 if (prefixLength < 0 || prefixLength > array.length * 8) { in maskRawAddress()
95 throw new RuntimeException("IP address with " + array.length in maskRawAddress()
103 if (offset < array.length) array[offset] = (byte) (array[offset] & mask); in maskRawAddress()
107 for (; offset < array.length; offset++) { in maskRawAddress()
108 array[offset] = 0; in maskRawAddress()
/frameworks/native/opengl/tools/glgen/stubs/gles11/
Dcommon.cpp47 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) in getPointer() argument
57 *array = nullptr; in getPointer()
62 *array = jniGetNioBufferBaseArray(_env, buffer); in getPointer()
69 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { in Get() argument
70 return _env->GetByteArrayElements(array, is_copy); in Get()
75 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { in Get() argument
76 return _env->GetBooleanArrayElements(array, is_copy); in Get()
81 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { in Get() argument
82 return _env->GetCharArrayElements(array, is_copy); in Get()
87 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { in Get() argument
[all …]
/frameworks/base/core/tests/coretests/src/android/util/
DLongSparseLongArrayTest.java36 final LongSparseLongArray array = new LongSparseLongArray(5); in testSimplePut() local
39 array.put(value, value); in testSimplePut()
43 assertEquals(value, array.get(value, -1)); in testSimplePut()
44 assertEquals(-1, array.get(-value, -1)); in testSimplePut()
49 final LongSparseLongArray array = new LongSparseLongArray(5); in testSimplePutBackwards() local
52 array.put(value, value); in testSimplePutBackwards()
56 assertEquals(value, array.get(value, -1)); in testSimplePutBackwards()
57 assertEquals(-1, array.get(-value, -1)); in testSimplePutBackwards()
62 final LongSparseLongArray array = new LongSparseLongArray(5); in testMiddleInsert() local
65 array.put(value, value); in testMiddleInsert()
[all …]
/frameworks/base/core/java/android/hardware/camera2/utils/
DHashCodeHelpers.java37 public static int hashCode(int... array) { in hashCode() argument
38 if (array == null) { in hashCode()
50 for (int x : array) { in hashCode()
67 public static int hashCode(float... array) { in hashCode() argument
68 if (array == null) { in hashCode()
73 for (float f : array) { in hashCode()
90 public static <T> int hashCodeGeneric(T... array) { in hashCodeGeneric() argument
91 if (array == null) { in hashCodeGeneric()
96 for (T o : array) { in hashCodeGeneric()
DArrayUtils.java34 public static <T> int getArrayIndex(T[] array, T needle) { in getArrayIndex() argument
35 if (array == null) { in getArrayIndex()
40 for (T elem : array) { in getArrayIndex()
51 public static int getArrayIndex(int[] array, int needle) { in getArrayIndex() argument
52 if (array == null) { in getArrayIndex()
55 for (int i = 0; i < array.length; ++i) { in getArrayIndex()
56 if (array[i] == needle) { in getArrayIndex()
166 public static boolean contains(int[] array, int elem) { in contains() argument
167 return getArrayIndex(array, elem) != -1; in contains()
177 public static <T> boolean contains(T[] array, T elem) { in contains() argument
[all …]
/frameworks/base/core/java/android/util/
DArraySet.java187 final Object[] array = sTwiceBaseCache; in allocArrays() local
189 mArray = array; in allocArrays()
190 sTwiceBaseCache = (Object[]) array[0]; in allocArrays()
191 mHashes = (int[]) array[1]; in allocArrays()
193 array[0] = array[1] = null; in allocArrays()
205 Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] in allocArrays()
206 + " [1]=" + array[1]); in allocArrays()
214 final Object[] array = sBaseCache; in allocArrays() local
216 mArray = array; in allocArrays()
217 sBaseCache = (Object[]) array[0]; in allocArrays()
[all …]
/frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/
DArrayMapTests.java121 private static boolean compareMaps(HashMap map, ArrayMap array) { in compareMaps() argument
122 if (map.size() != array.size()) { in compareMaps()
123 Log.e("test", "Bad size: expected " + map.size() + ", got " + array.size()); in compareMaps()
130 Object gotValue = array.get(entry.getKey()); in compareMaps()
138 for (int i=0; i<array.size(); i++) { in compareMaps()
139 Object gotValue = array.valueAt(i); in compareMaps()
140 Object key = array.keyAt(i); in compareMaps()
149 if (map.entrySet().hashCode() != array.entrySet().hashCode()) { in compareMaps()
152 + Integer.toHexString(array.entrySet().hashCode())); in compareMaps()
156 if (!map.entrySet().equals(array.entrySet())) { in compareMaps()
[all …]
/frameworks/base/packages/Shell/tests/src/com/android/shell/
DBugreportProgressServiceTest.java93 private static <T> List<T> list(T... array) { in list() argument
94 return Arrays.asList(array); in list()
97 private static <T> T[] array(T... array) { in array() method in BugreportProgressServiceTest
98 return array; in array()
119 array()); in findSendToAccount_noWorkProfile()
128 array(account("abc@gmail.com"))); in findSendToAccount_noWorkProfile()
139 array(account("abc@gmail.com"), account("def@gmail.com"))); in findSendToAccount_noWorkProfile()
150 array(account("abc@gmail.com"), account("def@android.com"))); in findSendToAccount_noWorkProfile()
161 array(account("notemail"), account("abc@gmail.com"), account("def@android.com"))); in findSendToAccount_noWorkProfile()
182 array()); in findSendToAccount_withWorkProfile_noAccounts()
[all …]
/frameworks/base/core/java/android/bluetooth/le/
DBluetoothLeUtils.java38 static String toString(SparseArray<byte[]> array) { in toString() argument
39 if (array == null) { in toString()
42 if (array.size() == 0) { in toString()
47 for (int i = 0; i < array.size(); ++i) { in toString()
48 buffer.append(array.keyAt(i)).append("=").append(Arrays.toString(array.valueAt(i))); in toString()
82 static boolean equals(SparseArray<byte[]> array, SparseArray<byte[]> otherArray) { in equals() argument
83 if (array == otherArray) { in equals()
86 if (array == null || otherArray == null) { in equals()
89 if (array.size() != otherArray.size()) { in equals()
94 for (int i = 0; i < array.size(); ++i) { in equals()
[all …]
/frameworks/base/core/jni/
Dandroid_opengl_GLES10Ext.cpp72 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) in getPointer() argument
82 *array = nullptr; in getPointer()
87 *array = jniGetNioBufferBaseArray(_env, buffer); in getPointer()
94 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { in Get() argument
95 return _env->GetByteArrayElements(array, is_copy); in Get()
100 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { in Get() argument
101 return _env->GetBooleanArrayElements(array, is_copy); in Get()
106 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { in Get() argument
107 return _env->GetCharArrayElements(array, is_copy); in Get()
112 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { in Get() argument
[all …]
/frameworks/base/graphics/java/android/graphics/
DColorMatrixColorFilter.java52 public ColorMatrixColorFilter(@NonNull float[] array) { in ColorMatrixColorFilter() argument
53 if (array.length < 20) { in ColorMatrixColorFilter()
56 mMatrix.set(array); in ColorMatrixColorFilter()
112 public void setColorMatrixArray(@Nullable float[] array) { in setColorMatrixArray() argument
115 if (array == null) { in setColorMatrixArray()
118 if (array.length < 20) { in setColorMatrixArray()
121 mMatrix.set(array); in setColorMatrixArray()
130 private static native long nativeColorMatrixFilter(float[] array); in nativeColorMatrixFilter() argument
/frameworks/base/core/java/com/android/internal/app/procstats/
DSparseMappingTable.java132 long[] array = list.get(whichArray); in getOrAddKey() local
133 if (mParent.mNextIndex + count > array.length) { in getOrAddKey()
135 array = new long[ARRAY_SIZE]; in getOrAddKey()
136 list.add(array); in getOrAddKey()
196 final long[] array = mParent.mLongs.get(getArrayFromKey(key)); in getValue() local
197 return array[getIndexFromKey(key) + index]; in getValue()
230 final long[] array = mParent.mLongs.get(getArrayFromKey(key)); in getValueForId() local
231 return array[getIndexFromKey(key) + index]; in getValueForId()
282 final long[] array = mParent.mLongs.get(getArrayFromKey(key)); in setValue() local
283 array[getIndexFromKey(key) + index] = value; in setValue()
[all …]

12345678910>>...35