Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 60) sorted by relevance

123

/bootable/recovery/bootloader_message/
Dbootloader_message.cpp85 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition() argument
101 if (!android::base::ReadFully(fd, p, size)) { in read_misc_partition()
109 static bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition() argument
122 if (!android::base::WriteFully(fd, p, size)) { in write_misc_partition()
223 bool read_wipe_package(std::string* package_data, size_t size, std::string* err) { in read_wipe_package() argument
228 package_data->resize(size); in read_wipe_package()
229 return read_misc_partition(&(*package_data)[0], size, misc_blk_device, in read_wipe_package()
238 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package()
242 static bool OffsetAndSizeInVendorSpace(size_t offset, size_t size) { in OffsetAndSizeInVendorSpace() argument
244 return size <= total_size && offset <= total_size - size; in OffsetAndSizeInVendorSpace()
[all …]
/bootable/recovery/updater/
Dinstall.cpp116 if (argv.size() < 1 || argv.size() > 2) { in PackageExtractFileFn()
118 argv.size()); in PackageExtractFileFn()
121 if (argv.size() == 2) { in PackageExtractFileFn()
127 argv.size()); in PackageExtractFileFn()
172 argv.size()); 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()
209 if (argv.size() != 2) { in PatchPartitionCheckFn()
211 "%s(): Invalid number of args (expected 2, got %zu)", name, argv.size()); in PatchPartitionCheckFn()
245 if (argv.size() != 3) { in PatchPartitionFn()
[all …]
Dcommands.cpp93 if (tokens.size() < 3) { in ParseTargetInfoAndSourceInfo()
127 if (pos >= tokens.size()) { in ParseTargetInfoAndSourceInfo()
152 while (pos < tokens.size()) { in ParseTargetInfoAndSourceInfo()
156 if (pairs.size() != 2) { in ParseTargetInfoAndSourceInfo()
196 if (pos + 1 != tokens.size()) { in Parse()
198 tokens.size() - pos); in Parse()
209 if (pos + 2 != tokens.size()) { in Parse()
211 tokens.size() - pos); in Parse()
223 if (pos + 1 != tokens.size()) { in Parse()
225 tokens.size() - pos); in Parse()
[all …]
Ddynamic_partitions.cpp65 if (argv.size() != arg_names.size()) { in ReadStringArgs()
67 arg_names.size(), argv.size()); in ReadStringArgs()
76 CHECK_EQ(args.size(), arg_names.size()); in ReadStringArgs()
78 for (size_t i = 0; i < arg_names.size(); ++i) { in ReadStringArgs()
144 bool ExpectArgSize(size_t size) const { in ExpectArgSize()
146 auto actual = tokens.size() - 1; in ExpectArgSize()
147 if (actual != size) { in ExpectArgSize()
148 LOG(ERROR) << "Op " << op() << " expects " << size << " args, got " << actual; in ExpectArgSize()
158 CHECK_LE(pos + 1, tokens.size()); in arg()
178 auto size = params.uint_arg(1, "size"); in PerformOpResize() local
[all …]
Dblockimg.cpp109 if (lines.size() != 2) { in ParseLastCommandFile()
190 static bool discard_blocks(int fd, off64_t offset, uint64_t size, bool force = false) { in discard_blocks() argument
196 uint64_t args[2] = { static_cast<uint64_t>(offset), size }; in discard_blocks()
218 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()
236 CHECK_NE(tgt.size(), static_cast<size_t>(0)); in RangeSinkWriter()
240 return next_range_ == tgt_.size() && current_range_left_ == 0; in Finished()
248 size_t Write(const uint8_t* data, size_t size) { in Write() argument
250 LOG(ERROR) << "range sink write overrun; can't write " << size << " bytes"; in Write()
[all …]
/bootable/recovery/applypatch/
Dapplypatch.cpp65 SHA1(file->data.data(), file->data.size(), file->sha1); in LoadFileContents()
82 std::vector<unsigned char> buffer(partition.size); in ReadPartitionToBuffer()
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()
117 if (!android::base::WriteFully(fd, file->data.data(), file->data.size())) { in SaveFileContents()
118 PLOG(ERROR) << "Failed to write " << file->data.size() << " bytes of data to " << filename; in SaveFileContents()
138 size_t len = file_contents.data.size(); in WriteBufferToPartition()
342 size_t header_bytes_read = patch.data.size(); in GenerateTarget()
354 if (!CheckAndFreeSpaceOnCache(source_file.data.size())) { in GenerateTarget()
[all …]
Dimgdiff.cpp270 CHECK_LE(start_ + raw_data_len_, input_file_ptr_->size()); in GetRawData()
283 return uncompressed_data_.size(); in DataLengthForPatch()
408 strm.avail_in = uncompressed_data_.size(); in TryReconstruction()
419 strm.avail_out = buffer.size(); in TryReconstruction()
427 size_t compressed_size = buffer.size() - strm.avail_out; in TryReconstruction()
491 return 4 + 4 + data_.size(); in GetHeaderSize()
504 target_start_, target_len_, data_.size()); in WriteHeaderToFd()
508 return offset + data_.size(); in WriteHeaderToFd()
511 target_start_, target_len_, data_.size()); in WriteHeaderToFd()
522 return offset + data_.size(); in WriteHeaderToFd()
[all …]
Dbspatch.cpp70 CHECK_LE(patch_offset, patch.data.size()); in ApplyBSDiffPatch()
74 patch.data.size() - patch_offset, sink); in ApplyBSDiffPatch()
81 patch.data.size() - patch_offset, digest); in ApplyBSDiffPatch()
Dimgpatch.cpp144 if (patch.data.size() < 12) { in ApplyImagePatch()
161 if (pos + 4 > patch.data.size()) { in ApplyImagePatch()
171 if (pos > patch.data.size()) { in ApplyImagePatch()
193 if (pos > patch.data.size()) { in ApplyImagePatch()
200 if (pos + data_len > patch.data.size()) { in ApplyImagePatch()
215 if (pos > patch.data.size()) { in ApplyImagePatch()
236 size_t bonus_size = (i == 1 && bonus_data != nullptr) ? bonus_data->data.size() : 0; in ApplyImagePatch()
/bootable/recovery/tests/unit/
Dpackage_test.cpp48 ASSERT_EQ(0, writer.WriteBytes(entry.c_str(), entry.size())); in SetUp()
66 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F()
67 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 0)); in TEST_F()
70 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size() - 10, 10)); in TEST_F()
77 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F()
79 ASSERT_FALSE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 10)); in TEST_F()
85 uint64_t hash_size = file_content_.size() / 2; in TEST_F()
113 std::vector<uint8_t> extracted(entry_name.size()); in TEST_F()
114 ASSERT_EQ(0, ExtractToMemory(zip, &entry, extracted.data(), extracted.size())); in TEST_F()
/bootable/recovery/tests/component/
Dbootloader_message_test.cpp108 ASSERT_GE(expected.size(), sizeof(boot.recovery)); in TEST()
129 ASSERT_TRUE(WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), 0, &err)); in TEST()
132 message.resize(kTestMessage.size()); in TEST()
133 ASSERT_TRUE(ReadMiscPartitionVendorSpace(message.data(), message.size(), 0, &err)); in TEST()
138 ASSERT_TRUE(ReadMiscPartitionVendorSpace(message.data(), message.size(), 0, &err)); in TEST()
143 WIPE_PACKAGE_OFFSET_IN_MISC - VENDOR_SPACE_OFFSET_IN_MISC - kTestMessage.size(); in TEST()
145 WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), start_offset, &err)); in TEST()
148 ASSERT_FALSE(WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), in TEST()
153 ASSERT_FALSE(WriteMiscPartitionVendorSpace(long_message.data(), long_message.size(), 0, &err)); in TEST()
Dimgdiff_test.cpp41 const size_t size = patch.size(); in verify_patch_header() local
44 ASSERT_GE(size, 12U); in verify_patch_header()
56 ASSERT_LE(pos + 4, size); in verify_patch_header()
61 ASSERT_LE(pos, size); in verify_patch_header()
64 ASSERT_LE(pos + 4, size); in verify_patch_header()
68 ASSERT_LE(pos, size); in verify_patch_header()
72 ASSERT_LE(pos, size); in verify_patch_header()
86 ASSERT_EQ(0, ApplyImagePatch(reinterpret_cast<const unsigned char*>(src.data()), src.size(), in GenerateTarget()
87 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in GenerateTarget()
131 ASSERT_EQ(0, imgdiff(args.size(), args.data())); in TEST()
[all …]
Dapplypatch_modes_test.cpp48 SHA1(reinterpret_cast<const uint8_t*>(data.c_str()), data.size(), digest); in GetEmmcTargetString()
51 std::to_string(data.size()) + ":" + print_sha1(digest); in GetEmmcTargetString()
82 return applypatch_modes(args_to_call.size() - 1, args_to_call.data()); in InvokeApplyPatchModes()
87 ASSERT_EQ(4, pieces.size()); in VerifyPatchedTarget()
143 bsdiff::bsdiff(reinterpret_cast<const uint8_t*>(src_content.data()), src_content.size(), in TEST_F()
144 reinterpret_cast<const uint8_t*>(tgt_content.data()), tgt_content.size(), in TEST_F()
Duncrypt_test.cpp109 int length = static_cast<int>(message.size()); in SetupOrClearBcb()
140 ASSERT_LE(message_in_bcb.size(), sizeof(boot.recovery)); in SetupOrClearBcb()
141 size_t left = sizeof(boot.recovery) - message_in_bcb.size(); in SetupOrClearBcb()
142 ASSERT_EQ(std::string(left, '\0'), std::string(&boot.recovery[message_in_bcb.size()], left)); in SetupOrClearBcb()
176 memcpy(&boot, random_data.c_str(), random_data.size()); in TEST_F()
Dupdater_test.cpp96 ASSERT_EQ(0, zip_writer.WriteBytes(entry.second.data(), entry.second.size())); in BuildUpdatePackage()
139 SHA1(reinterpret_cast<const uint8_t*>(content.data()), content.size(), digest); in GetSha1()
145 if (argv.size() != 1) { in BlobToString()
146 return ErrorAbort(state, kArgsParsingFailure, "%s() expects 1 arg, got %zu", name, argv.size()); in BlobToString()
225 size_t source_size = source_content.size(); in TEST_F()
232 size_t target_size = target_content.size(); in TEST_F()
391 ASSERT_EQ(129 * 4096, data.size()); in TEST_F()
416 ASSERT_EQ(129 * 4096, updated.size()); in TEST_F()
427 SHA256(hash_tree.data(), hash_tree.size(), digest.data()); in TEST_F()
438 ASSERT_EQ(129 * 4096, data.size()); in TEST_F()
[all …]
/bootable/recovery/tests/manual/
Drecovery_test.cpp44 EXPECT_EQ(kInjectTxtContent.size(), len); in __pmsg_fn()
59 kInjectTxtContent.c_str(), kInjectTxtContent.size())); in TEST()
64 EXPECT_EQ(static_cast<ssize_t>(kInjectTxtContent.size()), ret); in TEST()
77 kInjectTxtContent.c_str(), kInjectTxtContent.size())); in TEST()
/bootable/recovery/applypatch/include/applypatch/
Dapplypatch.h51 Partition(const std::string& name, size_t size, const std::string& hash) in Partition()
52 : name(name), size(size), hash(hash) {} in Partition()
66 size_t size; member
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/
DPayloadSpec.java105 public Builder size(long size) { in size() argument
106 this.mSize = size; in size()
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/util/
DPayloadSpecs.java97 .size(payloadSize) in forNonStreaming()
107 long size, in forStreaming() argument
112 .size(size) in forStreaming()
/bootable/recovery/edify/
Dexpr.cpp83 for (size_t i = 0; i < argv.size(); ++i) { in ConcatFn()
95 if (argv.size() != 2 && argv.size() != 3) { in IfElseFn()
107 } else if (argv.size() == 3) { in IfElseFn()
125 for (size_t i = 0; i < argv.size(); ++i) { in AssertFn()
155 for (size_t i = 0; i < argv.size(); ++i) { in StdoutFn()
256 if (argv.size() != 2) { in LessThanIntFn()
284 if (argv.size() != 2) { in GreaterThanIntFn()
354 return ReadArgs(state, argv, args, 0, argv.size()); in ReadArgs()
362 if (start + len > argv.size()) { in ReadArgs()
380 return ReadValueArgs(state, argv, args, 0, argv.size()); in ReadValueArgs()
[all …]
/bootable/recovery/fuse_sideload/
Dfuse_sideload.cpp152 static void fill_attr(fuse_attr* attr, const fuse_data* fd, uint64_t nodeid, uint64_t size, in fill_attr() argument
161 attr->size = size; in fill_attr()
162 attr->blocks = (size == 0) ? 0 : (((size - 1) / attr->blksize) + 1); in fill_attr()
284 uint32_t size = req->size; in handle_read() local
295 outhdr.len = sizeof(outhdr) + size; in handle_read()
318 if (size + block_offset <= fd->block_size) { in handle_read()
322 vec[1].iov_len = size; in handle_read()
334 vec[2].iov_len = size - vec[1].iov_len; in handle_read()
/bootable/recovery/otautil/
Dsysutil.cpp46 if (lines.size() < 4) { in ParseBlockMapFile()
47 LOG(ERROR) << "Block map file is too short: " << lines.size(); in ParseBlockMapFile()
73 lines.size() != 3 + range_count) { in ParseBlockMapFile()
75 << ", range_count " << range_count << ", lines " << lines.size(); in ParseBlockMapFile()
175 LOG(INFO) << "mmapped " << block_map_data.block_ranges().size() << " ranges"; in MapBlockFile()
226 std::vector<char*> result(args.size()); in StringVectorToNullTerminatedArray()
/bootable/recovery/updater_sample/tests/src/com/example/android/systemupdatersample/util/
DPayloadSpecsTest.java88 assertEquals(4, spec.getProperties().size()); in forNonStreaming_works()
104 long size = 200; in forStreaming_works() local
107 PayloadSpec spec = mPayloadSpecs.forStreaming(url, offset, size, propertiesFile); in forStreaming_works()
110 assertEquals("same size", size, spec.getSize()); in forStreaming_works()
/bootable/recovery/updater_sample/tools/
Dtest_gen_update_config.py39 filename, offset, size = prop['filename'], prop['offset'], prop['size']
41 raw_data = pkg_file.read(size)
/bootable/recovery/bootloader_message/include/bootloader_message/
Dbootloader_message.h227 bool read_wipe_package(std::string* package_data, size_t size, std::string* err);
234 bool ReadMiscPartitionVendorSpace(void* data, size_t size, size_t offset, std::string* err);
238 bool WriteMiscPartitionVendorSpace(const void* data, size_t size, size_t offset, std::string* err);

123