diff options
author | 2022-08-10 15:35:28 +0100 | |
---|---|---|
committer | 2022-08-31 16:55:25 +0000 | |
commit | 3aaecf0e678a241a25ac358dbf280a35a5c48efc (patch) | |
tree | 1e85d793126b9863c9428511620967a46d46b932 /artd/path_utils.h | |
parent | 0332ab40ba7e71dbf0a759a96017a96991d0ac19 (diff) |
ART services: optimize package - Add artd methods.
This change adds two artd methods: `getDexoptNeeded` and `dexopt`, which
are used for app compilation.
Also, this CL replaces all `StringPrintf` with `_format`.
Bug: 229268202
Test: m test-art-host-gtest-art_artd_tests
Ignore-AOSP-First: ART Services.
Change-Id: I51a42816750ff39c768658f739c7e6337cfe3e1c
Diffstat (limited to 'artd/path_utils.h')
-rw-r--r-- | artd/path_utils.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/artd/path_utils.h b/artd/path_utils.h index 970143a9c7..41513876f1 100644 --- a/artd/path_utils.h +++ b/artd/path_utils.h @@ -19,19 +19,37 @@ #include "aidl/com/android/server/art/BnArtd.h" #include "android-base/result.h" +#include "base/file_utils.h" namespace art { namespace artd { +android::base::Result<void> ValidateDexPath(const std::string& dex_path); + +android::base::Result<std::string> BuildArtBinPath(const std::string& binary_name); + // Returns the absolute path to the OAT file built from the `ArtifactsPath`. android::base::Result<std::string> BuildOatPath( const aidl::com::android::server::art::ArtifactsPath& artifacts_path); // Returns the path to the VDEX file that corresponds to the OAT file. -std::string OatPathToVdexPath(const std::string& oat_path); +inline std::string OatPathToVdexPath(const std::string& oat_path) { + return ReplaceFileExtension(oat_path, "vdex"); +} // Returns the path to the ART file that corresponds to the OAT file. -std::string OatPathToArtPath(const std::string& oat_path); +inline std::string OatPathToArtPath(const std::string& oat_path) { + return ReplaceFileExtension(oat_path, "art"); +} + +android::base::Result<std::string> BuildDexMetadataPath( + const aidl::com::android::server::art::DexMetadataPath& dex_metadata_path); + +android::base::Result<std::string> BuildDexMetadataPath( + const aidl::com::android::server::art::VdexPath& vdex_path); + +android::base::Result<std::string> BuildVdexPath( + const aidl::com::android::server::art::VdexPath& vdex_path); } // namespace artd } // namespace art |