Home
last modified time | relevance | path

Searched refs:string (Results 1 – 25 of 130) sorted by relevance

123456

/bootable/recovery/otautil/include/otautil/
Dpaths.h30 std::string cache_log_directory() const { in cache_log_directory()
33 void set_cache_log_directory(const std::string& log_dir) { in set_cache_log_directory()
37 std::string cache_temp_source() const { in cache_temp_source()
40 void set_cache_temp_source(const std::string& temp_source) { in set_cache_temp_source()
44 std::string last_command_file() const { in last_command_file()
47 void set_last_command_file(const std::string& last_command_file) { in set_last_command_file()
51 std::string resource_dir() const { in resource_dir()
54 void set_resource_dir(const std::string& resource_dir) { in set_resource_dir()
58 std::string stash_directory_base() const { in stash_directory_base()
61 void set_stash_directory_base(const std::string& base) { in set_stash_directory_base()
[all …]
/bootable/recovery/bootloader_message/include/bootloader_message/
Dbootloader_message.h116 std::string get_misc_blk_device(std::string* err);
120 std::string get_bootloader_message_blk_device(std::string* err);
124 bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device,
125 size_t offset, std::string* err);
128 bool read_bootloader_message(bootloader_message* boot, std::string* err);
131 bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device,
132 std::string* err);
135 bool write_bootloader_message(const bootloader_message& boot, std::string* err);
139 const std::string& misc_blk_device, std::string* err);
143 bool write_bootloader_message(const std::vector<std::string>& options, std::string* err);
[all …]
/bootable/recovery/tests/unit/
Dupdater_test.cpp59 using PackageEntries = std::unordered_map<std::string, std::string>;
61 static void expect(const char* expected, const std::string& expr_str, CauseCode cause_code, in expect()
70 std::string result; in expect()
87 static void expect(const char* expected, const std::string& expr_str, CauseCode cause_code) { in expect()
109 static std::string GetSha1(std::string_view content) { in GetSha1()
158 std::string updated_marker{ temp_stash_base_.path }; in TearDown()
163 void RunBlockImageUpdate(bool is_verify, PackageEntries entries, const std::string& image_file, in RunBlockImageUpdate()
164 const std::string& result, CauseCode cause_code = kNoCause) { in RunBlockImageUpdate()
166 std::string new_data = in RunBlockImageUpdate()
168 std::string script = is_verify ? "block_image_verify" : "block_image_update"; in RunBlockImageUpdate()
[all …]
Dinstall_test.cpp40 static void BuildZipArchive(const std::map<std::string, std::string>& file_map, int fd, in BuildZipArchive() argument
55 const std::string content("abc=defg"); in TEST()
61 std::map<std::string, std::string> metadata; in TEST()
83 std::map<std::string, std::string> metadata; in TEST()
89 std::vector<std::string> partition_list = { in TEST()
98 std::string wipe_package; in TEST()
105 std::vector<std::string> expected = { in TEST()
122 std::string package = "/path/to/update.zip"; in TEST()
124 std::string binary_path = std::string(td.path) + "/update_binary"; in TEST()
126 std::vector<std::string> cmd; in TEST()
[all …]
Dbootloader_message_test.cpp39 std::string err; in TEST()
48 ASSERT_EQ(std::string(reinterpret_cast<const char*>(&boot), sizeof(boot)), in TEST()
49 std::string(reinterpret_cast<const char*>(&boot_verify), sizeof(boot_verify))); in TEST()
54 std::vector<std::string> options = { "option1", "option2" }; in TEST()
66 ASSERT_EQ("boot-recovery", std::string(boot.command)); in TEST()
67 std::string expected = "recovery\n" + android::base::Join(options, "\n") + "\n"; in TEST()
68 ASSERT_EQ(expected, std::string(boot.recovery)); in TEST()
71 ASSERT_EQ("status bytes", std::string(boot.status)); in TEST()
72 ASSERT_EQ("stage bytes", std::string(boot.stage)); in TEST()
73 ASSERT_EQ("reserved bytes", std::string(boot.reserved)); in TEST()
[all …]
Duncrypt_test.cpp35 static const std::string UNCRYPT_SOCKET = "/dev/socket/uncrypt";
36 static const std::string INIT_SVC_SETUP_BCB = "init.svc.setup-bcb";
37 static const std::string INIT_SVC_CLEAR_BCB = "init.svc.clear-bcb";
38 static const std::string INIT_SVC_UNCRYPT = "init.svc.uncrypt";
48 std::string setup_bcb = android::base::GetProperty(INIT_SVC_SETUP_BCB, ""); in StopService()
49 std::string clear_bcb = android::base::GetProperty(INIT_SVC_CLEAR_BCB, ""); in StopService()
50 std::string uncrypt = android::base::GetProperty(INIT_SVC_UNCRYPT, ""); in StopService()
68 std::string err; in SetUp()
75 std::string err; in TearDown()
80 void SetupOrClearBcb(bool isSetup, const std::string& message, in SetupOrClearBcb()
[all …]
Dupdate_verifier_test.cpp37 std::string verity_mode = android::base::GetProperty("ro.boot.veritymode", ""); in SetUp()
51 verifier_.set_property_reader([](const std::string& /* id */) { return "mock_fingerprint"; }); in SetUp() argument
61 std::string ConstructProto( in ConstructProto()
62 std::vector<std::unordered_map<std::string, std::string>>& partitions) { in ConstructProto() argument
89 std::string care_map_prefix_;
90 std::string care_map_pb_;
91 std::string care_map_txt_;
93 std::string property_id_;
94 std::string fingerprint_;
108 std::string content = "system\n2,0,1"; in TEST_F()
[all …]
Dapplypatch_modes_test.cpp39 static std::string GetEmmcTargetString(const std::string& filename, in GetEmmcTargetString()
40 const std::string& display_name = "") { in GetEmmcTargetString()
41 std::string data; in GetEmmcTargetString()
60 std::string recovery_file = from_testdata_base("recovery.img"); in SetUp()
71 std::string source;
72 std::string target;
73 std::string recovery;
80 static int InvokeApplyPatchModes(const std::vector<std::string>& args) { in InvokeApplyPatchModes()
85 static void VerifyPatchedTarget(const std::string& target) { in VerifyPatchedTarget()
86 std::vector<std::string> pieces = android::base::Split(target, ":"); in VerifyPatchedTarget()
[all …]
Dverifier_test.cpp44 static void LoadKeyFromFile(const std::string& file_name, Certificate* cert) { in LoadKeyFromFile()
45 std::string testkey_string; in LoadKeyFromFile()
51 static void VerifyFile(const std::string& content, const std::vector<Certificate>& keys, in VerifyFile()
60 static void VerifyPackageWithCertificates(const std::string& name, in VerifyPackageWithCertificates()
62 std::string path = from_testdata_base(name); in VerifyPackageWithCertificates()
69 static void VerifyPackageWithSingleCertificate(const std::string& name, Certificate&& cert) { in VerifyPackageWithSingleCertificate()
75 static void BuildCertificateArchive(const std::vector<std::string>& file_names, int fd) { in BuildCertificateArchive()
80 std::string content; in BuildCertificateArchive()
84 std::string entry_name = name; in BuildCertificateArchive()
99 std::string testkey_string; in TEST()
[all …]
Dapplypatch_test.cpp76 std::string source_file;
77 std::string source_sha1;
80 std::string target_file;
81 std::string target_sha1;
84 std::string bad_sha1_a;
85 std::string bad_sha1_b;
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()
162 static std::vector<std::string> FindFilesInDir(const std::string& dirname) { in FindFilesInDir()
[all …]
Dcommands_test.cpp46 const std::vector<std::string> tokens{ in TEST()
53 std::string err; in TEST()
67 const std::vector<std::string> tokens{ in TEST()
75 std::string err; in TEST()
92 const std::vector<std::string> tokens{ in TEST()
101 std::string err; in TEST()
120 const std::vector<std::string> tokens{ in TEST()
129 std::string err; in TEST()
133 std::vector<std::string> tokens_copy(tokens); in TEST()
142 std::vector<std::string> tokens_copy(tokens); in TEST()
[all …]
Dfuse_sideload_test.cpp62 const std::vector<std::string> blocks = { in TEST()
63 std::string(2048, 'a') + std::string(2048, 'b'), in TEST()
64 std::string(2048, 'c') + std::string(2048, 'd'), in TEST()
65 std::string(2048, 'e') + std::string(2048, 'f'), in TEST()
66 std::string(2048, 'g') + std::string(2048, 'h'), in TEST()
68 const std::string content = android::base::Join(blocks, ""); in TEST()
83 std::string package = std::string(mount_point.path) + "/" + FUSE_SIDELOAD_HOST_FILENAME; in TEST()
101 std::string content_via_fuse; in TEST()
105 std::string exit_flag = std::string(mount_point.path) + "/" + FUSE_SIDELOAD_HOST_EXIT_FLAG; in TEST()
/bootable/recovery/tests/unit/host/
Dupdate_simulator_test.cpp40 using std::string;
53 static void AddZipEntries(int fd, const std::map<string, string>& entries) { in AddZipEntries() argument
65 static string CalculateSha1(const string& data) { in CalculateSha1()
71 static void CreateBsdiffPatch(const string& src, const string& tgt, string* patch) { in CreateBsdiffPatch()
107 std::vector<string> props = { in SetUp()
139 raw_system_string_ = "system.img" + string(4086, '\0'); // raw image is 4096 bytes in total in SetUp()
140 sparse_system_string_ = string(SPARSE_SYSTEM_HEADER, std::end(SPARSE_SYSTEM_HEADER)) + in SetUp()
141 string(4136 - sizeof(SPARSE_SYSTEM_HEADER), '\0'); in SetUp()
144 string build_prop_string_;
145 string fstab_content_;
[all …]
Dimgdiff_test.cpp38 static void verify_patch_header(const std::string& patch, size_t* num_normal, size_t* num_raw, in verify_patch_header()
44 ASSERT_EQ("IMGDIFF2", std::string(data, 8)); in verify_patch_header()
83 static void GenerateTarget(const std::string& src, const std::string& patch, std::string* patched) { in GenerateTarget()
93 static void verify_patched_image(const std::string& src, const std::string& patch, in verify_patched_image()
94 const std::string& tgt) { in verify_patched_image()
95 std::string patched; in verify_patched_image()
118 const std::string src("abcdefg"); in TEST()
122 const std::string tgt("abcdefgxyz"); in TEST()
133 std::string patch; in TEST()
154 const std::string src_content("abcdefg"); in TEST()
[all …]
/bootable/recovery/bootloader_message/
Dbootloader_message.cpp41 static std::optional<std::string> g_misc_device_for_test;
48 std::string get_misc_blk_device(std::string* err) { in get_misc_blk_device()
69 static bool wait_for_device(const std::string& blk_device, std::string* err) { in wait_for_device()
90 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition()
91 size_t offset, std::string* err) { in read_misc_partition()
114 bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition()
115 size_t offset, std::string* err) { in write_misc_partition()
140 std::string get_bootloader_message_blk_device(std::string* err) { in get_bootloader_message_blk_device()
141 std::string misc_blk_device = get_misc_blk_device(err); in get_bootloader_message_blk_device()
147 bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device, in read_bootloader_message_from()
[all …]
/bootable/recovery/updater/
Dupdater_runtime.cpp38 std::string UpdaterRuntime::GetProperty(const std::string_view key, in GetProperty()
40 return android::base::GetProperty(std::string(key), std::string(default_value)); in GetProperty()
43 std::string UpdaterRuntime::FindBlockDeviceName(const std::string_view name) const { in FindBlockDeviceName()
44 return std::string(name); in FindBlockDeviceName()
47 static bool setMountFlag(const std::string& flag, unsigned* mount_flags) { in setMountFlag()
75 static bool parseMountFlags(const std::string& flags, unsigned* mount_flags, in parseMountFlags()
76 std::string* fs_options) { in parseMountFlags()
78 std::vector<std::string> flag_list; in parseMountFlags()
93 std::string mount_point_string(mount_point); in Mount()
94 std::string mount_options_string(mount_options); in Mount()
[all …]
Dinstall.cpp73 std::string name = updater->FindBlockDeviceName(partition->name); in UpdateBlockDeviceNameForPartition()
86 std::vector<std::string> args; in UIPrintFn()
91 std::string buffer = android::base::Join(args, ""); in UIPrintFn()
110 std::vector<std::string> args; in PackageExtractFileFn()
115 const std::string& zip_path = args[0]; in PackageExtractFileFn()
116 std::string dest_path = args[1]; in PackageExtractFileFn()
127 if (std::string block_device_name = state->updater->FindBlockDeviceName(dest_path); in PackageExtractFileFn()
161 std::vector<std::string> args; in PackageExtractFileFn()
166 const std::string& zip_path = args[0]; in PackageExtractFileFn()
175 std::string buffer; in PackageExtractFileFn()
[all …]
Dtarget_files.cpp56 std::map<std::string, std::string, std::less<>>* props_map) { in ParsePropertyFile() argument
58 std::vector<std::string> lines = android::base::Split(std::string(prop_content), "\n"); in ParsePropertyFile()
62 if (pos == std::string::npos) continue; in ParsePropertyFile()
63 std::string key = line.substr(0, pos); in ParsePropertyFile()
64 std::string value = line.substr(pos + 1); in ParsePropertyFile()
74 std::vector<std::string> lines = android::base::Split(std::string(fstab), "\n"); in ParseFstab()
79 std::vector<std::string> tokens = android::base::Split(line, " "); in ParseFstab()
109 std::string entry_path = path_ + "/" + std::string(name); in EntryExists()
122 bool TargetFile::ReadEntryToString(const std::string_view name, std::string* content) const { in ReadEntryToString()
124 std::string entry_path = path_ + "/" + std::string(name); in ReadEntryToString()
[all …]
/bootable/recovery/updater/include/updater/
Dbuild_info.h31 FakeBlockDevice(std::string block_device, std::string mount_point, std::string temp_file_path) in FakeBlockDevice()
36 std::string blockdev_name;
37 std::string mount_point;
38 std::string mounted_file_path; // path to the temp file that mocks the block device
49 std::string GetProperty(const std::string_view key, const std::string_view default_value) const;
51 std::string FindBlockDeviceName(const std::string_view name) const;
55 std::string GetOemSettings() const { in GetOemSettings()
64 std::map<std::string, std::string, std::less<>> build_props_;
66 std::string oem_settings_;
69 std::map<std::string, FakeBlockDevice, std::less<>> blockdev_map_;
[all …]
Dtarget_files.h30 FstabInfo(std::string blockdev_name, std::string mount_point, std::string fs_type) in FstabInfo()
35 std::string blockdev_name;
36 std::string mount_point;
37 std::string fs_type;
44 TargetFile(std::string path, bool extracted_input) in TargetFile()
50 bool GetBuildProps(std::map<std::string, std::string, std::less<>>* props_map) const;
62 bool ReadEntryToString(const std::string_view name, std::string* content) const;
65 std::string path_; // Path to the zipped target-file or an extracted directory.
70 std::map<std::string, std::string, std::less<>> misc_info_;
/bootable/recovery/update_verifier/include/update_verifier/
Dupdate_verifier.h54 std::map<std::string, std::string> FindDmPartitions();
57 bool ReadBlocks(const std::string partition_name, const std::string& dm_block_device,
61 void set_care_map_prefix(const std::string& prefix);
62 void set_property_reader(const std::function<std::string(const std::string&)>& property_reader);
64 std::map<std::string, RangeSet> partition_map_;
67 std::string care_map_prefix_;
70 std::function<std::string(const std::string&)> property_reader_;
/bootable/recovery/applypatch/
Dapplypatch_modes.cpp38 static int CheckMode(const std::string& target_emmc) { in CheckMode()
39 std::string err; in CheckMode()
48 static int FlashMode(const std::string& target_emmc, const std::string& source_file) { in FlashMode()
49 std::string err; in FlashMode()
58 static int PatchMode(const std::string& target_emmc, const std::string& source_emmc, in PatchMode()
59 const std::string& patch_file, const std::string& bonus_file) { in PatchMode()
60 std::string err; in PatchMode()
73 std::string patch_contents; in PatchMode()
82 std::string bonus_contents; in PatchMode()
125 std::string check_target; in applypatch_modes()
[all …]
/bootable/recovery/recovery_ui/include/recovery_ui/
Dscreen_ui.h60 virtual int DrawTextLine(int x, int y, const std::string& line, bool bold) const = 0;
73 virtual int DrawTextLines(int x, int y, const std::vector<std::string>& lines) const = 0;
78 virtual int DrawWrappedTextLines(int x, int y, const std::vector<std::string>& lines) const = 0;
109 const std::vector<std::string>& headers, const std::vector<std::string>& items,
140 const std::vector<std::string>& text_headers() const;
141 std::string TextItem(size_t index) const;
145 bool ItemsOverflow(std::string* cur_selection_str) const;
155 std::vector<std::string> text_headers_;
157 std::vector<std::string> text_items_;
200 bool Init(const std::string& locale) override;
[all …]
/bootable/recovery/updater/include/private/
Dcommands.h36 TargetInfo(std::string hash, RangeSet ranges) in TargetInfo()
39 const std::string& hash() const { in hash()
59 std::string hash_;
71 StashInfo(std::string id, RangeSet ranges) : id_(std::move(id)), ranges_(std::move(ranges)) {} in StashInfo()
77 const std::string& id() const { in id()
93 std::string id_;
106 SourceInfo(std::string hash, RangeSet ranges, RangeSet location, std::vector<StashInfo> stashes) in SourceInfo()
125 const std::function<int(const std::string&, std::vector<uint8_t>*)>& stash_reader) const;
134 const std::string& hash() const { in hash()
151 std::string hash_;
[all …]
/bootable/recovery/recovery_utils/
Dlogging.cpp61 static FILE* fopen_path(const std::string& path, const char* mode, const selabel_handle* sehandle) { in fopen_path()
75 void check_and_fclose(FILE* fp, const std::string& name) { in check_and_fclose()
90 if (std::string(LAST_KMSG_FILTER).find(filename) != std::string::npos || in logbasename()
91 std::string(LAST_LOG_FILTER).find(filename) != std::string::npos) { in logbasename()
104 std::string name(filename); in logrotate()
106 std::string sub = name.substr(0, dot); in logrotate()
108 if (std::string(LAST_KMSG_FILTER).find(sub) == std::string::npos && in logrotate()
109 std::string(LAST_LOG_FILTER).find(sub) == std::string::npos) { in logrotate()
114 if (dot == std::string::npos) { in logrotate()
117 std::string number = name.substr(dot + 1); in logrotate()
[all …]

123456