/frameworks/base/core/java/com/android/internal/util/ |
D | GrowingArrayUtils.java | 43 public static <T> T[] append(T[] array, int currentSize, T element) { in append() argument 44 assert currentSize <= array.length; in append() 46 if (currentSize + 1 > array.length) { in append() 49 (Class<T>) array.getClass().getComponentType(), growSize(currentSize)); in append() 50 System.arraycopy(array, 0, newArray, 0, currentSize); in append() 51 array = newArray; in append() 53 array[currentSize] = element; in append() 54 return array; in append() 61 public static int[] append(int[] array, int currentSize, int element) { in append() argument 62 assert currentSize <= array.length; in append() [all …]
|
D | ArrayUtils.java | 141 public static boolean isEmpty(@Nullable Collection<?> array) { in isEmpty() argument 142 return array == null || array.isEmpty(); in isEmpty() 156 public static <T> boolean isEmpty(@Nullable T[] array) { in isEmpty() argument 157 return array == null || array.length == 0; in isEmpty() 163 public static boolean isEmpty(@Nullable int[] array) { in isEmpty() argument 164 return array == null || array.length == 0; in isEmpty() 170 public static boolean isEmpty(@Nullable long[] array) { in isEmpty() argument 171 return array == null || array.length == 0; in isEmpty() 177 public static boolean isEmpty(@Nullable byte[] array) { in isEmpty() argument 178 return array == null || array.length == 0; in isEmpty() [all …]
|
D | HexDump.java | 27 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 …]
|
/frameworks/base/core/tests/utiltests/src/android/util/ |
D | MemoryIntArrayTest.java | 49 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/ |
D | ArrayUtils.java | 40 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/core/java/android/os/ |
D | HwBlob.java | 114 public native final void copyToBoolArray(long offset, boolean[] array, int size); in copyToBoolArray() argument 125 public native final void copyToInt8Array(long offset, byte[] array, int size); in copyToInt8Array() argument 136 public native final void copyToInt16Array(long offset, short[] array, int size); in copyToInt16Array() argument 147 public native final void copyToInt32Array(long offset, int[] array, int size); in copyToInt32Array() argument 158 public native final void copyToInt64Array(long offset, long[] array, int size); in copyToInt64Array() argument 169 public native final void copyToFloatArray(long offset, float[] array, int size); in copyToFloatArray() argument 180 public native final void copyToDoubleArray(long offset, double[] array, int size); in copyToDoubleArray() argument 347 public static Boolean[] wrapArray(@NonNull boolean[] array) { in wrapArray() argument 348 final int n = array.length; in wrapArray() 351 wrappedArray[i] = array[i]; in wrapArray() [all …]
|
D | HwParcel.java | 211 boolean[] array = new boolean[n]; in writeBoolVector() 213 array[i] = val.get(i); in writeBoolVector() 216 writeBoolVector(array); in writeBoolVector() 225 byte[] array = new byte[n]; in writeInt8Vector() 227 array[i] = val.get(i); in writeInt8Vector() 230 writeInt8Vector(array); in writeInt8Vector() 239 short[] array = new short[n]; in writeInt16Vector() local 241 array[i] = val.get(i); in writeInt16Vector() 244 writeInt16Vector(array); in writeInt16Vector() 253 int[] array = new int[n]; in writeInt32Vector() local [all …]
|
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/ |
D | ByteArrayHelpers.java | 40 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/native/opengl/tools/glgen/stubs/gles11/ |
D | common.cpp | 47 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/ |
D | LongSparseLongArrayTest.java | 36 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/av/media/libstagefright/ |
D | ACodecBufferChannel.cpp | 54 const std::shared_ptr<const std::vector<const BufferInfo>> &array, in findClientBuffer() argument 57 array->begin(), array->end(), in findClientBuffer() 62 const std::shared_ptr<const std::vector<const BufferInfo>> &array, in findBufferId() argument 65 array->begin(), array->end(), in findBufferId() 93 std::shared_ptr<const std::vector<const BufferInfo>> array( in queueInputBuffer() local 95 BufferInfoIterator it = findClientBuffer(array, buffer); in queueInputBuffer() 96 if (it == array->end()) { in queueInputBuffer() 115 std::shared_ptr<const std::vector<const BufferInfo>> array( in queueSecureInputBuffer() local 117 BufferInfoIterator it = findClientBuffer(array, buffer); in queueSecureInputBuffer() 118 if (it == array->end()) { in queueSecureInputBuffer() [all …]
|
/frameworks/base/wifi/java/android/net/wifi/aware/ |
D | TlvBufferUtils.java | 111 public TlvConstructor wrap(@Nullable byte[] array) { in wrap() argument 112 mArray = array; in wrap() 113 mArrayLength = (array == null) ? 0 : array.length; in wrap() 199 public TlvConstructor putByteArray(int type, @Nullable byte[] array, int offset, in putByteArray() argument 204 System.arraycopy(array, offset, mArray, mPosition, length); in putByteArray() 220 public TlvConstructor putByteArray(int type, @Nullable byte[] array) { in putByteArray() argument 221 return putByteArray(type, array, 0, (array == null) ? 0 : array.length); in putByteArray() 231 public TlvConstructor putRawByteArray(@Nullable byte[] array) { in putRawByteArray() argument 232 if (array == null) return this; in putRawByteArray() 234 checkRawLength(array.length); in putRawByteArray() [all …]
|
/frameworks/base/core/java/android/util/ |
D | ArraySet.java | 169 final Object[] array = sTwiceBaseCache; in allocArrays() local 171 mArray = array; in allocArrays() 172 sTwiceBaseCache = (Object[]) array[0]; in allocArrays() 173 mHashes = (int[]) array[1]; in allocArrays() 174 array[0] = array[1] = null; in allocArrays() 185 Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] in allocArrays() 186 + " [1]=" + array[1]); in allocArrays() 194 final Object[] array = sBaseCache; in allocArrays() local 196 mArray = array; in allocArrays() 197 sBaseCache = (Object[]) array[0]; in allocArrays() [all …]
|
D | ArrayMap.java | 214 final Object[] array = mTwiceBaseCache; in allocArrays() local 215 mArray = array; in allocArrays() 216 mTwiceBaseCache = (Object[])array[0]; in allocArrays() 217 mHashes = (int[])array[1]; in allocArrays() 218 array[0] = array[1] = null; in allocArrays() 228 final Object[] array = mBaseCache; in allocArrays() local 229 mArray = array; in allocArrays() 230 mBaseCache = (Object[])array[0]; in allocArrays() 231 mHashes = (int[])array[1]; in allocArrays() 232 array[0] = array[1] = null; in allocArrays() [all …]
|
/frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/ |
D | ArrayMapTests.java | 121 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/ |
D | BugreportProgressServiceTest.java | 93 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() argument 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/keystore/java/android/security/keystore/ |
D | ArrayUtils.java | 27 public static String[] nullToEmpty(String[] array) { in nullToEmpty() argument 28 return (array != null) ? array : EmptyArray.STRING; in nullToEmpty() 31 public static String[] cloneIfNotEmpty(String[] array) { in cloneIfNotEmpty() argument 32 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty() 35 public static byte[] cloneIfNotEmpty(byte[] array) { in cloneIfNotEmpty() argument 36 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty()
|
/frameworks/base/core/java/android/hardware/camera2/utils/ |
D | HashCodeHelpers.java | 36 public static int hashCode(int... array) { in hashCode() argument 37 if (array == null) { in hashCode() 49 for (int x : array) { in hashCode() 66 public static int hashCode(float... array) { in hashCode() argument 67 if (array == null) { in hashCode() 72 for (float f : array) { in hashCode() 89 public static <T> int hashCodeGeneric(T... array) { in hashCodeGeneric() argument 90 if (array == null) { in hashCodeGeneric() 95 for (T o : array) { in hashCodeGeneric()
|
D | ArrayUtils.java | 34 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/jni/ |
D | android_opengl_GLES10Ext.cpp | 72 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 …]
|
D | android_graphics_ColorSpace.cpp | 28 jfloat* array = env->GetFloatArrayElements(xyzD50, NULL); in getNativeXYZMatrix() local 29 xyzMatrix.vals[0][0] = array[0]; in getNativeXYZMatrix() 30 xyzMatrix.vals[1][0] = array[1]; in getNativeXYZMatrix() 31 xyzMatrix.vals[2][0] = array[2]; in getNativeXYZMatrix() 32 xyzMatrix.vals[0][1] = array[3]; in getNativeXYZMatrix() 33 xyzMatrix.vals[1][1] = array[4]; in getNativeXYZMatrix() 34 xyzMatrix.vals[2][1] = array[5]; in getNativeXYZMatrix() 35 xyzMatrix.vals[0][2] = array[6]; in getNativeXYZMatrix() 36 xyzMatrix.vals[1][2] = array[7]; in getNativeXYZMatrix() 37 xyzMatrix.vals[2][2] = array[8]; in getNativeXYZMatrix() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/ |
D | OverlayPackagesProviderTest.java | 227 verifyEmptyIntersection(R.array.required_apps_managed_device, in testNotRequiredAndDisallowedInResManagedDevice() 228 R.array.disallowed_apps_managed_device); in testNotRequiredAndDisallowedInResManagedDevice() 233 verifyEmptyIntersection(R.array.required_apps_managed_user, in testNotRequiredAndDisallowedInResManagedUser() 234 R.array.disallowed_apps_managed_user); in testNotRequiredAndDisallowedInResManagedUser() 239 verifyEmptyIntersection(R.array.required_apps_managed_profile, in testNotRequiredAndDisallowedInResManagedProfile() 240 R.array.disallowed_apps_managed_profile); in testNotRequiredAndDisallowedInResManagedProfile() 245 verifyEmptyIntersection(R.array.vendor_required_apps_managed_device, in testNotRequiredAndDisallowedInResManagedDeviceVendor() 246 R.array.vendor_disallowed_apps_managed_device); in testNotRequiredAndDisallowedInResManagedDeviceVendor() 251 verifyEmptyIntersection(R.array.vendor_required_apps_managed_user, in testNotRequiredAndDisallowedInResManagedUserVendor() 252 R.array.vendor_disallowed_apps_managed_user); in testNotRequiredAndDisallowedInResManagedUserVendor() [all …]
|
/frameworks/base/core/java/android/bluetooth/le/ |
D | BluetoothLeUtils.java | 38 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/java/com/android/internal/app/procstats/ |
D | SparseMappingTable.java | 132 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 …]
|
/frameworks/base/graphics/java/android/graphics/ |
D | ColorMatrixColorFilter.java | 51 public ColorMatrixColorFilter(@NonNull float[] array) { in ColorMatrixColorFilter() argument 52 if (array.length < 20) { in ColorMatrixColorFilter() 55 mMatrix.set(array); in ColorMatrixColorFilter() 111 public void setColorMatrixArray(@Nullable float[] array) { in setColorMatrixArray() argument 114 if (array == null) { in setColorMatrixArray() 117 if (array.length < 20) { in setColorMatrixArray() 120 mMatrix.set(array); in setColorMatrixArray() 129 private static native long nativeColorMatrixFilter(float[] array); in nativeColorMatrixFilter() argument
|