Home
last modified time | relevance | path

Searched refs:data (Results 1 – 25 of 62) sorted by relevance

123

/bootable/recovery/tests/unit/
Dasn1_decoder_test.cpp55 uint8_t data[] = { 0xA5, 0x02, 0x06, 0x01, 0x01 }; in TEST() local
56 asn1_context ctx(data, sizeof(data)); in TEST()
66 uint8_t data[] = { 0xA5, 0x03, 0x06, 0x01, 0x01 }; in TEST() local
67 asn1_context ctx(data, sizeof(data)); in TEST()
85 uint8_t data[] = { 0xA0, 0x03, 0x02, 0x01, 0x01, 0xA1, 0x03, 0x02, 0x01, 0x01, 0x06, 0x01, 0xA5 }; in TEST() local
86 asn1_context ctx(data, sizeof(data)); in TEST()
102 uint8_t data[] = { 0x30, 0x02, 0x06, 0x01, 0x01 }; in TEST() local
103 asn1_context ctx(data, sizeof(data)); in TEST()
112 uint8_t data[] = { 0x30, 0x03, 0x06, 0x01, 0x01 }; in TEST() local
113 asn1_context ctx(data, sizeof(data)); in TEST()
[all …]
Dminui_test.cpp30 ASSERT_EQ(0, reinterpret_cast<uintptr_t>(surface->data()) % GRSurface::kSurfaceDataAlignment); in TEST()
48 image->data()[i] = rand() % 128; in TEST()
52 ASSERT_EQ(std::vector(image->data(), image->data() + image->data_size()), in TEST()
53 std::vector(image_copy->data(), image_copy->data() + image->data_size())); in TEST()
Dapplypatch_modes_test.cpp41 std::string data; in GetEmmcTargetString() local
42 if (!android::base::ReadFileToString(filename, &data)) { in GetEmmcTargetString()
48 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()
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()
Dpackage_test.cpp67 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()
79 ASSERT_FALSE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 10)); in TEST_F()
87 SHA1(reinterpret_cast<uint8_t*>(file_content_.data()), hash_size, expected_sha.data()); in TEST_F()
97 SHA1_Final(calculated_sha.data(), &ctx); in TEST_F()
113 ASSERT_EQ(0, ExtractToMemory(zip, &entry, extracted.data(), extracted.size())); in TEST_F()
Dupdater_test.cpp100 ASSERT_EQ(0, zip_writer.WriteBytes(entry.second.data(), entry.second.size())); in BuildUpdatePackage()
111 SHA1(reinterpret_cast<const uint8_t*>(content.data()), content.size(), digest); in GetSha1()
190 ASSERT_TRUE(android::base::ParseInt(line.data(), &received_cause_code)); in RunBlockImageUpdate()
361 std::string data; in TEST_F() local
362 ASSERT_TRUE(android::base::ReadFileToString(temp_file1.path, &data)); in TEST_F()
363 ASSERT_EQ(kATxtContents, data); in TEST_F()
369 ASSERT_TRUE(android::base::ReadFileToString(temp_file1.path, &data)); in TEST_F()
370 ASSERT_EQ(kBTxtContents, data); in TEST_F()
415 std::string data; in TEST_F() local
417 data += std::string(4096, i); in TEST_F()
[all …]
Dapplypatch_test.cpp52 source_size = boot_fc.data.size(); in SetUp()
58 target_size = recovery_fc.data.size(); in SetUp()
138 Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend())); in TEST_F()
142 Value bonus(Value::Type::BLOB, std::string(bonus_fc.data.cbegin(), bonus_fc.data.cend())); in TEST_F()
152 Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend())); in TEST_F()
Dfuse_provider_test.cpp71 ASSERT_TRUE(block_map_data->ReadBlockAlignedData(result.data(), 2000, 1)); in TEST()
75 ASSERT_TRUE(block_map_data->ReadBlockAlignedData(result.data(), 20000, 0)); in TEST()
99 ASSERT_FALSE(block_map_data->ReadBlockAlignedData(result.data(), 20000, 2)); in TEST()
100 ASSERT_TRUE(block_map_data->ReadBlockAlignedData(result.data(), 20000, 1)); in TEST()
/bootable/recovery/applypatch/
Dapplypatch.cpp58 std::string data; in LoadFileContents() local
59 if (!android::base::ReadFileToString(filename, &data)) { in LoadFileContents()
64 file->data = std::vector<unsigned char>(data.begin(), data.end()); in LoadFileContents()
65 SHA1(file->data.data(), file->data.size(), file->sha1); in LoadFileContents()
83 if (!android::base::ReadFully(dev, buffer.data(), buffer.size())) { in ReadPartitionToBuffer()
87 SHA1(buffer.data(), buffer.size(), out->sha1); in ReadPartitionToBuffer()
89 out->data = std::move(buffer); 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()
137 const unsigned char* data = file_contents.data.data(); in WriteBufferToPartition() local
[all …]
Dimgpatch.cpp82 &ret, &sink](const uint8_t* data, size_t len) -> size_t { in ApplyBSDiffPatchAndStreamOutput() argument
85 strm.next_in = data; in ApplyBSDiffPatchAndStreamOutput()
89 strm.next_out = buffer.data(); in ApplyBSDiffPatchAndStreamOutput()
103 if (sink(buffer.data(), have) != have) { in ApplyBSDiffPatchAndStreamOutput()
144 if (patch.data.size() < 12) { in ApplyImagePatch()
151 const char* const patch_header = patch.data.data(); 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()
[all …]
Dbspatch.cpp70 CHECK_LE(patch_offset, patch.data.size()); in ApplyBSDiffPatch()
73 reinterpret_cast<const uint8_t*>(&patch.data[patch_offset]), in ApplyBSDiffPatch()
74 patch.data.size() - patch_offset, sink); in ApplyBSDiffPatch()
80 SHA1(reinterpret_cast<const uint8_t*>(patch.data.data() + patch_offset), in ApplyBSDiffPatch()
81 patch.data.size() - patch_offset, digest); in ApplyBSDiffPatch()
Dimgdiff.cpp271 return input_file_ptr_->data() + start_; in GetRawData()
276 return uncompressed_data_.data(); in DataForPatch()
301 void ImageChunk::SetUncompressedData(std::vector<uint8_t> data) { in SetUncompressedData() argument
302 uncompressed_data_ = std::move(data); in SetUncompressedData()
369 if (!android::base::ReadFully(patch_fd, patch_data->data(), sz)) { in MakePatch()
409 strm.next_in = uncompressed_data_.data(); in TryReconstruction()
420 strm.next_out = buffer.data(); in TryReconstruction()
428 if (memcmp(buffer.data(), input_file_ptr_->data() + start_ + offset, compressed_size) != 0) { in TryReconstruction()
444 PatchChunk::PatchChunk(const ImageChunk& tgt, const ImageChunk& src, std::vector<uint8_t> data) in PatchChunk() argument
453 data_(std::move(data)) {} in PatchChunk()
[all …]
/bootable/recovery/fuse_sideload/
Dfuse_sideload.cpp98 static void fuse_reply(const fuse_data* fd, uint64_t unique, const void* data, size_t len) { in fuse_reply() argument
107 vec[1].iov_base = const_cast<void*>(data); in fuse_reply()
116 static int handle_init(void* data, fuse_data* fd, const fuse_in_header* hdr) { in handle_init() argument
117 const fuse_init_in* req = static_cast<const fuse_init_in*>(data); in handle_init()
184 static int handle_lookup(void* data, const fuse_data* fd, const fuse_in_header* hdr) { in handle_lookup() argument
185 if (data == nullptr) return -ENOENT; in handle_lookup()
191 std::string filename(static_cast<const char*>(data)); in handle_lookup()
261 SHA256(fd->block_data, fd->block_size, hash.data()); in fetch_block()
279 static int handle_read(void* data, fuse_data* fd, const fuse_in_header* hdr) { in handle_read() argument
282 const fuse_read_in* req = static_cast<const fuse_read_in*>(data); in handle_read()
[all …]
/bootable/recovery/minadbd/
Dminadbd_services_test.cpp67 ASSERT_TRUE(android::base::ReadFully(fd, received.data(), kMinadbdMessageSize)); in ReadAndCheckCommandMessage()
70 memcpy(expected.data(), kMinadbdCommandPrefix, strlen(kMinadbdCommandPrefix)); in ReadAndCheckCommandMessage()
71 memcpy(expected.data() + strlen(kMinadbdCommandPrefix), &expected_command, in ReadAndCheckCommandMessage()
103 memcpy(status_message.data(), kMinadbdStatusPrefix, strlen(kMinadbdStatusPrefix)); in WriteMinadbdCommandStatus()
104 memcpy(status_message.data() + strlen(kMinadbdStatusPrefix), &status, sizeof(status)); in WriteMinadbdCommandStatus()
106 android::base::WriteFully(recovery_socket_, status_message.data(), kMinadbdMessageSize)); in WriteMinadbdCommandStatus()
178 if (!android::base::ReadFully(fd, content_from_fuse.data(), 4096)) { in TEST_F()
195 ASSERT_TRUE(android::base::ReadFully(fd, adb_message.data(), 8)); in TEST_F()
197 ASSERT_TRUE(android::base::WriteFully(fd, content.data(), 4096)); in TEST_F()
Dfuse_adb_provider_test.cpp35 FuseAdbDataProvider data(std::move(device_socket), 0, 0); in TEST() local
49 ASSERT_TRUE(data.ReadBlockAlignedData(reinterpret_cast<uint8_t*>(block_data), in TEST()
75 FuseAdbDataProvider data(std::move(device_socket), 0, 0); in TEST() local
84 ASSERT_FALSE(data.ReadBlockAlignedData(reinterpret_cast<uint8_t*>(buf), 1, 0)); in TEST()
/bootable/recovery/minui/
Dresources.cpp62 memcpy(result->data(), data(), data_size_); in Clone()
208 png_read_row(png_ptr, p_row.data(), nullptr); in res_create_display_surface()
209 TransformRgbToDraw(p_row.data(), surface->data() + y * surface->row_bytes, in res_create_display_surface()
280 png_read_row(png_ptr, p_row.data(), nullptr); in res_create_multi_display_surface()
282 uint8_t* out_row = surface[frame]->data() + (y / *frames) * surface[frame]->row_bytes; in res_create_multi_display_surface()
283 TransformRgbToDraw(p_row.data(), out_row, png_handler.channels(), width); in res_create_multi_display_surface()
325 uint8_t* p_row = surface->data() + y * surface->row_bytes; in res_create_alpha_surface()
380 png_read_row(png_handler.png_ptr(), row.data(), nullptr); in get_locales_in_png()
387 png_read_row(png_handler.png_ptr(), row.data(), nullptr); in get_locales_in_png()
415 png_read_row(png_ptr, row.data(), nullptr); in res_create_localized_alpha_surface()
[all …]
Dgraphics.cpp127 return reinterpret_cast<uint32_t*>(surface->data()) + y * row_pixels + x; in PixelAt()
129 return reinterpret_cast<uint32_t*>(surface->data()) + x * row_pixels + (surface->width - y); in PixelAt()
131 return reinterpret_cast<uint32_t*>(surface->data()) + (surface->height - 1 - y) * row_pixels + in PixelAt()
134 return reinterpret_cast<uint32_t*>(surface->data()) + (surface->height - 1 - x) * row_pixels + in PixelAt()
180 const uint8_t* src_p = font->texture->data() + ((ch - ' ') * font->char_width) + in gr_text()
205 const uint8_t* src_p = icon->data(); in gr_texticon()
224 memset(gr_draw->data(), gr_current & 0xff, gr_draw->height * gr_draw->row_bytes); in gr_clear()
226 uint32_t* px = reinterpret_cast<uint32_t*>(gr_draw->data()); in gr_clear()
278 reinterpret_cast<const uint32_t*>(source->data()) + sy * source->row_bytes / 4 + sx; in gr_blit()
292 const uint8_t* src_p = source->data() + sy * source->row_bytes + sx * source->pixel_bytes; in gr_blit()
[all …]
Devents.cpp106 ssize_t r = TEMP_FAILURE_RETRY(read(fd, buf.data(), event_len)); in inotify_cb()
113 struct inotify_event* pevent = reinterpret_cast<struct inotify_event*>(buf.data() + offset); in inotify_cb()
177 ev.data.ptr = &ev_fdinfo[g_ev_count]; in ev_init()
214 ev.data.ptr = static_cast<void*>(&ev_fdinfo[g_ev_count]); in ev_add_fd()
246 FdInfo* fdi = static_cast<FdInfo*>(g_polled_events[n].data.ptr); in ev_dispatch()
/bootable/recovery/tests/unit/host/
Dimgdiff_test.cpp41 const char* data = patch.data(); in verify_patch_header() local
44 ASSERT_EQ("IMGDIFF2", std::string(data, 8)); in verify_patch_header()
46 const int num_chunks = get_unaligned<int32_t>(data + 8); in verify_patch_header()
56 int type = get_unaligned<int32_t>(data + pos); in verify_patch_header()
64 ssize_t data_len = get_unaligned<int32_t>(data + pos); in verify_patch_header()
85 ASSERT_EQ(0, ApplyImagePatch(reinterpret_cast<const unsigned char*>(src.data()), src.size(), in GenerateTarget()
86 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in GenerateTarget()
87 [&](const unsigned char* data, size_t len) { in GenerateTarget() argument
88 patched->append(reinterpret_cast<const char*>(data), len); in GenerateTarget()
130 ASSERT_EQ(0, imgdiff(args.size(), args.data())); in TEST()
[all …]
Dupdate_simulator_test.cpp58 ASSERT_EQ(0, writer.WriteBytes(pair.second.data(), pair.second.size())); in AddZipEntries()
65 static string CalculateSha1(const string& data) { in CalculateSha1() argument
67 SHA1(reinterpret_cast<const uint8_t*>(data.c_str()), data.size(), digest); in CalculateSha1()
73 ASSERT_EQ(0, bsdiff::bsdiff(reinterpret_cast<const uint8_t*>(src.data()), src.size(), in CreateBsdiffPatch()
74 reinterpret_cast<const uint8_t*>(tgt.data()), tgt.size(), in CreateBsdiffPatch()
/bootable/recovery/updater/
Dblockimg.cpp253 size_t Write(const uint8_t* data, size_t size) { in Write() argument
271 if (!android::base::WriteFully(fd_, data, write_now)) { in Write()
277 data += write_now; in Write()
362 static bool receive_new_data(const uint8_t* data, size_t size, void* cookie) { in receive_new_data() argument
381 if (nti->writer->Write(data, write_now) != write_now) { in receive_new_data()
386 data += write_now; in receive_new_data()
402 static bool receive_brotli_new_data(const uint8_t* data, size_t size, void* cookie) { in receive_brotli_new_data() argument
433 nti->brotli_decoder_state, &available_in, &data, &available_out, &next_out, nullptr); in receive_brotli_new_data()
490 if (!android::base::ReadFully(fd, buffer->data() + p, size)) { in ReadBlocks()
515 if (!android::base::WriteFully(fd, buffer.data() + written, size)) { in WriteBlocks()
[all …]
/bootable/recovery/minui/include/minui/
Dminui.h51 virtual uint8_t* data() { in data() function
55 const uint8_t* data() const { in data() function
56 return const_cast<const uint8_t*>(const_cast<GRSurface*>(this)->data()); in data()
75 void operator()(uint8_t* data) { in operator()
76 free(data); in operator()
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/util/
DFileDownloader.java73 byte[] data = new byte[4096]; in download()
77 int count = input.read(data, 0, needToRead); in download()
81 output.write(data, 0, count); in download()
/bootable/recovery/
Drecovery-persist.rc1 on post-fs-data
2 mkdir /data/misc/recovery 0770 system log
/bootable/recovery/recovery_utils/
Dlogging.cpp165 buf.data(), buf.size()); in __pmsg_write()
283 std::string data(read_size, '\0'); in ReadLogFilesToMemory() local
286 if (log_fd == -1 || !android::base::ReadFully(log_fd, data.data(), read_size)) { in ReadLogFilesToMemory()
291 log_files.emplace_back(saved_log_file{ path, sb, data }); in ReadLogFilesToMemory()
311 if (!android::base::WriteStringToFile(log.data, log.name, log.sb.st_mode, log.sb.st_uid, in RestoreLogFilesAfterFormat()
/bootable/recovery/bootloader_message/
Dbootloader_message.cpp260 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package()
272 static bool ReadMiscPartitionSystemSpace(void* data, size_t size, size_t offset, std::string* err) { in ReadMiscPartitionSystemSpace() argument
280 return read_misc_partition(data, size, misc_blk_device, SYSTEM_SPACE_OFFSET_IN_MISC + offset, in ReadMiscPartitionSystemSpace()
284 static bool WriteMiscPartitionSystemSpace(const void* data, size_t size, size_t offset, in WriteMiscPartitionSystemSpace() argument
293 return write_misc_partition(data, size, misc_blk_device, SYSTEM_SPACE_OFFSET_IN_MISC + offset, in WriteMiscPartitionSystemSpace()

123