summaryrefslogtreecommitdiff
path: root/artd/file_utils.cc
AgeCommit message (Collapse)Author
2024-05-15Fix performance-inefficient-vector-operation clang-tidy issues Stefano Cianciulli
Bug: 264654008 Test: m tidy-art Change-Id: I52338492e929421758ba924de8708102a71c8ac2
2024-05-02Implement commitPreRebootStagedFiles. Jiakai Zhang
Bug: 311377497 Test: m test-art-host-gtest-art_artd_tests Test: atest ArtServiceTests Change-Id: Ia8900baeaa8ed4208f0ecacf454a97a72112ba95
2024-04-30Refactor NewFile::CommitAllOrAbandon. Jiakai Zhang
This refactoring creates a more generic function to back NewFile::CommitAllOrAbandon, which can be used for moving any files. The generic function will be used for moving Pre-reboot Dexopt staged files. Bug: 311377497 Test: m test-art-host-gtest-art_artd_tests Change-Id: If17392557229d857743011942d0a666e925a0448
2023-05-04Replace uses of _format with a macro. Krzysztof KosiƄski
_format is a user-defined literal which is removed from newer releases of libfmt. Ignore-AOSP-First: internal UDC branch has additional uses of _format that are not present in AOSP master Bug: 271622675 Test: presubmit Change-Id: I2f5cc706ca8f734b1cad89e7d957fb7a52f78a10
2023-04-28Don't log error when deleting a file that doesn't exist. Jiakai Zhang
Similar to commit 9b2bddc732b8a09b7091f983ee8161f1db277cae, but for another method. Bug: 261431149 Test: - 1. Add a "sleep" between artd invoking dex2oat and moving the files. 2. Install an app. 3. Run "pm compile" on the app. 4. While "pm compile" is on "sleep", uninstall the app. 5. See no message like "Failed to remove file '...': Success". Ignore-AOSP-First: ART Services Change-Id: I274457b892bcb2426fc5e01470212597f63c8323
2023-02-13Implement ART Serivces GC that cleans up obsolete files. Jiakai Zhang
Bug: 254013425 Test: m test-art-host-gtest-art_artd_tests Test: atest ArtServiceTests Test: - 1. adb shell pm art cleanup 2. See files being cleaned up. 3. adb shell pm art cleanup 4. See nothing being cleaned up. 5. adb shell pm art optimize-packages bg-dexopt 6. adb shell pm art cleanup 7. See nothing being cleaned up. Ignore-AOSP-First: ART Services. Change-Id: If6a495b58657e007a49863c055d0fbafb4417ce1
2023-01-24Fix performance-inefficient-vector-operation clang-tidy issues Stefano Cianciulli
Ignore-AOSP-first: this CL contains changes to ART services that are currently being developed in the internal repo only. Test: m tidy-art Bug: 264654008 Change-Id: I6b0b495cbb934f9b8caedb389a643428d3cffc47
2022-08-31ART services: optimize package - Add artd methods. Jiakai Zhang
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
2022-07-07Add classes and functions for accessing files in artd. Jiakai Zhang
This change includes: - An AIDL representation of Linux filesystem permission and a function to convert it to Linux access mode. - A class that creates a new file for writing and cleans it up unless the file is committed. - A function that opens a file for reading. Bug: 229268202 Test: m test-art-host-gtest-art_artd_tests Ignore-AOSP-First: ART Services Change-Id: I0e24e8fc31eee5e7004a35649df610b7da4d3178