/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/ |
D | buffer_with_extendable_buffer.cpp | 26 uint32_t BufferWithExtendableBuffer::readUint(const int size, const int pos) const { in readUint() argument 28 const int posInBuffer = readingPosIsInAdditionalBuffer ? pos - mOriginalBuffer.size() : pos; in readUint() 29 return ByteArrayUtils::readUint(getBuffer(readingPosIsInAdditionalBuffer), size, posInBuffer); in readUint() 32 uint32_t BufferWithExtendableBuffer::readUintAndAdvancePosition(const int size, in readUintAndAdvancePosition() argument 34 const uint32_t value = readUint(size, *pos); in readUintAndAdvancePosition() 35 *pos += size; in readUintAndAdvancePosition() 43 *pos -= mOriginalBuffer.size(); in readCodePointsAndAdvancePosition() 50 *pos += mOriginalBuffer.size(); in readCodePointsAndAdvancePosition() 54 bool BufferWithExtendableBuffer::extend(const int size) { in extend() argument 55 return checkAndPrepareWriting(getTailPosition(), size); in extend() [all …]
|
/packages/apps/Camera2/src/com/android/camera/settings/ |
D | ResolutionUtil.java | 105 public void add(Size size) { in add() argument 106 sizes.add(size); in add() 109 public int compare(Size size, Size size2) { in add() 112 size.width() * size.height()); in add() 150 List<Size> result = new ArrayList<Size>(sizes.size()); in getDisplayableSizesFromSupported() 168 private static int area(Size size) { in area() argument 169 if (size == null) { in area() 172 return size.width() * size.height(); in area() 189 for (Size size : sizes) { in pickUpToThree() 190 double targetArea = Math.pow(.5, result.size()) * area(largest); in pickUpToThree() [all …]
|
/packages/modules/adb/pairing_auth/tests/ |
D | pairing_auth_test.cpp | 40 return PairingAuthUniquePtr(pairing_auth_client_new(pswd.data(), pswd.size()), in makeClient() 45 return PairingAuthUniquePtr(pairing_auth_server_new(pswd.data(), pswd.size()), in makeServer() 116 pairing_auth_encrypt(server.get(), data.data(), data.size(), outbuf, &outsize); in TEST_F() 122 pairing_auth_decrypt(server.get(), data.data(), data.size(), outbuf, &outsize); in TEST_F() 128 pairing_auth_safe_decrypted_size(server.get(), data.data(), data.size()); in TEST_F() 134 pairing_auth_safe_encrypted_size(server.get(), data.size()); in TEST_F() 153 EXPECT_TRUE(pairing_auth_init_cipher(client.get(), server_msg.data(), server_msg.size())); in TEST_F() 154 EXPECT_TRUE(pairing_auth_init_cipher(server.get(), client_msg.data(), client_msg.size())); in TEST_F() 160 client_msg.resize(pairing_auth_safe_encrypted_size(client.get(), msg.size())); in TEST_F() 161 ASSERT_GT(client_msg.size(), 0); in TEST_F() [all …]
|
/packages/modules/adb/ |
D | types.cpp | 45 if (len == size()) { in drop_front() 49 CHECK_LT(len, size()); in drop_front() 53 const auto next = chain_[start_index_].size() - begin_offset_; in drop_front() 69 if (len == size()) { in take_front() 73 CHECK_GE(size(), len); in take_front() 76 while (chain_[start_index_].size() - begin_offset_ <= len) { in take_front() 77 chain_length_ -= chain_[start_index_].size(); in take_front() 78 len -= chain_[start_index_].size() - begin_offset_; in take_front() 79 if (chain_[start_index_].size() > begin_offset_) { in take_front() 94 if (begin_offset_ != 0 || len < chain_[start_index_].size() / 2) { in take_front() [all …]
|
D | types.h | 37 explicit Block(size_t size) { allocate(size); } in Block() 84 size_t size() const { return size_; } in size() function 85 bool empty() const { return size() == 0; } in empty() 100 return size() == rhs.size() && memcmp(data(), rhs.data(), size()) == 0; 104 void allocate(size_t size) { in allocate() 108 if (size != 0) { in allocate() 112 data_.reset(new char[size]); in allocate() 113 capacity_ = size; in allocate() 114 size_ = size; in allocate() 166 return chain_[start_index_].size() - begin_offset_; in front_size() [all …]
|
D | types_test.cpp | 43 CHECK_EQ(0ULL, bc.coalesce().size()); in TEST() 51 ASSERT_EQ(100ULL, bc.size()); in TEST() 61 ASSERT_EQ(3ULL, foo.size()); in TEST() 62 ASSERT_EQ(3ULL, bc.size()); in TEST() 72 ASSERT_EQ(9ULL, bc.size()); in TEST() 75 ASSERT_EQ(3ULL, foo.size()); in TEST() 79 ASSERT_EQ(3ULL, bar.size()); in TEST() 83 ASSERT_EQ(3ULL, baz.size()); in TEST() 86 ASSERT_EQ(0ULL, bc.size()); in TEST() 99 ASSERT_EQ(4ULL, foob.size()); in TEST() [all …]
|
/packages/providers/MediaProvider/jni/ |
D | RedactionInfoTest.cpp | 33 os << "{ " << rr.start << ", " << rr.size << ", " << rr.is_redaction << " }"; in operator <<() 39 EXPECT_EQ(0, info.size()); in TEST() 44 EXPECT_EQ(0, out.size()); in TEST() 55 EXPECT_EQ(1, info.size()); in TEST() 61 EXPECT_EQ(3, out.size()); in TEST() 68 EXPECT_EQ(2, out.size()); in TEST() 74 EXPECT_EQ(2, out.size()); in TEST() 81 EXPECT_EQ(1, out.size()); in TEST() 86 EXPECT_EQ(1, out.size()); in TEST() 92 EXPECT_EQ(0, out.size()); in TEST() [all …]
|
D | RedactionInfo.cpp | 33 if (ranges.size() == 0) return; in mergeOverlappingRedactionRanges() 34 int newRangesSize = ranges.size(); in mergeOverlappingRedactionRanges() 35 for (int i = 0; i < ranges.size() - 1; ++i) { in mergeOverlappingRedactionRanges() 45 if (newRangesSize < ranges.size()) { in mergeOverlappingRedactionRanges() 58 int newRangesSize = ranges.size(); in removeZeroSizeRedactionRanges() 59 for (int i = 0; i < ranges.size(); ++i) { in removeZeroSizeRedactionRanges() 68 if (newRangesSize < ranges.size()) { in removeZeroSizeRedactionRanges() 81 bool RedactionInfo::hasOverlapWithReadRequest(size_t size, off64_t off) const { in hasOverlapWithReadRequest() argument 83 off + size <= redaction_ranges_.front().first) { in hasOverlapWithReadRequest() 105 int RedactionInfo::size() const { in size() function in mediaprovider::fuse::RedactionInfo [all …]
|
/packages/apps/Test/connectivity/sl4n/rapidjson/include/rapidjson/ |
D | allocators.h | 65 void* Malloc(size_t size) { in Malloc() argument 66 if (size) // behavior of malloc(0) is implementation defined. in Malloc() 67 return std::malloc(size); in Malloc() 125 …MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAlloc… 129 RAPIDJSON_ASSERT(size > sizeof(ChunkHeader)); 131 chunkHead_->capacity = size - sizeof(ChunkHeader); 132 chunkHead_->size = 0; 152 chunkHead_->size = 0; // Clear user buffer in Clear() 169 size_t size = 0; in Size() local 171 size += c->size; in Size() [all …]
|
/packages/modules/StatsD/statsd/tests/ |
D | LogEvent_test.cpp | 56 size_t size; in createIntWithBoolAnnotationLogEvent() local 57 uint8_t* buf = AStatsEvent_getBuffer(statsEvent, &size); in createIntWithBoolAnnotationLogEvent() 58 EXPECT_TRUE(logEvent->parseBuffer(buf, size)); in createIntWithBoolAnnotationLogEvent() 71 size_t size; in createIntWithIntAnnotationLogEvent() local 72 uint8_t* buf = AStatsEvent_getBuffer(statsEvent, &size); in createIntWithIntAnnotationLogEvent() 73 EXPECT_TRUE(logEvent->parseBuffer(buf, size)); in createIntWithIntAnnotationLogEvent() 89 size_t size; in TEST() local 90 uint8_t* buf = AStatsEvent_getBuffer(event, &size); in TEST() 93 EXPECT_TRUE(logEvent.parseBuffer(buf, size)); in TEST() 101 ASSERT_EQ(4, values.size()); in TEST() [all …]
|
/packages/inputmethods/LatinIME/native/jni/tests/utils/ |
D | int_array_view_test.cpp | 30 EXPECT_EQ(intVector.size(), intArrayView.size()); in TEST() 31 for (int i = 0; i < static_cast<int>(intVector.size()); ++i) { in TEST() 44 EXPECT_EQ(expectedIndex, intArrayView.size()); in TEST() 51 EXPECT_EQ(ARRAY_SIZE, intArrayView.size()); in TEST() 57 EXPECT_EQ(1u, intArrayView.size()); in TEST() 79 EXPECT_EQ(intArrayView.size(), intArrayView.limit(intArrayView.size()).size()); in TEST() 80 EXPECT_EQ(intArrayView.size(), intArrayView.limit(1000).size()); in TEST() 83 EXPECT_EQ(4u, subView.size()); in TEST() 84 for (size_t i = 0; i < subView.size(); ++i) { in TEST() 93 EXPECT_TRUE(intArrayView.skip(intVector.size()).empty()); in TEST() [all …]
|
/packages/modules/NeuralNetworks/common/ |
D | SharedMemoryAndroid.cpp | 51 GeneralResult<SharedMemory> createSharedMemoryFromUniqueFd(size_t size, int prot, in createSharedMemoryFromUniqueFd() argument 54 .size = size, in createSharedMemoryFromUniqueFd() 81 GeneralResult<SharedMemory> allocateSharedMemory(size_t size) { in allocateSharedMemory() argument 83 CHECK_GT(size, 0u); in allocateSharedMemory() 91 allocator->allocate(size, fn); in allocateSharedMemory() 106 CHECK_LE(maybeMemory.size(), std::numeric_limits<size_t>::max()); in allocateSharedMemory() 111 .size = static_cast<size_t>(maybeMemory.size()), in allocateSharedMemory() 118 const auto hidlMemory = hidl_memory("ashmem", std::move(handle), memory.size); in map() 135 const size_t size = static_cast<size_t>(fullSize); in map() local 139 .size = size, in map() [all …]
|
D | Validation.cpp | 346 types.reserve(extension.operandTypes.size()); in validateExtension() 366 names.reserve(extensions.size()); in validateExtensions() 406 NN_VALIDATE_LT(location.poolIndex, poolSizes.size()); in validateOperandDataLocation() 431 NN_VALIDATE_LT(location.offset, subgraphs.size()) in validateOperandDataLocation() 433 << " >= " << subgraphs.size(); in validateOperandDataLocation() 465 << "Scalar data has dimensions of rank " << operand.dimensions.size(); in validateOperandDimensions() 484 const auto size = getNonExtensionSize(operand); in validateOperandDimensions() local 485 NN_VALIDATE(size.has_value()) << "Tensor dimensions overflow"; in validateOperandDimensions() 486 NN_VALIDATE_NE(size.value(), 0u) << "Tensor has at least one unknown dimension"; in validateOperandDimensions() 627 const size_t count = operand.dimensions.size(); in validateOperandExtraParams() [all …]
|
D | ValidateHal.cpp | 59 : mPoolCount(pools.size()), mPoolSizes(mPoolCount) { in MemoryAccessVerifier() 61 mPoolSizes[i] = pools[i].size(); in MemoryAccessVerifier() 65 : mPoolCount(pools.size()), mPoolSizes(mPoolCount) { in MemoryAccessVerifier() 69 mPoolSizes[i] = pools[i].hidlMemory().size(); in MemoryAccessVerifier() 83 const size_t size = mPoolSizes[location.poolIndex]; in validate() local 85 if (static_cast<size_t>(location.offset) + location.length > size) { in validate() 88 << " exceeds pool size of " << size; in validate() 128 size_t count = operand.dimensions.size(); in validateOperandExtraParams() 135 NN_RET_CHECK_EQ(channelQuant.scales.size(), expected) in validateOperandExtraParams() 138 << "expected " << expected << " was " << channelQuant.scales.size(); in validateOperandExtraParams() [all …]
|
/packages/modules/StatsD/statsd/tests/metrics/ |
D | ValueMetricProducer_test.cpp | 71 ASSERT_EQ(expectedValues.size(), expectedDurationNs.size()); in assertPastBucketValuesSingleKey() 72 ASSERT_EQ(expectedValues.size(), expectedStartTimeNs.size()); in assertPastBucketValuesSingleKey() 73 ASSERT_EQ(expectedValues.size(), expectedEndTimeNs.size()); in assertPastBucketValuesSingleKey() 75 if (expectedValues.size() == 0) { in assertPastBucketValuesSingleKey() 76 ASSERT_EQ(0, mPastBuckets.size()); in assertPastBucketValuesSingleKey() 80 ASSERT_EQ(1, mPastBuckets.size()); in assertPastBucketValuesSingleKey() 81 ASSERT_EQ(expectedValues.size(), mPastBuckets.begin()->second.size()); in assertPastBucketValuesSingleKey() 84 for (int i = 0; i < expectedValues.size(); i++) { in assertPastBucketValuesSingleKey() 298 ASSERT_EQ(1UL, valueProducer->mCurrentSlicedBucket.size()); in TEST() 308 ASSERT_EQ(1UL, valueProducer->mPastBuckets.size()); in TEST() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/ |
D | BinaryDictEncoderUtils.java | 64 int size = CharEncoding.getCharArraySize(characters, codePointToOneByteCodeMap); in getPtNodeCharactersSize() local 65 if (characters.length > 1) size += FormatSpec.PTNODE_TERMINATOR_SIZE; in getPtNodeCharactersSize() 66 return size; in getPtNodeCharactersSize() 89 return BinaryDictIOUtils.getPtNodeCountSize(nodeArray.mData.size()); in getPtNodeCountSize() 100 int size = getNodeHeaderSize(ptNode, codePointToOneByteCodeMap); in getPtNodeMaximumSize() local 103 size += FormatSpec.PTNODE_FREQUENCY_SIZE; in getPtNodeMaximumSize() 105 size += FormatSpec.PTNODE_MAX_ADDRESS_SIZE; // For children address in getPtNodeMaximumSize() 107 size += (FormatSpec.PTNODE_ATTRIBUTE_FLAGS_SIZE in getPtNodeMaximumSize() 109 * ptNode.mBigrams.size(); in getPtNodeMaximumSize() 111 return size; in getPtNodeMaximumSize() [all …]
|
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/ |
D | ICalendarTest.java | 16 assertEquals(0, prop.getParameterNames().size()); in testAddParameter() 18 assertEquals(1, prop.getParameterNames().size()); in testAddParameter() 20 assertEquals(1, prop.getParameterNames().size()); in testAddParameter() 22 assertEquals(2, prop.getParameterNames().size()); in testAddParameter() 24 assertEquals(2, prop.getParameterNames().size()); in testAddParameter() 26 assertEquals(3, prop.getParameterNames().size()); in testAddParameter() 79 assertEquals(2, component.getPropertyNames().size()); in testParseBasicComponent() 81 assertEquals(2, prop1.getParameterNames().size()); in testParseBasicComponent() 85 assertEquals(2, props.size()); in testParseBasicComponent() 99 assertEquals(2, property.getParameterNames().size()); in testParseQuotedParam() [all …]
|
/packages/modules/Virtualization/authfs/src/file/ |
D | local_file.rs | 28 size: u64, field 34 let size = file.metadata()?.len(); in new() localVariable 35 Ok(LocalFileReader { file, size }) in new() 39 self.size in len() 46 if start >= self.size { in read_chunk() 49 let end = min(self.size, start + CHUNK_SIZE); in read_chunk() 66 let size = file_reader.read_chunk(0, &mut buf)?; in test_read_4k_file() localVariable 67 assert_eq!(size, buf.len()); in test_read_4k_file() 75 let size = file_reader.read_chunk(0, &mut buf)?; in test_read_4k1_file() localVariable 76 assert_eq!(size, buf.len()); in test_read_4k1_file() [all …]
|
/packages/modules/StatsD/statsd/tests/external/ |
D | StatsPuller_test.cpp | 96 ASSERT_EQ(1, dataHolder.size()); in TEST_F() 99 ASSERT_EQ(1, dataHolder[0]->size()); in TEST_F() 110 ASSERT_EQ(1, dataHolder.size()); in TEST_F() 113 ASSERT_EQ(1, dataHolder[0]->size()); in TEST_F() 124 ASSERT_EQ(1, dataHolder.size()); in TEST_F() 127 ASSERT_EQ(1, dataHolder[0]->size()); in TEST_F() 138 ASSERT_EQ(0, dataHolder.size()); in TEST_F() 144 ASSERT_EQ(0, dataHolder.size()); in TEST_F() 156 ASSERT_EQ(0, dataHolder.size()); in TEST_F() 165 ASSERT_EQ(0, dataHolder.size()); in TEST_F() [all …]
|
/packages/modules/adb/tls/tests/ |
D | tls_connection_test.cpp | 235 attr.val.data(), attr.val.size(), -1, 0)); in GetCAIssuerList() 303 std::string_view(reinterpret_cast<const char*>(msg_.data()), msg_.size()))); in TEST_F() 305 std::vector<uint8_t> buf(msg_.size()); in TEST_F() 306 ASSERT_TRUE(client_->ReadFully(buf.data(), msg_.size())); in TEST_F() 310 auto data = server_->ReadFully(msg_.size()); in TEST_F() 313 std::string_view(reinterpret_cast<const char*>(msg_.data()), msg_.size()))); in TEST_F() 329 std::string_view(reinterpret_cast<const char*>(msg_.data()), msg_.size()))); in TEST_F() 330 auto data = client_->ReadFully(msg_.size()); in TEST_F() 331 EXPECT_EQ(data.size(), 0); in TEST_F() 334 auto data = server_->ReadFully(msg_.size()); in TEST_F() [all …]
|
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/util/bluetooth/ |
D | BluetoothScanner.java | 202 int size = 0; in startListening() local 205 for (int ptr = mClients.size() - 1; ptr > -1; ptr--) { in startListening() 213 size = mClients.size(); in startListening() 218 if (size == 1) { in startListening() 230 final int N = mPresentDevices.size(); in startListening() 253 final int size; in stopListening() local 256 for (int ptr = mClients.size() - 1; ptr > -1; ptr--) { in stopListening() 264 size = mClients.size(); in stopListening() 266 if (size == 0) { in stopListening() 286 final int size; in stopNow() local [all …]
|
/packages/modules/Connectivity/service/src/com/android/server/connectivity/ |
D | NetworkRanker.java | 78 if (candidates.size() == 1) return candidates.get(0); // Only one potential satisfier in getBestNetwork() 79 if (candidates.size() <= 0) return null; // No network can satisfy this request in getBestNetwork() 167 new ArrayList<>(candidates.size() /* initialCapacity */); in getBestNetworkByPolicy() 169 new ArrayList<>(candidates.size() /* initialCapacity */); in getBestNetworkByPolicy() 185 if (accepted.size() == 1) return accepted.get(0); in getBestNetworkByPolicy() 186 if (accepted.size() > 0 && rejected.size() > 0) candidates = new ArrayList<>(accepted); in getBestNetworkByPolicy() 191 if (accepted.size() == 1) return accepted.get(0); in getBestNetworkByPolicy() 192 if (accepted.size() > 0 && rejected.size() > 0) candidates = new ArrayList<>(accepted); in getBestNetworkByPolicy() 199 if (accepted.size() == 1) return accepted.get(0); in getBestNetworkByPolicy() 200 if (accepted.size() > 0 && rejected.size() > 0) candidates = new ArrayList<>(accepted); in getBestNetworkByPolicy() [all …]
|
/packages/modules/Virtualization/microdroid/signature/ |
D | signature.cc | 36 uint32_t size; in ReadMicrodroidSignature() local 37 const size_t length_prefix_bytes = sizeof(size); in ReadMicrodroidSignature() 38 if (content.size() < length_prefix_bytes) { in ReadMicrodroidSignature() 39 return Error() << "Invalid signature: size == " << content.size(); in ReadMicrodroidSignature() 41 size = be32toh(*reinterpret_cast<uint32_t*>(content.data())); in ReadMicrodroidSignature() 42 if (content.size() < length_prefix_bytes + size) { in ReadMicrodroidSignature() 43 return Error() << "Invalid signature: size(" << size << ") mimatches to the content size(" in ReadMicrodroidSignature() 44 << content.size() - length_prefix_bytes << ")"; in ReadMicrodroidSignature() 46 content = content.substr(length_prefix_bytes, size); in ReadMicrodroidSignature() 64 uint32_t size = htobe32(static_cast<uint32_t>(content.size())); in WriteMicrodroidSignature() local [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/pipeline/ |
D | ImagePreset.java | 70 for (int i = 0; i < source.mFilters.size(); i++) { in ImagePreset() 104 for (int i = 0; i < mFilters.size(); i++) { in getPositionForRepresentation() 113 for (int i = 0; i < mFilters.size(); i++) { in getFilterRepresentationForType() 122 for (int i = 0; i < mFilters.size(); i++) { in getPositionForType() 175 for (int i = 0; i < mFilters.size(); i++) { in hasModifications() 221 if (preset.mFilters.size() != mFilters.size()) { in same() 230 if (mFilters.size() > 0 || preset.mFilters.size() > 0) { in same() 236 for (int i = 0; i < preset.mFilters.size(); i++) { in same() 254 if (preset.mFilters.size() != mFilters.size()) { in equals() 263 if (mFilters.size() > 0 || preset.mFilters.size() > 0) { in equals() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/internal/ |
D | PointerTrackerQueueTests.java | 78 assertEquals(0, mQueue.size()); in testEmpty() 85 assertEquals(1, mQueue.size()); in testAdd() 88 assertEquals(2, mQueue.size()); in testAdd() 91 assertEquals(3, mQueue.size()); in testAdd() 94 assertEquals(4, mQueue.size()); in testAdd() 108 assertEquals(3, mQueue.size()); in testRemove() 111 assertEquals(2, mQueue.size()); in testRemove() 114 assertEquals(2, mQueue.size()); in testRemove() 117 assertEquals(1, mQueue.size()); in testRemove() 120 assertEquals(0, mQueue.size()); in testRemove() [all …]
|