/frameworks/compile/mclinker/unittests/ |
D | LEB128Test.cpp | 42 leb128::ByteType buffer[2]; in TEST_F() local 46 result = buffer; in TEST_F() 48 ASSERT_EQ(buffer[0], 2); in TEST_F() 49 ASSERT_EQ(result, buffer + 1); in TEST_F() 52 result = buffer; in TEST_F() 54 ASSERT_EQ(buffer[0], 127); in TEST_F() 55 ASSERT_EQ(result, buffer + 1); in TEST_F() 58 result = buffer; in TEST_F() 60 ASSERT_EQ(buffer[0], 0 + 0x80); in TEST_F() 61 ASSERT_EQ(buffer[1], 1); in TEST_F() [all …]
|
/frameworks/base/media/jni/ |
D | android_media_Utils.cpp | 82 uint32_t Image_getBlobSize(LockedImage* buffer, bool usingRGBAOverride) { in Image_getBlobSize() argument 84 LOG_ALWAYS_FATAL_IF(buffer == NULL, "Input buffer is NULL!!!"); in Image_getBlobSize() 86 uint32_t width = buffer->width; in Image_getBlobSize() 87 uint8_t* blobBuffer = buffer->data; in Image_getBlobSize() 90 width = (buffer->width + buffer->stride * (buffer->height - 1)) * 4; in Image_getBlobSize() 118 status_t getLockedImageInfo(LockedImage* buffer, int idx, in getLockedImageInfo() argument 121 LOG_ALWAYS_FATAL_IF(buffer == NULL, "Input buffer is NULL!!!"); in getLockedImageInfo() 128 ALOGV("%s: buffer: %p", __FUNCTION__, buffer); in getLockedImageInfo() 137 int32_t fmt = buffer->flexFormat; in getLockedImageInfo() 145 buffer->data : in getLockedImageInfo() [all …]
|
/frameworks/base/core/java/android/text/method/ |
D | ArrowKeyMovementMethod.java | 33 private static boolean isSelecting(Spannable buffer) { in isSelecting() argument 34 return ((MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SHIFT_ON) == 1) || in isSelecting() 35 (MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SELECTING) != 0)); in isSelecting() 38 private static int getCurrentLineTop(Spannable buffer, Layout layout) { in getCurrentLineTop() argument 39 return layout.getLineTop(layout.getLineForOffset(Selection.getSelectionEnd(buffer))); in getCurrentLineTop() 51 protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode, in handleMovementKey() argument 58 && MetaKeyKeyListener.getMetaState(buffer, in handleMovementKey() 65 return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event); in handleMovementKey() 69 protected boolean left(TextView widget, Spannable buffer) { in left() argument 71 if (isSelecting(buffer)) { in left() [all …]
|
D | ScrollingMovementMethod.java | 30 protected boolean left(TextView widget, Spannable buffer) { in left() argument 31 return scrollLeft(widget, buffer, 1); in left() 35 protected boolean right(TextView widget, Spannable buffer) { in right() argument 36 return scrollRight(widget, buffer, 1); in right() 40 protected boolean up(TextView widget, Spannable buffer) { in up() argument 41 return scrollUp(widget, buffer, 1); in up() 45 protected boolean down(TextView widget, Spannable buffer) { in down() argument 46 return scrollDown(widget, buffer, 1); in down() 50 protected boolean pageUp(TextView widget, Spannable buffer) { in pageUp() argument 51 return scrollPageUp(widget, buffer); in pageUp() [all …]
|
D | LinkMovementMethod.java | 49 protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode, in handleMovementKey() argument 56 event.getRepeatCount() == 0 && action(CLICK, widget, buffer)) { in handleMovementKey() 62 return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event); in handleMovementKey() 66 protected boolean up(TextView widget, Spannable buffer) { in up() argument 67 if (action(UP, widget, buffer)) { in up() 71 return super.up(widget, buffer); in up() 75 protected boolean down(TextView widget, Spannable buffer) { in down() argument 76 if (action(DOWN, widget, buffer)) { in down() 80 return super.down(widget, buffer); in down() 84 protected boolean left(TextView widget, Spannable buffer) { in left() argument [all …]
|
/frameworks/base/libs/protoutil/tests/ |
D | EncodedBuffer_test.cpp | 32 sp<EncodedBuffer> buffer = new EncodedBuffer(TEST_CHUNK_SIZE); in TEST() local 33 EXPECT_EQ(buffer->size(), 0UL); in TEST() 34 expectPointer(buffer->wp(), 0); in TEST() 35 EXPECT_EQ(buffer->currentToWrite(), TEST_CHUNK_SIZE); in TEST() 37 buffer->writeRawByte(50 + i); in TEST() 39 EXPECT_EQ(buffer->size(), TEST_CHUNK_HALF_SIZE); in TEST() 40 expectPointer(buffer->wp(), TEST_CHUNK_HALF_SIZE); in TEST() 41 EXPECT_EQ(buffer->currentToWrite(), TEST_CHUNK_HALF_SIZE); in TEST() 43 buffer->writeRawByte(80 + i); in TEST() 45 EXPECT_EQ(buffer->size(), TEST_CHUNK_SIZE + TEST_CHUNK_HALF_SIZE); in TEST() [all …]
|
/frameworks/base/tests/net/java/com/android/internal/util/ |
D | RingBufferTest.java | 35 RingBuffer<String> buffer = new RingBuffer<>(String.class, 100); in testEmptyRingBuffer() local 37 assertArrayEquals(new String[0], buffer.toArray()); in testEmptyRingBuffer() 43 RingBuffer<String> buffer = new RingBuffer<>(String.class, -10); in testIncorrectConstructorArguments() local 49 RingBuffer<String> buffer = new RingBuffer<>(String.class, 0); in testIncorrectConstructorArguments() local 57 RingBuffer<String> buffer = new RingBuffer<>(String.class, 100); in testRingBufferWithNoWrapping() local 59 buffer.append("a"); in testRingBufferWithNoWrapping() 60 buffer.append("b"); in testRingBufferWithNoWrapping() 61 buffer.append("c"); in testRingBufferWithNoWrapping() 62 buffer.append("d"); in testRingBufferWithNoWrapping() 63 buffer.append("e"); in testRingBufferWithNoWrapping() [all …]
|
/frameworks/base/tools/aapt2/util/ |
D | BigBuffer_test.cpp | 26 BigBuffer buffer(4); in TEST() local 28 EXPECT_THAT(buffer.NextBlock<char>(2), NotNull()); in TEST() 29 EXPECT_EQ(2u, buffer.size()); in TEST() 33 BigBuffer buffer(16); in TEST() local 35 char* b1 = buffer.NextBlock<char>(8); in TEST() 38 char* b2 = buffer.NextBlock<char>(4); in TEST() 45 BigBuffer buffer(16); in TEST() local 47 EXPECT_THAT(buffer.NextBlock<char>(32), NotNull()); in TEST() 48 EXPECT_EQ(32u, buffer.size()); in TEST() 52 BigBuffer buffer(16); in TEST() local [all …]
|
/frameworks/base/core/tests/coretests/src/android/util/ |
D | StatsEventTest.java | 53 final ByteBuffer buffer = in testNoFields() local 57 .that(buffer.get()).isEqualTo(StatsEvent.TYPE_OBJECT); in testNoFields() 60 .that(buffer.get()).isEqualTo(3); in testNoFields() 63 .that(buffer.get()).isEqualTo(StatsEvent.TYPE_LONG); in testNoFields() 66 .that(buffer.getLong()).isIn(Range.closed(minTimestamp, maxTimestamp)); in testNoFields() 69 .that(buffer.get()).isEqualTo(StatsEvent.TYPE_INT); in testNoFields() 72 .that(buffer.getInt()).isEqualTo(expectedAtomId); in testNoFields() 75 .that(buffer.get()).isEqualTo(StatsEvent.TYPE_ERRORS); in testNoFields() 77 final int errorMask = buffer.getInt(); in testNoFields() 82 assertThat(statsEvent.getNumBytes()).isEqualTo(buffer.position()); in testNoFields() [all …]
|
/frameworks/native/libs/gui/ |
D | BufferItem.cpp | 120 static void writeAligned(void*& buffer, size_t& size, T value) { in writeAligned() argument 121 size -= FlattenableUtils::align<alignof(T)>(buffer); in writeAligned() 122 FlattenableUtils::write(buffer, size, value); in writeAligned() 126 void*& buffer, size_t& size, int*& fds, size_t& count) const { in flatten() argument 134 uint32_t& flags = *static_cast<uint32_t*>(buffer); in flatten() 137 FlattenableUtils::advance(buffer, size, sizeof(uint32_t)); in flatten() 141 status_t err = mGraphicBuffer->flatten(buffer, size, fds, count); in flatten() 143 size -= FlattenableUtils::align<4>(buffer); in flatten() 147 status_t err = mFence->flatten(buffer, size, fds, count); in flatten() 149 size -= FlattenableUtils::align<4>(buffer); in flatten() [all …]
|
/frameworks/native/libs/vr/libpdx/ |
D | serialization_tests.cpp | 1287 Payload buffer; in TEST() local 1292 buffer = {ENCODING_TYPE_TRUE}; in TEST() 1293 error = Deserialize(&result, &buffer); in TEST() 1298 buffer = {ENCODING_TYPE_FALSE}; in TEST() 1299 error = Deserialize(&result, &buffer); in TEST() 1305 Payload buffer; in TEST() local 1310 buffer = {ENCODING_TYPE_POSITIVE_FIXINT_MIN}; in TEST() 1311 error = Deserialize(&result, &buffer); in TEST() 1316 buffer = {ENCODING_TYPE_POSITIVE_FIXINT_MAX}; in TEST() 1317 error = Deserialize(&result, &buffer); in TEST() [all …]
|
/frameworks/av/media/extractors/mp3/ |
D | XINGSeeker.cpp | 86 uint8_t buffer[4]; in CreateFromSource() local 88 if (source->readAt(offset, &buffer, 4) < 4) { // get header in CreateFromSource() 93 int header = U32_AT(buffer);; in CreateFromSource() 102 uint8_t version = (buffer[1] >> 3) & 3; in CreateFromSource() 115 if (source->readAt(offset, &buffer, 4) < 4) { // XING header ID in CreateFromSource() 120 if ((buffer[0] != 'X') || (buffer[1] != 'i') in CreateFromSource() 121 || (buffer[2] != 'n') || (buffer[3] != 'g')) { in CreateFromSource() 122 if ((buffer[0] != 'I') || (buffer[1] != 'n') in CreateFromSource() 123 || (buffer[2] != 'f') || (buffer[3] != 'o')) { in CreateFromSource() 128 if (source->readAt(offset, &buffer, 4) < 4) { // flags in CreateFromSource() [all …]
|
/frameworks/av/media/libnbaio/ |
D | SourceAudioBufferProvider.cpp | 48 status_t SourceAudioBufferProvider::getNextBuffer(Buffer *buffer) in getNextBuffer() argument 50 ALOG_ASSERT(buffer != NULL && buffer->frameCount > 0 && mGetCount == 0); in getNextBuffer() 54 if (mRemaining < buffer->frameCount) { in getNextBuffer() 55 buffer->frameCount = mRemaining; in getNextBuffer() 57 buffer->raw = (char *) mAllocated + (mOffset * mFrameSize); in getNextBuffer() 58 mGetCount = buffer->frameCount; in getNextBuffer() 62 if (buffer->frameCount > mSize) { in getNextBuffer() 67 mAllocated = calloc(buffer->frameCount, mFrameSize); in getNextBuffer() 72 mSize = buffer->frameCount; in getNextBuffer() 76 ssize_t actual = mSource->read(mAllocated, buffer->frameCount); in getNextBuffer() [all …]
|
/frameworks/base/core/java/android/hardware/camera2/marshal/impl/ |
D | MarshalQueryablePrimitive.java | 64 public T unmarshal(ByteBuffer buffer) { in unmarshal() argument 65 return mClass.cast(unmarshalObject(buffer)); in unmarshal() 74 public void marshal(T value, ByteBuffer buffer) { in marshal() argument 78 marshalPrimitive(val, buffer); in marshal() 82 marshalPrimitive(val, buffer); in marshal() 86 marshalPrimitive(val, buffer); in marshal() 89 marshalPrimitive((Rational) value, buffer); in marshal() local 93 marshalPrimitive(val, buffer); in marshal() 97 marshalPrimitive(val, buffer); in marshal() 104 private void marshalPrimitive(int value, ByteBuffer buffer) { in marshalPrimitive() argument [all …]
|
/frameworks/native/services/surfaceflinger/tests/unittests/ |
D | RegionSamplingTest.cpp | 39 std::array<uint32_t, kHeight * kStride> buffer; member 44 std::fill(buffer.begin(), buffer.end(), kWhite); in TEST_F() 45 EXPECT_THAT(sampleArea(buffer.data(), kWidth, kHeight, kStride, kOrientation, whole_area), in TEST_F() 50 std::fill(buffer.begin(), buffer.end(), kBlack); in TEST_F() 51 EXPECT_THAT(sampleArea(buffer.data(), kWidth, kHeight, kStride, kOrientation, whole_area), in TEST_F() 60 std::fill(buffer.begin(), buffer.begin() + half, 0); in TEST_F() 61 std::fill(buffer.begin() + half, buffer.end(), kWhite); in TEST_F() 62 EXPECT_THAT(sampleArea(buffer.data(), kWidth, kHeight, kStride, kOrientation, partial_region), in TEST_F() 67 std::generate(buffer.begin(), buffer.end(), [n = 0]() mutable { in TEST_F() 72 EXPECT_THAT(sampleArea(buffer.data(), kWidth, kHeight, kStride, kOrientation, whole_area), in TEST_F() [all …]
|
/frameworks/av/media/libstagefright/foundation/ |
D | MediaBufferGroup.cpp | 82 MediaBuffer *buffer = new MediaBuffer(mem); in init() local 83 buffer->getSharedControl()->clear(); in init() 84 add_buffer(buffer); in init() 94 MediaBuffer *buffer = new MediaBuffer(buffer_size); in init() local 95 if (buffer->data() == nullptr) { in init() 96 delete buffer; // don't call release, it's not properly formed in init() 100 add_buffer(buffer); in init() 105 for (MediaBufferBase *buffer : mInternal->mBuffers) { in ~MediaBufferGroup() 106 if (buffer->refcount() != 0) { in ~MediaBufferGroup() 107 const int localRefcount = buffer->localRefcount(); in ~MediaBufferGroup() [all …]
|
/frameworks/base/cmds/statsd/benchmark/ |
D | log_event_benchmark.cpp | 38 static void write4Bytes(int val, vector<char>* buffer) { in write4Bytes() argument 39 buffer->push_back(static_cast<char>(val)); in write4Bytes() 40 buffer->push_back(static_cast<char>((val >> 8) & 0xFF)); in write4Bytes() 41 buffer->push_back(static_cast<char>((val >> 16) & 0xFF)); in write4Bytes() 42 buffer->push_back(static_cast<char>((val >> 24) & 0xFF)); in write4Bytes() 46 vector<char> buffer; in getSimpleLogMsgData() local 48 write4Bytes(1937006964, &buffer); in getSimpleLogMsgData() 49 buffer.push_back(EVENT_TYPE_LIST); in getSimpleLogMsgData() 50 buffer.push_back(2); // field counts; in getSimpleLogMsgData() 51 buffer.push_back(EVENT_TYPE_INT); in getSimpleLogMsgData() [all …]
|
/frameworks/base/tools/aapt2/io/ |
D | FileStream_test.cpp | 43 const void* buffer; in TEST() local 45 ASSERT_TRUE(in.Next(&buffer, &size)) << in.GetError(); in TEST() 47 ASSERT_THAT(buffer, NotNull()); in TEST() 49 EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("this is a ")); in TEST() 51 ASSERT_TRUE(in.Next(&buffer, &size)); in TEST() 53 ASSERT_THAT(buffer, NotNull()); in TEST() 55 EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("cool strin")); in TEST() 60 ASSERT_TRUE(in.Next(&buffer, &size)); in TEST() 62 ASSERT_THAT(buffer, NotNull()); in TEST() 64 EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("strin")); in TEST() [all …]
|
/frameworks/base/tests/AccessoryDisplay/common/src/com/android/accessorydisplay/common/ |
D | Transport.java | 231 protected abstract int ioRead(byte[] buffer, int offset, int count) in ioRead() argument 233 protected abstract void ioWrite(byte[] buffer, int offset, int count) in ioWrite() argument 253 final ByteBuffer buffer = (ByteBuffer)msg.obj; in handleMessage() local 255 final int limit = buffer.limit(); in handleMessage() 256 while (buffer.position() < limit) { in handleMessage() 257 final int service = buffer.getShort() & 0xffff; in handleMessage() 258 final int what = buffer.getShort() & 0xffff; in handleMessage() 259 final int contentSize = buffer.getInt(); in handleMessage() 263 final int end = buffer.position() + contentSize; in handleMessage() 264 buffer.limit(end); in handleMessage() [all …]
|
/frameworks/base/core/java/android/net/ |
D | SntpClient.java | 120 byte[] buffer = new byte[NTP_PACKET_SIZE]; in requestTime() 121 DatagramPacket request = new DatagramPacket(buffer, buffer.length, address, port); in requestTime() 126 buffer[0] = NTP_MODE_CLIENT | (NTP_VERSION << 3); in requestTime() 131 writeTimeStamp(buffer, TRANSMIT_TIME_OFFSET, requestTime); in requestTime() 136 DatagramPacket response = new DatagramPacket(buffer, buffer.length); in requestTime() 142 final byte leap = (byte) ((buffer[0] >> 6) & 0x3); in requestTime() 143 final byte mode = (byte) (buffer[0] & 0x7); in requestTime() 144 final int stratum = (int) (buffer[1] & 0xff); in requestTime() 145 final long originateTime = readTimeStamp(buffer, ORIGINATE_TIME_OFFSET); in requestTime() 146 final long receiveTime = readTimeStamp(buffer, RECEIVE_TIME_OFFSET); in requestTime() [all …]
|
/frameworks/av/media/libstagefright/ |
D | MPEG2TSWriter.cpp | 88 void appendAACFrames(MediaBufferBase *buffer); 89 void appendAVCFrame(MediaBufferBase *buffer); 252 void MPEG2TSWriter::SourceInfo::appendAVCFrame(MediaBufferBase *buffer) { in appendAVCFrame() argument 256 if (mBuffer == NULL || buffer->range_length() > mBuffer->capacity()) { in appendAVCFrame() 257 mBuffer = new ABuffer(buffer->range_length()); in appendAVCFrame() 262 (const uint8_t *)buffer->data() in appendAVCFrame() 263 + buffer->range_offset(), in appendAVCFrame() 264 buffer->range_length()); in appendAVCFrame() 267 CHECK(buffer->meta_data().findInt64(kKeyTime, &timeUs)); in appendAVCFrame() 271 if (buffer->meta_data().findInt32(kKeyIsSyncFrame, &isSync) in appendAVCFrame() [all …]
|
/frameworks/av/media/libstagefright/httplive/ |
D | HTTPDownloader.cpp | 136 sp<ABuffer> buffer = *out != NULL ? *out : new ABuffer(size); in fetchBlock() local 138 buffer->setRange(0, 0); in fetchBlock() 143 …if (block_size > 0 && (range_length == -1 || (int64_t)(buffer->size() + block_size) < range_length… in fetchBlock() 144 range_length = buffer->size() + block_size; in fetchBlock() 148 size_t bufferRemaining = buffer->capacity() - buffer->size(); in fetchBlock() 150 size_t bufferIncrement = buffer->size() / 2; in fetchBlock() 157 buffer->size() + bufferRemaining); in fetchBlock() 159 sp<ABuffer> copy = new ABuffer(buffer->size() + bufferRemaining); in fetchBlock() 163 buffer->size(), bufferRemaining); in fetchBlock() 166 memcpy(copy->data(), buffer->data(), buffer->size()); in fetchBlock() [all …]
|
/frameworks/base/core/jni/ |
D | android_hardware_UsbRequest.cpp | 81 jbyteArray buffer, jint length, jboolean out) in android_hardware_UsbRequest_queue_array() argument 89 if (buffer && length) { in android_hardware_UsbRequest_queue_array() 90 request->buffer = malloc(length); in android_hardware_UsbRequest_queue_array() 91 if (!request->buffer) in android_hardware_UsbRequest_queue_array() 93 memset(request->buffer, 0, length); in android_hardware_UsbRequest_queue_array() 96 env->GetByteArrayRegion(buffer, 0, length, (jbyte *)request->buffer); in android_hardware_UsbRequest_queue_array() 99 request->buffer = NULL; in android_hardware_UsbRequest_queue_array() 107 if (request->buffer) { in android_hardware_UsbRequest_queue_array() 109 free(request->buffer); in android_hardware_UsbRequest_queue_array() 110 request->buffer = NULL; in android_hardware_UsbRequest_queue_array() [all …]
|
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/anqp/ |
D | HSConnectionCapabilityElementTest.java | 48 private void appendProtocolPortTuple(ByteBuffer buffer, ProtocolPortTuple tuple) { in appendProtocolPortTuple() argument 49 buffer.put((byte) tuple.getProtocol()); in appendProtocolPortTuple() 50 buffer.putShort((short) tuple.getPort()); in appendProtocolPortTuple() 51 buffer.put((byte) tuple.getStatus()); in appendProtocolPortTuple() 61 ByteBuffer buffer = ByteBuffer.allocate(tuples.length * ProtocolPortTuple.RAW_BYTE_SIZE) in getTestBuffer() local 64 appendProtocolPortTuple(buffer, tuple); in getTestBuffer() 66 buffer.position(0); in getTestBuffer() 67 return buffer; in getTestBuffer() 91 ByteBuffer buffer = ByteBuffer.allocate(ProtocolPortTuple.RAW_BYTE_SIZE - 1); in parseBufferWithLessThanMinimumSize() local 92 buffer.put(new byte[ProtocolPortTuple.RAW_BYTE_SIZE - 1]); in parseBufferWithLessThanMinimumSize() [all …]
|
/frameworks/base/core/java/android/hardware/ |
D | SerialPort.java | 89 public int read(ByteBuffer buffer) throws IOException { in read() argument 90 if (buffer.isDirect()) { in read() 91 return native_read_direct(buffer, buffer.remaining()); in read() 92 } else if (buffer.hasArray()) { in read() 93 return native_read_array(buffer.array(), buffer.remaining()); in read() 108 public void write(ByteBuffer buffer, int length) throws IOException { in write() argument 109 if (buffer.isDirect()) { in write() 110 native_write_direct(buffer, length); in write() 111 } else if (buffer.hasArray()) { in write() 112 native_write_array(buffer.array(), length); in write() [all …]
|