Home
last modified time | relevance | path

Searched refs:bytes (Results 1 – 25 of 260) sorted by relevance

1234567891011

/system/nfc/tools/casimir/scripts/
Drf_packets.py12 payload: Optional[bytes] = field(repr=False, default_factory=bytes, compare=False)
15 def parse_all(cls, span: bytes) -> 'Packet': argument
37 elif typ is bytes:
145 def parse(span: bytes) -> Tuple['RfPacket', bytes]: argument
158 span = bytes([])
198 def serialize(self, payload: bytes = None) -> bytes: argument
212 return bytes(_span)
226 def parse(fields: dict, span: bytes) -> Tuple['PollCommand', bytes]: argument
231 def serialize(self, payload: bytes = None) -> bytes: argument
233 return RfPacket.serialize(self, payload = bytes(_span))
[all …]
/system/chre/platform/shared/
Dmemory_manager.cc24 void *MemoryManager::nanoappAlloc(Nanoapp *app, uint32_t bytes) { in nanoappAlloc() argument
26 if (bytes > 0) { in nanoappAlloc()
31 } else if ((bytes > kMaxAllocationBytes) || in nanoappAlloc()
32 ((mTotalAllocatedBytes + bytes) > kMaxAllocationBytes)) { in nanoappAlloc()
38 doAlloc(app, sizeof(HeapBlockHeader) + bytes)); in nanoappAlloc()
41 app->setTotalAllocatedBytes(app->getTotalAllocatedBytes() + bytes); in nanoappAlloc()
42 mTotalAllocatedBytes += bytes; in nanoappAlloc()
48 header->data.bytes = bytes; in nanoappAlloc()
71 if (nanoAppTotalAllocatedBytes >= header->data.bytes) { in nanoappFree()
73 header->data.bytes); in nanoappFree()
[all …]
/system/nfc/utils/test/
Dconfig_test.cc86 auto bytes = config.getBytes("BYTES_VALUE"); in TEST() local
87 EXPECT_EQ(bytes.size(), 5u); in TEST()
88 EXPECT_EQ(bytes[0], 10); in TEST()
89 EXPECT_EQ(bytes[1], 11); in TEST()
90 EXPECT_EQ(bytes[2], 12); in TEST()
91 EXPECT_EQ(bytes[3], 255); in TEST()
92 EXPECT_EQ(bytes[4], 0); in TEST()
134 auto bytes = config.getBytes("BYTES_VALUE"); in TEST_F() local
135 EXPECT_EQ(bytes.size(), 5u); in TEST_F()
136 EXPECT_EQ(bytes[0], 10); in TEST_F()
[all …]
/system/nfc/src/fuzzers/integration/
Dnfc_integration_fuzzer.proto5 optional bytes data_provider = 2;
23 bytes send_raw_frame = 4;
77 optional bytes aid = 2;
113 optional bytes rf_tech_param_buffer = 8;
114 optional bytes intf_param_buffer = 9;
128 optional bytes param = 1;
136 optional bytes ats_res = 1;
140 optional bytes his_byte = 5;
144 optional bytes attrib_req = 1;
145 optional bytes hi_info = 2;
[all …]
/system/unwinding/libunwindstack/tests/
DMemoryRangesTest.cpp52 size_t bytes = ranges_->Read(0, dst.data(), dst.size()); in TEST_F() local
53 ASSERT_EQ(1000UL, bytes); in TEST_F()
54 for (size_t i = 0; i < bytes; i++) { in TEST_F()
58 bytes = ranges_->Read(2000, dst.data(), dst.size()); in TEST_F()
59 ASSERT_EQ(2000UL, bytes); in TEST_F()
60 for (size_t i = 0; i < bytes; i++) { in TEST_F()
64 bytes = ranges_->Read(4000, dst.data(), dst.size()); in TEST_F()
65 ASSERT_EQ(100UL, bytes); in TEST_F()
66 for (size_t i = 0; i < bytes; i++) { in TEST_F()
82 size_t bytes = ranges_->Read(6000, dst.data(), dst.size()); in TEST_F() local
[all …]
DMemoryRemoteTest.cpp93 size_t bytes = in TEST_F() local
96 ASSERT_LE(1024U, bytes); in TEST_F()
97 for (size_t i = 0; i < bytes; i++) { in TEST_F()
102 bytes = in TEST_F()
104 ASSERT_EQ(1024U, bytes); in TEST_F()
105 for (size_t i = 0; i < bytes; i++) { in TEST_F()
227 size_t bytes = remote_ptrace.Read(reinterpret_cast<uint64_t>(mapping), &value, sizeof(value)); in TEST_F() local
228 ASSERT_EQ(sizeof(value), bytes); in TEST_F()
230bytes = remote_ptrace.Read(reinterpret_cast<uint64_t>(mapping) + page_size, &value, sizeof(value)); in TEST_F()
231 ASSERT_EQ(sizeof(value), bytes); in TEST_F()
[all …]
/system/core/storaged/
Dstoraged_service.cpp52 rec.second.bytes[READ][FOREGROUND][CHARGER_OFF], in dumpUidRecords()
53 rec.second.bytes[WRITE][FOREGROUND][CHARGER_OFF], in dumpUidRecords()
54 rec.second.bytes[READ][BACKGROUND][CHARGER_OFF], in dumpUidRecords()
55 rec.second.bytes[WRITE][BACKGROUND][CHARGER_OFF], in dumpUidRecords()
56 rec.second.bytes[READ][FOREGROUND][CHARGER_ON], in dumpUidRecords()
57 rec.second.bytes[WRITE][FOREGROUND][CHARGER_ON], in dumpUidRecords()
58 rec.second.bytes[READ][BACKGROUND][CHARGER_ON], in dumpUidRecords()
59 rec.second.bytes[WRITE][BACKGROUND][CHARGER_ON]); in dumpUidRecords()
69 uid_usage.bytes[READ][FOREGROUND][CHARGER_OFF], in dumpUidRecordsDebug()
70 uid_usage.bytes[WRITE][FOREGROUND][CHARGER_OFF], in dumpUidRecordsDebug()
[all …]
Dstoraged_uid_monitor.cpp110 if (bytes[i][j][k]) in is_zero()
280 if (uid_usage.bytes[READ][FOREGROUND][CHARGER_ON] + in dump()
281 uid_usage.bytes[READ][FOREGROUND][CHARGER_OFF] + in dump()
282 uid_usage.bytes[READ][BACKGROUND][CHARGER_ON] + in dump()
283 uid_usage.bytes[READ][BACKGROUND][CHARGER_OFF] + in dump()
284 uid_usage.bytes[WRITE][FOREGROUND][CHARGER_ON] + in dump()
285 uid_usage.bytes[WRITE][FOREGROUND][CHARGER_OFF] + in dump()
286 uid_usage.bytes[WRITE][BACKGROUND][CHARGER_ON] + in dump()
287 uid_usage.bytes[WRITE][BACKGROUND][CHARGER_OFF] > threshold) { in dump()
329 usage.uid_ios.bytes[READ][FOREGROUND][charger_stat_] += in update_curr_io_stats_locked()
[all …]
/system/chre/apps/test/chqts/src/shared/
Dnano_endian_test.cc27 uint8_t bytes[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, in swapByteTest() local
35 static_assert(arrayLength(bytes) == arrayLength(postSwap), in swapByteTest()
38 static_assert((kByteCount > 0) && (kByteCount <= arrayLength(bytes)), in swapByteTest()
43 nanoapp_testing::swapBytes(bytes, kByteCount); in swapByteTest()
44 EXPECT_EQ(0, ::memcmp(bytes, kExpected, kByteCount)); in swapByteTest()
46 if (arrayLength(bytes) < kByteCount) { in swapByteTest()
48 EXPECT_EQ(kByteCount + 1, bytes[kByteCount]); in swapByteTest()
91 const uint8_t *bytes = reinterpret_cast<uint8_t *>(&value); in TEST() local
92 EXPECT_EQ(0, ::memcmp(kLittleEndianRepresentation, bytes, in TEST()
Dnano_endian.cc21 void swapBytes(uint8_t *bytes, size_t size) { in swapBytes() argument
23 uint8_t tmp = bytes[front]; in swapBytes()
24 bytes[front] = bytes[end]; in swapBytes()
25 bytes[end] = tmp; in swapBytes()
/system/core/fastboot/
Dudp.cpp60 static uint16_t ExtractUint16(const uint8_t* bytes) { in ExtractUint16() argument
61 return (static_cast<uint16_t>(bytes[0]) << 8) | bytes[1]; in ExtractUint16()
71 const uint8_t* bytes() const { return bytes_; } in bytes() function in udp::Header
229 ssize_t bytes = SendSinglePacketHelper(&header, tx_data, packet_data_length, rx_data, in SendData() local
234 if (bytes == -1) { in SendData()
236 } else if (static_cast<size_t>(bytes) < rx_length) { in SendData()
237 rx_data += bytes; in SendData()
238 rx_length -= bytes; in SendData()
247 ret += bytes; in SendData()
261 if (!socket_->Send({{header->bytes(), kHeaderSize}, {tx_data, tx_length}})) { in SendSinglePacketHelper()
[all …]
/system/core/libutils/
DJenkinsHash.cpp37 uint32_t JenkinsHashMixBytes(uint32_t hash, const uint8_t* bytes, size_t size) { in JenkinsHashMixBytes() argument
44 uint32_t data = bytes[i] | (bytes[i+1] << 8) | (bytes[i+2] << 16) | (bytes[i+3] << 24); in JenkinsHashMixBytes()
48 uint32_t data = bytes[i]; in JenkinsHashMixBytes()
49 data |= ((size & 3) > 1) ? (bytes[i+1] << 8) : 0; in JenkinsHashMixBytes()
50 data |= ((size & 3) > 2) ? (bytes[i+2] << 16) : 0; in JenkinsHashMixBytes()
/system/core/fs_mgr/libfs_avb/tests/
Dutil_test.cpp108 uint8_t bytes[16]; in TEST() local
110 EXPECT_TRUE(HexToBytes((uint8_t*)bytes, sizeof(bytes), hex)); in TEST()
111 for (size_t i = 0; i < sizeof(bytes); i++) { in TEST()
112 EXPECT_EQ(i, bytes[i]); in TEST()
118 uint8_t bytes[16]; in TEST() local
120 EXPECT_TRUE(HexToBytes((uint8_t*)bytes, sizeof(bytes), hex)); in TEST()
121 for (size_t i = 0; i < sizeof(bytes); i++) { in TEST()
122 EXPECT_EQ(16 + i, bytes[i]); in TEST()
127 const uint8_t bytes[16]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; in TEST() local
129 EXPECT_EQ("0102", BytesToHex((uint8_t*)bytes, 2)); in TEST()
[all …]
/system/netd/server/
DBandwidthController.h39 int setInterfaceSharedQuota(const std::string& iface, int64_t bytes);
40 int getInterfaceSharedQuota(int64_t *bytes);
43 int setInterfaceQuota(const std::string& iface, int64_t bytes);
44 int getInterfaceQuota(const std::string& iface, int64_t* bytes);
52 int setGlobalAlert(int64_t bytes);
57 int setInterfaceAlert(const std::string& iface, int64_t bytes);
88 int runIptablesAlertCmd(IptOp op, const std::string& alertName, int64_t bytes);
89 int runIptablesAlertFwdCmd(IptOp op, const std::string& alertName, int64_t bytes);
91 int updateQuota(const std::string& alertName, int64_t bytes);
93 int setCostlyAlert(const std::string& costName, int64_t bytes, int64_t* alertBytes);
DBandwidthController.cpp462 int BandwidthController::getInterfaceSharedQuota(int64_t *bytes) { in getInterfaceSharedQuota() argument
463 return getInterfaceQuota("shared", bytes); in getInterfaceSharedQuota()
466 int BandwidthController::getInterfaceQuota(const std::string& iface, int64_t* bytes) { in getInterfaceQuota() argument
477 auto rv = sys.fscanf(file.value().get(), "%" SCNd64, bytes); in getInterfaceQuota()
482 ALOGV("Read quota res=%d bytes=%" PRId64, rv.value(), *bytes); in getInterfaceQuota()
517 int BandwidthController::updateQuota(const std::string& quotaName, int64_t bytes) { in updateQuota() argument
533 sys.fprintf(file.value().get(), "%" PRId64 "\n", bytes).ignoreError(); in updateQuota()
538 int64_t bytes) { in runIptablesAlertCmd() argument
550 StringAppendF(&alertQuotaCmd, ALERT_IPT_TEMPLATE, opFlag, LOCAL_GLOBAL_ALERT, bytes, in runIptablesAlertCmd()
557 int BandwidthController::setGlobalAlert(int64_t bytes) { in setGlobalAlert() argument
[all …]
/system/update_engine/payload_consumer/
Dxor_extent_writer.cc28 bool XORExtentWriter::WriteXorCowOp(const uint8_t* bytes, in WriteXorCowOp() argument
49 bytes, in WriteXorCowOp()
60 bool XORExtentWriter::WriteXorExtent(const uint8_t* bytes, in WriteXorExtent() argument
89 WriteXorCowOp(bytes, in WriteXorExtent()
97 WriteXorCowOp(bytes + (xor_ext.num_blocks() - 1) * BlockSize(), in WriteXorExtent()
104 bytes, size, xor_ext, src_block * BlockSize() + merge_op->src_offset())); in WriteXorExtent()
109 bool XORExtentWriter::WriteExtent(const void* bytes, in WriteExtent() argument
145 static_cast<const unsigned char*>(bytes) + i * BlockSize(); in WriteExtent()
155 return WriteReplaceExtents(replace_extents, extent, bytes, size); in WriteExtent()
161 const void* bytes, in WriteReplaceExtents() argument
[all …]
Dblock_extent_writer.h38 bool Write(const void* bytes, size_t count) final;
42 virtual bool WriteExtent(const void* bytes,
48 bool WriteExtent(const void* bytes, size_t count);
50 [[nodiscard]] size_t ConsumeWithBuffer(const uint8_t* const bytes,
/system/core/debuggerd/libdebuggerd/
Dutility.cpp149 size_t bytes = memory->Read(*addr, reinterpret_cast<uint8_t*>(out), len); in dump_memory() local
150 if (bytes % sizeof(uintptr_t) != 0) { in dump_memory()
152 ALOGE("Bytes read %zu, is not a multiple of %zu", bytes, sizeof(uintptr_t)); in dump_memory()
153 bytes &= ~(sizeof(uintptr_t) - 1); in dump_memory()
157 if (bytes == 0) { in dump_memory()
169 if (bytes < len && !skip_2nd_read) { in dump_memory()
176 size_t bytes2 = memory->Read(*addr + bytes, static_cast<uint8_t*>(out) + bytes, len - bytes); in dump_memory()
177 bytes += bytes2; in dump_memory()
178 if (bytes2 > 0 && bytes % sizeof(uintptr_t) != 0) { in dump_memory()
180 ALOGE("Bytes after second read %zu, is not a multiple of %zu", bytes, sizeof(uintptr_t)); in dump_memory()
[all …]
/system/nfc/src/fuzzers/integration/fakes/
Dnfc_adaptation_libmain_fakes.cc14 std::vector<uint8_t> bytes = g_fuzzed_data->ConsumeBytes<uint8_t>(nbytes); in nfa_nv_co_read() local
15 memcpy(pBuffer, bytes.data(), bytes.size()); in nfa_nv_co_read()
16 nfa_nv_ci_read(bytes.size(), NFA_NV_CO_OK, block); in nfa_nv_co_read()
22 std::vector<uint8_t> bytes(pBuffer, pBuffer + nbytes); in nfa_nv_co_write() local
/system/server_configurable_flags/aconfigd/
Daconfigd_socket_test.cpp76 unsigned char bytes[4]; in send_message() local
78 bytes[0] = (msg_size >> 24) & 0xFF; in send_message()
79 bytes[1] = (msg_size >> 16) & 0xFF; in send_message()
80 bytes[2] = (msg_size >> 8) & 0xFF; in send_message()
81 bytes[3] = (msg_size >> 0) & 0xFF; in send_message()
83 auto num_bytes = TEMP_FAILURE_RETRY(send(*sock_fd, bytes, 4, 0)); in send_message()
94 num_bytes = TEMP_FAILURE_RETRY(recv(*sock_fd, bytes, 4, 0)); in send_message()
100 uint32_t(bytes[0]<<24 | bytes[1]<<16 | bytes[2]<<8 | bytes[3]); in send_message()
/system/libbase/
Dhex.cpp24 std::string HexString(const void* bytes, size_t len) { in HexString() argument
25 CHECK(bytes != nullptr || len == 0) << bytes << " " << len; in HexString()
28 const uint8_t* bytes8 = static_cast<const uint8_t*>(bytes); in HexString()
/system/libziparchive/
Dzip_archive_stream_entry.cc92 size_t bytes = (length_ > data_.size()) ? data_.size() : length_; in Read() local
95 auto res = archive->mapped_zip.ReadAtOffset(data_.data(), bytes, offset_); in Read()
107 data_.assign(res, res + bytes); in Read()
108 } else if (bytes < data_.size()) { in Read()
109 data_.resize(bytes); in Read()
113 length_ -= bytes; in Read()
114 offset_ += bytes; in Read()
224 auto bytes = std::min(uint32_t(in_.size()), compressed_length_); in Read() local
227 auto res = archive->mapped_zip.ReadAtOffset(in_.data(), bytes, offset_); in Read()
237 compressed_length_ -= bytes; in Read()
[all …]
/system/timezone/testing/src/main/java/libcore/timezone/testing/
DZoneInfoTestHelper.java321 byte[] bytes = baos.toByteArray(); in build()
322 setInt(bytes, indexOffsetOffset, in build()
324 setInt(bytes, dataOffsetOffset, in build()
326 setInt(bytes, finalOffsetOffset, in build()
328 return bytes; in build()
369 byte[] bytes = ByteBuffer.allocate(4).putInt(value).array(); in writeInt()
370 writeByteArray(os, bytes); in writeInt()
374 byte[] bytes = ByteBuffer.allocate(8).putLong(value).array(); in writeLong()
375 writeByteArray(os, bytes); in writeLong()
378 static void setInt(byte[] bytes, int offset, int value) { in setInt() argument
[all …]
/system/core/fs_mgr/libfs_avb/
Dutil.cpp52 bool HexToBytes(uint8_t* bytes, size_t bytes_len, const std::string& hex) { in HexToBytes() argument
53 CHECK(bytes != nullptr); in HexToBytes()
70 bytes[j] = (high << 4) | low; in HexToBytes()
75 std::string BytesToHex(const uint8_t* bytes, size_t bytes_len) { in BytesToHex() argument
76 CHECK(bytes != nullptr); in BytesToHex()
82 hex.push_back(hex_digits[(bytes[i] & 0xF0) >> 4]); in BytesToHex()
83 hex.push_back(hex_digits[bytes[i] & 0x0F]); in BytesToHex()
/system/gsid/
Dpartition_installer.cpp174 auto progress = [this](uint64_t bytes, uint64_t /* total */) -> bool { in CreateImage() argument
175 service_->UpdateProgress(IGsiService::STATUS_WORKING, bytes); in CreateImage()
190 bool PartitionInstaller::CommitGsiChunk(int stream_fd, int64_t bytes) { in CommitGsiChunk() argument
193 if (bytes < 0) { in CommitGsiChunk()
194 LOG(ERROR) << "chunk size " << bytes << " is negative"; in CommitGsiChunk()
202 uint64_t remaining = bytes; in CommitGsiChunk()
240 bool PartitionInstaller::CommitGsiChunk(const void* data, size_t bytes) { in CommitGsiChunk() argument
241 if (static_cast<uint64_t>(bytes) > size_ - gsi_bytes_written_) { in CommitGsiChunk()
243 LOG(ERROR) << "chunk size " << bytes << " exceeds remaining image size (" << size_ in CommitGsiChunk()
250 if (!android::base::WriteFully(system_device_->fd(), data, bytes)) { in CommitGsiChunk()
[all …]

1234567891011