summaryrefslogtreecommitdiff
path: root/cmds/installd/InstalldNativeService.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/installd/InstalldNativeService.cpp')
-rw-r--r--cmds/installd/InstalldNativeService.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 7eb5cb4172..3cdba0661d 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -3631,5 +3631,23 @@ binder::Status InstalldNativeService::cleanupInvalidPackageDirs(
return ok();
}
+binder::Status InstalldNativeService::getOdexVisibility(
+ const std::string& packageName, const std::string& apkPath,
+ const std::string& instructionSet, const std::optional<std::string>& outputPath,
+ int32_t* _aidl_return) {
+ ENFORCE_UID(AID_SYSTEM);
+ CHECK_ARGUMENT_PACKAGE_NAME(packageName);
+ CHECK_ARGUMENT_PATH(apkPath);
+ CHECK_ARGUMENT_PATH(outputPath);
+ LOCK_PACKAGE();
+
+ const char* apk_path = apkPath.c_str();
+ const char* instruction_set = instructionSet.c_str();
+ const char* oat_dir = outputPath ? outputPath->c_str() : nullptr;
+
+ *_aidl_return = get_odex_visibility(apk_path, instruction_set, oat_dir);
+ return *_aidl_return == -1 ? error() : ok();
+}
+
} // namespace installd
} // namespace android