Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 27) sorted by relevance

12

/bootable/recovery/tests/unit/
Dpackage_test.cpp66 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()
Dcommands_test.cpp447 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 …]
Dscreen_ui_test.cpp306 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/minadbd/
Dfuse_adb_provider.cpp26 bool FuseAdbDataProvider::ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, in ReadBlockAlignedData() argument
33 if (!ReadFdExactly(fd_, buffer, fetch_size)) { in ReadBlockAlignedData()
Dfuse_adb_provider.h29 bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size,
Dminadbd_services.cpp82 char buffer[kMinadbdMessageSize]; in WaitForCommandStatus() local
83 if (!android::base::ReadFully(fd, buffer, kMinadbdMessageSize)) { in WaitForCommandStatus()
88 std::string message(buffer, buffer + kMinadbdMessageSize); in WaitForCommandStatus()
/bootable/recovery/install/
Dpackage.cpp49 bool ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) override;
89 bool ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) override;
160 bool MemoryPackage::ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) { in ReadFullyAtOffset() argument
166 memcpy(buffer, addr_ + offset, byte_count); in ReadFullyAtOffset()
211 bool FilePackage::ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) { in ReadFullyAtOffset() argument
218 if (!android::base::ReadFullyAtOffset(fd_.get(), buffer, byte_count, offset)) { in ReadFullyAtOffset()
237 std::vector<uint8_t> buffer(read_size); in UpdateHashAtOffset() local
238 if (!ReadFullyAtOffset(buffer.data(), read_size, start + so_far)) { in UpdateHashAtOffset()
243 hasher(buffer.data(), read_size); in UpdateHashAtOffset()
Dadb_install.cpp154 char buffer[kMinadbdMessageSize]; in HandleMessageFromMinadbd() local
155 if (!android::base::ReadFully(socket_fd, buffer, kMinadbdMessageSize)) { in HandleMessageFromMinadbd()
160 std::string message(buffer, buffer + kMinadbdMessageSize); in HandleMessageFromMinadbd()
Dinstall.cpp425 char buffer[1024]; in try_update_binary() local
427 while (fgets(buffer, sizeof(buffer), from_child) != nullptr) { in try_update_binary()
428 std::string line(buffer); in try_update_binary()
/bootable/recovery/applypatch/
Dapplypatch.cpp82 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 …]
Dimgpatch.cpp87 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()
Dimgdiff.cpp416 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/updater/
Dblockimg.cpp218 static void allocate(size_t size, std::vector<uint8_t>* buffer) { in allocate() argument
220 if (size <= buffer->size()) return; in allocate()
221 buffer->resize(size); in allocate()
421 uint8_t buffer[buffer_size]; in receive_brotli_new_data() local
424 uint8_t* next_out = buffer; in receive_brotli_new_data()
440 if (nti->writer->Write(buffer, write_now) != write_now) { in receive_brotli_new_data()
477 static int ReadBlocks(const RangeSet& src, std::vector<uint8_t>* buffer, int fd) { in ReadBlocks() argument
485 if (!android::base::ReadFully(fd, buffer->data() + p, size)) { in ReadBlocks()
497 static int WriteBlocks(const RangeSet& tgt, const std::vector<uint8_t>& buffer, int fd) { in WriteBlocks() argument
510 if (!android::base::WriteFully(fd, buffer.data() + written, size)) { in WriteBlocks()
[all …]
Dcommands.cpp332 std::vector<uint8_t>* buffer, size_t block_size, in ReadAll() argument
335 if (buffer->size() < blocks() * block_size) { in ReadAll()
341 if (block_reader(ranges_, buffer) != 0) { in ReadAll()
345 MoveRange(buffer, location_, *buffer, block_size); in ReadAll()
355 MoveRange(buffer, stash.ranges(), stash_buffer, block_size); in ReadAll()
360 void SourceInfo::DumpBuffer(const std::vector<uint8_t>& buffer, size_t block_size) const { in DumpBuffer() argument
367 CHECK_LE((buffer_index + 1) * block_size, buffer.size()); in DumpBuffer()
370 SHA1(buffer.data() + buffer_index * block_size, block_size, digest); in DumpBuffer()
Dinstall.cpp68 static void uiPrint(State* state, const std::string& buffer) { in uiPrint() argument
73 std::vector<std::string> lines = android::base::Split(buffer, "\n"); in uiPrint()
83 LOG(INFO) << buffer; in uiPrint()
105 std::string buffer = android::base::Join(args, ""); in UIPrintFn() local
106 uiPrint(state, buffer); in UIPrintFn()
107 return StringValue(buffer); in UIPrintFn()
184 std::string buffer; in PackageExtractFileFn() local
185 buffer.resize(entry.uncompressed_length); in PackageExtractFileFn()
188 ExtractToMemory(za, &entry, reinterpret_cast<uint8_t*>(&buffer[0]), buffer.size()); in PackageExtractFileFn()
192 zip_path.c_str(), buffer.size(), ErrorCodeString(ret)); in PackageExtractFileFn()
[all …]
/bootable/recovery/install/include/private/
Dasn1_decoder.h25 asn1_context(const uint8_t* buffer, size_t length) : p_(buffer), length_(length), app_type_(0) {} in asn1_context() argument
/bootable/recovery/fuse_sideload/include/
Dfuse_provider.h41 virtual bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size,
60 bool ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size,
/bootable/recovery/fuse_sideload/
Dfuse_provider.cpp49 bool FuseFileDataProvider::ReadBlockAlignedData(uint8_t* buffer, uint32_t fetch_size, in ReadBlockAlignedData() argument
60 if (!android::base::ReadFullyAtOffset(fd_, buffer, fetch_size, offset)) { in ReadBlockAlignedData()
/bootable/recovery/
Drecovery-persist.cpp94 std::string buffer(buf, len); in logsave() local
100 if (buffer.compare(content) == 0) { in logsave()
112 return android::base::WriteStringToFile(buffer, destination.c_str()); in logsave()
/bootable/recovery/boot_control/
Dboot_control.cpp94 bool LoadBootloaderControl(const char* misc_device, bootloader_control* buffer) { in LoadBootloaderControl() argument
104 if (!android::base::ReadFully(fd.get(), buffer, sizeof(bootloader_control))) { in LoadBootloaderControl()
111 bool UpdateAndSaveBootloaderControl(const char* misc_device, bootloader_control* buffer) { in UpdateAndSaveBootloaderControl() argument
112 buffer->crc32_le = BootloaderControlLECRC(buffer); in UpdateAndSaveBootloaderControl()
122 if (!android::base::WriteFully(fd.get(), buffer, sizeof(bootloader_control))) { in UpdateAndSaveBootloaderControl()
/bootable/recovery/otautil/
Drangeset.cpp124 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()
Dlogging.cpp250 std::string buffer(klog_buf_len, 0); in save_kernel_log() local
251 int n = klogctl(KLOG_READ_ALL, &buffer[0], klog_buf_len); in save_kernel_log()
256 buffer.resize(n); in save_kernel_log()
257 android::base::WriteStringToFile(buffer, destination); in save_kernel_log()
/bootable/recovery/install/include/install/
Dverifier.h70 virtual bool ReadFullyAtOffset(uint8_t* buffer, uint64_t byte_count, uint64_t offset) = 0;
/bootable/recovery/updater/include/private/
Dcommands.h123 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/
Duncrypt.cpp145 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()

12