[Installd] Clean up logic for secondary dex oat files
Add a new method to installd, reconcileSecondaryOdex, which checks if
the given dex files still exist and if not, deletes the oat files that
were generated for it.
Test: devices bots
adb shell cmd package reconcile-secondary-dex
com.android.google.gms (after artificially/temporarily renaming some
dex files)
Bug: 32871170
(cherry picked from commit bd9683607d391a29b1422a50f8972267e9bddc47)
Change-Id: Icb5c71b43a0e531d5be5d900149e707d0fe0a8de
Merged-In: I8465a7be9fd4e44e191ad40f7bd0f41c8b2d6f73
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 7beeef1..f2ea0d3 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -1942,6 +1942,20 @@
return res ? ok() : error();
}
+binder::Status InstalldNativeService::reconcileSecondaryDexFile(
+ const std::string& dexPath, const std::string& packageName, int32_t uid,
+ const std::vector<std::string>& isas, const std::unique_ptr<std::string>& volumeUuid,
+ int32_t storage_flag, bool* _aidl_return) {
+ ENFORCE_UID(AID_SYSTEM);
+ CHECK_ARGUMENT_UUID(volumeUuid);
+ CHECK_ARGUMENT_PACKAGE_NAME(packageName);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ bool result = android::installd::reconcile_secondary_dex_file(
+ dexPath, packageName, uid, isas, volumeUuid, storage_flag, _aidl_return);
+ return result ? ok() : error();
+}
+
binder::Status InstalldNativeService::invalidateMounts() {
ENFORCE_UID(AID_SYSTEM);
std::lock_guard<std::recursive_mutex> lock(mLock);