/bootable/recovery/tests/unit/ |
D | package_test.cpp | 66 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F() local 67 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 0)); in TEST_F() 68 ASSERT_EQ(file_content_, std::string(buffer.begin(), buffer.end())); in TEST_F() 70 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size() - 10, 10)); in TEST_F() 71 ASSERT_EQ(file_content_.substr(10), std::string(buffer.begin(), buffer.end() - 10)); in TEST_F() 77 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F() local 79 ASSERT_FALSE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 10)); in TEST_F()
|
D | commands_test.cpp | 447 std::vector<uint8_t> buffer(source.blocks() * kBlockSize); in TEST() local 448 ASSERT_TRUE(source.ReadAll(&buffer, kBlockSize, block_reader, stash_reader)); in TEST() 449 ASSERT_EQ(source.blocks() * kBlockSize, buffer.size()); in TEST() 452 SHA1(buffer.data(), buffer.size(), digest); in TEST() 469 std::vector<uint8_t> buffer(source.blocks() * kBlockSize); in TEST() local 470 ASSERT_TRUE(source.ReadAll(&buffer, kBlockSize, block_reader, stash_reader)); in TEST() 471 ASSERT_EQ(source.blocks() * kBlockSize, buffer.size()); in TEST() 474 SHA1(buffer.data(), buffer.size(), digest); in TEST() 483 std::vector<uint8_t> buffer(source.blocks() * kBlockSize - 1); in TEST() local 484 ASSERT_FALSE(source.ReadAll(&buffer, kBlockSize, block_reader, stash_reader)); in TEST() [all …]
|
D | screen_ui_test.cpp | 306 void SetKeyBuffer(const std::vector<KeyCode>& buffer); 321 void TestableScreenRecoveryUI::SetKeyBuffer(const std::vector<KeyCode>& buffer) { in SetKeyBuffer() argument 322 key_buffer_ = buffer; in SetKeyBuffer()
|
/bootable/recovery/updater/ |
D | blockimg.cpp | 223 static void allocate(size_t size, std::vector<uint8_t>* buffer) { in allocate() argument 225 if (size <= buffer->size()) return; in allocate() 226 buffer->resize(size); in allocate() 426 uint8_t buffer[buffer_size]; in receive_brotli_new_data() local 429 uint8_t* next_out = buffer; in receive_brotli_new_data() 445 if (nti->writer->Write(buffer, write_now) != write_now) { in receive_brotli_new_data() 482 static int ReadBlocks(const RangeSet& src, std::vector<uint8_t>* buffer, int fd) { in ReadBlocks() argument 490 if (!android::base::ReadFully(fd, buffer->data() + p, size)) { in ReadBlocks() 502 static int WriteBlocks(const RangeSet& tgt, const std::vector<uint8_t>& buffer, int fd) { in WriteBlocks() argument 515 if (!android::base::WriteFully(fd, buffer.data() + written, size)) { in WriteBlocks() [all …]
|
D | commands.cpp | 331 std::vector<uint8_t>* buffer, size_t block_size, in ReadAll() argument 334 if (buffer->size() < blocks() * block_size) { in ReadAll() 340 if (block_reader(ranges_, buffer) != 0) { in ReadAll() 344 MoveRange(buffer, location_, *buffer, block_size); in ReadAll() 354 MoveRange(buffer, stash.ranges(), stash_buffer, block_size); in ReadAll() 359 void SourceInfo::DumpBuffer(const std::vector<uint8_t>& buffer, size_t block_size) const { in DumpBuffer() argument 366 CHECK_LE((buffer_index + 1) * block_size, buffer.size()); in DumpBuffer() 369 SHA1(buffer.data() + buffer_index * block_size, block_size, digest); in DumpBuffer()
|
D | install.cpp | 91 std::string buffer = android::base::Join(args, ""); in UIPrintFn() local 92 state->updater->UiPrint(buffer); in UIPrintFn() 93 return StringValue(buffer); in UIPrintFn() 175 std::string buffer; in PackageExtractFileFn() local 181 buffer.resize(entry.uncompressed_length); in PackageExtractFileFn() 184 ExtractToMemory(za, &entry, reinterpret_cast<uint8_t*>(&buffer[0]), buffer.size()); in PackageExtractFileFn() 188 zip_path.c_str(), buffer.size(), ErrorCodeString(ret)); in PackageExtractFileFn() 191 return new Value(Value::Type::BLOB, buffer); in PackageExtractFileFn() 570 std::string buffer; in FileGetPropFn() local 572 if (!updater_runtime->ReadFileToString(filename, &buffer)) { in FileGetPropFn() [all …]
|
/bootable/recovery/applypatch/ |
D | applypatch.cpp | 82 std::vector<unsigned char> buffer(partition.size); in ReadPartitionToBuffer() local 83 if (!android::base::ReadFully(dev, buffer.data(), buffer.size())) { in ReadPartitionToBuffer() 84 PLOG(ERROR) << "Failed to read " << buffer.size() << " bytes of data for partition " in ReadPartitionToBuffer() 87 SHA1(buffer.data(), buffer.size(), out->sha1); in ReadPartitionToBuffer() 89 out->data = std::move(buffer); in ReadPartitionToBuffer() 189 unsigned char buffer[4096]; in WriteBufferToPartition() local 191 for (size_t p = 0; p < len; p += sizeof(buffer)) { in WriteBufferToPartition() 193 if (to_read > sizeof(buffer)) { in WriteBufferToPartition() 194 to_read = sizeof(buffer); in WriteBufferToPartition() 197 if (!android::base::ReadFully(fd, buffer, to_read)) { in WriteBufferToPartition() [all …]
|
D | imgpatch.cpp | 87 std::vector<uint8_t> buffer(buffer_size); in ApplyBSDiffPatchAndStreamOutput() local 89 strm.next_out = buffer.data(); in ApplyBSDiffPatchAndStreamOutput() 103 if (sink(buffer.data(), have) != have) { in ApplyBSDiffPatchAndStreamOutput()
|
D | imgdiff.cpp | 416 std::vector<uint8_t> buffer(BUFFER_SIZE); in TryReconstruction() local 419 strm.avail_out = buffer.size(); in TryReconstruction() 420 strm.next_out = buffer.data(); in TryReconstruction() 427 size_t compressed_size = buffer.size() - strm.avail_out; in TryReconstruction() 428 if (memcmp(buffer.data(), input_file_ptr_->data() + start_ + offset, compressed_size) != 0) { in TryReconstruction()
|
/bootable/recovery/install/ |
D | package.cpp | 57 bool ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) override; 105 bool ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) override; 176 bool MemoryPackage::ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) { in ReadFullyAtOffset() argument 182 memcpy(buffer, addr_ + offset, byte_count); in ReadFullyAtOffset() 227 bool FilePackage::ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) { in ReadFullyAtOffset() argument 234 if (!android::base::ReadFullyAtOffset(fd_.get(), buffer, byte_count, offset)) { in ReadFullyAtOffset() 253 std::vector<uint8_t> buffer(read_size); in UpdateHashAtOffset() local 254 if (!ReadFullyAtOffset(buffer.data(), read_size, start + so_far)) { in UpdateHashAtOffset() 259 hasher(buffer.data(), read_size); in UpdateHashAtOffset()
|
D | adb_install.cpp | 158 char buffer[kMinadbdMessageSize]; in HandleMessageFromMinadbd() local 159 if (!android::base::ReadFully(socket_fd, buffer, kMinadbdMessageSize)) { in HandleMessageFromMinadbd() 164 std::string message(buffer, buffer + kMinadbdMessageSize); in HandleMessageFromMinadbd()
|
D | install.cpp | 456 char buffer[1024]; in TryUpdateBinary() local 458 while (fgets(buffer, sizeof(buffer), from_child) != nullptr) { in TryUpdateBinary() 459 std::string line(buffer); in TryUpdateBinary()
|
/bootable/recovery/fuse_sideload/include/ |
D | fuse_provider.h | 44 virtual bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, 68 bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, 93 bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size,
|
/bootable/recovery/minadbd/ |
D | fuse_adb_provider.cpp | 26 bool FuseAdbDataProvider::ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, in ReadBlockAlignedData() argument 33 if (!ReadFdExactly(fd_, buffer, fetch_size)) { in ReadBlockAlignedData()
|
D | minadbd_services.cpp | 83 char buffer[kMinadbdMessageSize]; in WaitForCommandStatus() local 84 if (!android::base::ReadFully(fd, buffer, kMinadbdMessageSize)) { in WaitForCommandStatus() 89 std::string message(buffer, buffer + kMinadbdMessageSize); in WaitForCommandStatus()
|
D | fuse_adb_provider.h | 29 bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size,
|
/bootable/recovery/fuse_sideload/ |
D | fuse_provider.cpp | 57 bool FuseFileDataProvider::ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, in ReadBlockAlignedData() argument 68 if (!android::base::ReadFullyAtOffset(fd_, buffer, fetch_size, offset)) { in ReadBlockAlignedData() 93 bool FuseBlockDataProvider::ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, in ReadBlockAlignedData() argument 108 uint8_t* next_out = buffer; in ReadBlockAlignedData()
|
/bootable/recovery/ |
D | recovery-persist.cpp | 92 std::string buffer(buf, len); in logsave() local 98 if (buffer.compare(content) == 0) { in logsave() 110 return android::base::WriteStringToFile(buffer, destination.c_str()); in logsave()
|
/bootable/recovery/install/include/private/ |
D | asn1_decoder.h | 25 asn1_context(const uint8_t* buffer, size_t length) : p_(buffer), length_(length), app_type_(0) {} in asn1_context() argument
|
/bootable/libbootloader/libxbc/ |
D | libxbc.c | 33 static uint32_t checksum(const unsigned char* const buffer, uint32_t size) { in checksum() argument 36 sum += buffer[i]; in checksum()
|
/bootable/recovery/otautil/ |
D | rangeset.cpp | 124 RangeSet buffer; in Split() local 130 buffer.PushBack({ range.first, range.first + needed }); in Split() 134 buffer.PushBack(range); in Split() 141 result.push_back(std::move(buffer)); in Split()
|
/bootable/recovery/recovery_utils/ |
D | logging.cpp | 249 std::string buffer(klog_buf_len, 0); in save_kernel_log() local 250 int n = klogctl(KLOG_READ_ALL, &buffer[0], klog_buf_len); in save_kernel_log() 255 buffer.resize(n); in save_kernel_log() 256 android::base::WriteStringToFile(buffer, destination); in save_kernel_log()
|
/bootable/recovery/install/include/install/ |
D | verifier.h | 70 virtual bool ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) = 0;
|
/bootable/recovery/updater/include/private/ |
D | commands.h | 123 std::vector<uint8_t>* buffer, size_t block_size, 132 void DumpBuffer(const std::vector<uint8_t>& buffer, size_t block_size) const;
|
/bootable/recovery/uncrypt/ |
D | uncrypt.cpp | 145 static int write_at_offset(unsigned char* buffer, size_t size, int wfd, off64_t offset) { in write_at_offset() argument 150 if (!android::base::WriteFully(wfd, buffer, size)) { in write_at_offset()
|