From c523409f0fd03aa498cedc486f85e9a4b7257f3a Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 31 May 2017 16:39:58 -0700 Subject: Installd: deleteOdex's outputPath can be null Add @nullable, as the outputPath can be null for system apps. Bug: 62236497 Test: m Test: Fill up /data, apply OTA Change-Id: I61d86721b485f85195b153d76ce25412dcb68be6 --- cmds/installd/InstalldNativeService.cpp | 4 ++-- cmds/installd/InstalldNativeService.h | 2 +- cmds/installd/binder/android/os/IInstalld.aidl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index dec23d3945..3041467f70 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -2249,13 +2249,13 @@ binder::Status InstalldNativeService::moveAb(const std::string& apkPath, } binder::Status InstalldNativeService::deleteOdex(const std::string& apkPath, - const std::string& instructionSet, const std::string& outputPath) { + const std::string& instructionSet, const std::unique_ptr& outputPath) { ENFORCE_UID(AID_SYSTEM); std::lock_guard lock(mLock); const char* apk_path = apkPath.c_str(); const char* instruction_set = instructionSet.c_str(); - const char* oat_dir = outputPath.c_str(); + const char* oat_dir = outputPath ? outputPath->c_str() : nullptr; bool res = delete_odex(apk_path, instruction_set, oat_dir); return res ? ok() : error(); diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h index 7f7fa74cfb..4011315175 100644 --- a/cmds/installd/InstalldNativeService.h +++ b/cmds/installd/InstalldNativeService.h @@ -109,7 +109,7 @@ public: binder::Status moveAb(const std::string& apkPath, const std::string& instructionSet, const std::string& outputPath); binder::Status deleteOdex(const std::string& apkPath, const std::string& instructionSet, - const std::string& outputPath); + const std::unique_ptr& outputPath); binder::Status reconcileSecondaryDexFile(const std::string& dexPath, const std::string& packageName, int32_t uid, const std::vector& isa, const std::unique_ptr& volumeUuid, int32_t storage_flag, bool* _aidl_return); diff --git a/cmds/installd/binder/android/os/IInstalld.aidl b/cmds/installd/binder/android/os/IInstalld.aidl index 6185ecb607..f09a3975d3 100644 --- a/cmds/installd/binder/android/os/IInstalld.aidl +++ b/cmds/installd/binder/android/os/IInstalld.aidl @@ -74,7 +74,7 @@ interface IInstalld { void moveAb(@utf8InCpp String apkPath, @utf8InCpp String instructionSet, @utf8InCpp String outputPath); void deleteOdex(@utf8InCpp String apkPath, @utf8InCpp String instructionSet, - @utf8InCpp String outputPath); + @nullable @utf8InCpp String outputPath); boolean reconcileSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName, int uid, in @utf8InCpp String[] isas, @nullable @utf8InCpp String volume_uuid, -- cgit v1.2.3-59-g8ed1b