Home
last modified time | relevance | path

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

12345

/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 …]
Droots.h29 Volume* volume_for_mount_point(const std::string& mount_point);
33 int ensure_path_mounted(const std::string& path);
36 int ensure_path_mounted_at(const std::string& path, const std::string& mount_point);
40 int ensure_path_unmounted(const std::string& path);
45 int format_volume(const std::string& volume);
51 int format_volume(const std::string& volume, const std::string& directory);
59 std::string get_system_root();
Dsysutil.h41 static BlockMapData ParseBlockMapFile(const std::string& block_map_path);
47 std::string path() const { in path()
63 BlockMapData(const std::string& path, uint64_t file_size, uint32_t block_size, in BlockMapData()
70 std::string path_;
84 bool MapFile(const std::string& filename);
98 bool MapBlockFile(const std::string& filename);
106 bool reboot(const std::string& command);
111 std::vector<char*> StringVectorToNullTerminatedArray(const std::vector<std::string>& args);
/bootable/recovery/bootloader_message/include/bootloader_message/
Dbootloader_message.h191 std::string get_bootloader_message_blk_device(std::string* err);
194 bool read_bootloader_message(bootloader_message* boot, std::string* err);
197 bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device,
198 std::string* err);
201 bool write_bootloader_message(const bootloader_message& boot, std::string* err);
205 const std::string& misc_blk_device, std::string* err);
209 bool write_bootloader_message(const std::vector<std::string>& options, std::string* err);
213 bool update_bootloader_message(const std::vector<std::string>& options, std::string* err);
218 const std::vector<std::string>& options);
221 bool clear_bootloader_message(std::string* err);
[all …]
/bootable/recovery/tests/component/
Dupdater_test.cpp58 using PackageEntries = std::unordered_map<std::string, std::string>;
62 static void expect(const char* expected, const std::string& expr_str, CauseCode cause_code, in expect()
71 std::string result; in expect()
106 const std::string& image_file, const std::string& result, in RunBlockImageUpdate()
127 std::string new_data = entries.find("new_data.br") != entries.end() ? "new_data.br" : "new_data"; in RunBlockImageUpdate()
128 std::string script = is_verify ? "block_image_verify" : "block_image_update"; in RunBlockImageUpdate()
137 static std::string GetSha1(std::string_view content) { in GetSha1()
189 std::string updated_marker{ temp_stash_base_.path }; in TearDown()
196 std::string last_command_file_;
197 std::string image_file_;
[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 …]
Dinstall_test.cpp39 static void BuildZipArchive(const std::map<std::string, std::string>& file_map, int fd, in BuildZipArchive() argument
77 const std::string content("abc=defg"); in TEST()
83 std::map<std::string, std::string> metadata; in TEST()
105 std::map<std::string, std::string> metadata; in TEST()
111 std::vector<std::string> partition_list = { in TEST()
120 std::string wipe_package; in TEST()
127 std::vector<std::string> expected = { in TEST()
138 std::string malformed_xml = "malformed"; in TEST()
143 std::string compatibility_zip_content; in TEST()
151 std::vector<std::string> compatibility_info; in TEST()
[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 …]
Dsideload_test.cpp58 const std::vector<std::string> blocks = { in TEST()
59 std::string(2048, 'a') + std::string(2048, 'b'), in TEST()
60 std::string(2048, 'c') + std::string(2048, 'd'), in TEST()
61 std::string(2048, 'e') + std::string(2048, 'f'), in TEST()
62 std::string(2048, 'g') + std::string(2048, 'h'), in TEST()
64 const std::string content = android::base::Join(blocks, ""); in TEST()
79 std::string package = std::string(mount_point.path) + "/" + FUSE_SIDELOAD_HOST_FILENAME; in TEST()
97 std::string content_via_fuse; in TEST()
101 std::string exit_flag = std::string(mount_point.path) + "/" + FUSE_SIDELOAD_HOST_EXIT_FLAG; in TEST()
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 …]
Dimgdiff_test.cpp39 static void verify_patch_header(const std::string& patch, size_t* num_normal, size_t* num_raw, in verify_patch_header()
45 ASSERT_EQ("IMGDIFF2", std::string(data, 8)); in verify_patch_header()
84 static void GenerateTarget(const std::string& src, const std::string& patch, std::string* patched) { in GenerateTarget()
94 static void verify_patched_image(const std::string& src, const std::string& patch, in verify_patched_image()
95 const std::string& tgt) { in verify_patched_image()
96 std::string patched; in verify_patched_image()
119 const std::string src("abcdefg"); in TEST()
123 const std::string tgt("abcdefgxyz"); in TEST()
134 std::string patch; in TEST()
155 const std::string src_content("abcdefg"); in TEST()
[all …]
/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/tests/common/
Dtest_constants.h25 static const std::string kATxtContents("abcdefghabcdefgh\n");
26 static const std::string kBTxtContents("abcdefgh\n");
27 static const std::string kCTxtContents("abcdefghabcdefgh\n");
28 static const std::string kDTxtContents("abcdefgh\n");
31 static const std::string kATxtSha1Sum("32c96a03dc8cd20097940f351bca6261ee5a1643");
33 static const std::string kBTxtSha1Sum("e414af7161c9554089f4106d6f1797ef14a73666");
35 [[maybe_unused]] static std::string from_testdata_base(const std::string& fname) { in from_testdata_base()
36 static std::string exec_dir = android::base::GetExecutableDirectory(); in from_testdata_base()
/bootable/recovery/bootloader_message/
Dbootloader_message.cpp36 static std::string g_misc_device_for_test;
43 static std::string get_misc_blk_device(std::string* err) { in get_misc_blk_device()
64 static bool wait_for_device(const std::string& blk_device, std::string* err) { in wait_for_device()
85 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition()
86 size_t offset, std::string* err) { 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()
110 size_t offset, std::string* err) { in write_misc_partition()
135 std::string get_bootloader_message_blk_device(std::string* err) { in get_bootloader_message_blk_device()
136 std::string misc_blk_device = get_misc_blk_device(err); in get_bootloader_message_blk_device()
142 bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device, in read_bootloader_message_from()
[all …]
/bootable/recovery/applypatch/include/applypatch/
Dapplypatch.h46 int ParseSha1(const std::string& str, uint8_t* digest);
51 Partition(const std::string& name, size_t size, const std::string& hash) in Partition()
56 static Partition Parse(const std::string& partition, std::string* err);
58 std::string ToString() const;
65 std::string name;
67 std::string hash;
93 bool FlashPartition(const Partition& target, const std::string& source_filename);
96 bool LoadFileContents(const std::string& filename, FileContents* file);
99 bool SaveFileContents(const std::string& filename, const FileContents* file);
128 bool RemoveFilesInDirectory(size_t bytes_needed, const std::string& dirname,
[all …]
/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 …]
Dfreecache.cpp42 static int EliminateOpenFiles(const std::string& dirname, std::set<std::string>* files) { in EliminateOpenFiles()
54 std::string path = android::base::StringPrintf("/proc/%s/fd/", de->d_name); in EliminateOpenFiles()
63 std::string fd_path = path + fdde->d_name; in EliminateOpenFiles()
80 static std::vector<std::string> FindExpendableFiles( in FindExpendableFiles()
81 const std::string& dirname, const std::function<bool(const std::string&)>& name_filter) { in FindExpendableFiles()
89 std::set<std::string> files; in FindExpendableFiles()
92 std::string path = dirname + "/" + de->d_name; in FindExpendableFiles()
116 return std::vector<std::string>(files.begin(), files.end()); in FindExpendableFiles()
121 static unsigned int GetLogIndex(const std::string& log_name) { in GetLogIndex()
137 static int64_t FreeSpaceForFile(const std::string& filename) { in FreeSpaceForFile()
[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/tests/unit/
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 …]
/bootable/recovery/recovery_ui/include/recovery_ui/
Dstub_ui.h31 std::string GetLocale() const override { in GetLocale()
61 void ShowFile(const std::string& /* filename */) override {} in ShowFile() argument
64 size_t ShowMenu(const std::vector<std::string>& /* headers */, in ShowMenu() argument
65 const std::vector<std::string>& /* items */, size_t initial_selection, in ShowMenu()
71 size_t ShowPromptWipeDataMenu(const std::vector<std::string>& /* backup_headers */, in ShowPromptWipeDataMenu() argument
72 const std::vector<std::string>& /* backup_items */, in ShowPromptWipeDataMenu()
78 const std::vector<std::string>& /* backup_headers */, in ShowPromptWipeDataConfirmationMenu() argument
79 const std::vector<std::string>& /* backup_items */, in ShowPromptWipeDataConfirmationMenu()
84 void SetTitle(const std::vector<std::string>& /* lines */) override {} in SetTitle() argument
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/otautil/
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 …]

12345