From 2af5e6a5df031ebce1745e403ef0b535773a7361 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Wed, 9 Jan 2019 18:17:27 -0800 Subject: [view compilation] Add viewcompiler support to installd This change adds methods to installd to call viewcompiler and generate precompiled layouts when requested either by `pm compile --compile-layouts`, package install, or package upgrade. Bug: 111895153 Test: manual Change-Id: Ic021d7a41c15642664f44542653170ad24055f22 --- cmds/installd/InstalldNativeService.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmds/installd/InstalldNativeService.cpp') diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index 2439dff54e..8a036a5c1c 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -60,6 +60,7 @@ #include "installd_deps.h" #include "otapreopt_utils.h" #include "utils.h" +#include "view_compiler.h" #include "CacheTracker.h" #include "MatchExtensionGen.h" @@ -1831,6 +1832,17 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t return res ? error(res, error_msg) : ok(); } +binder::Status InstalldNativeService::compileLayouts(const std::string& apkPath, + const std::string& packageName, + const std ::string& outDexFile, int uid, + bool* _aidl_return) { + const char* apk_path = apkPath.c_str(); + const char* package_name = packageName.c_str(); + const char* out_dex_file = outDexFile.c_str(); + *_aidl_return = android::installd::view_compiler(apk_path, package_name, out_dex_file, uid); + return *_aidl_return ? ok() : error("viewcompiler failed"); +} + binder::Status InstalldNativeService::markBootComplete(const std::string& instructionSet) { ENFORCE_UID(AID_SYSTEM); std::lock_guard lock(mLock); -- cgit v1.2.3-59-g8ed1b