Add dexoptanalyzer tool
dexoptanalyzer is a command line tool which analyzes whether or not a
given dex file needs to be dexopted. It is a wrapper around
OatFileAssistant::GetDexOptNeeded and its results have a mapping to
OatFileAssistant::DexOptNeeded.
This is needed for the management of secondary dex file. We need a way
to retrieve the DexOptNeeded status from installd outside system server.
We can't simply use the system server path (as we do for the main apks)
because system server can't access content writable by the apps.
Bug: 32871170
Test: m test-art-(host|target)
Change-Id: Ife1534560ca2658079d4a38a30bc8d94f35fe9c8
diff --git a/runtime/utils.h b/runtime/utils.h
index 16ef706..9e663b3 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -143,12 +143,18 @@
// Find $ANDROID_ROOT, /system, or abort.
const char* GetAndroidRoot();
+// Find $ANDROID_ROOT, /system, or return null.
+const char* GetAndroidRootSafe(std::string* error_msg);
// Find $ANDROID_DATA, /data, or abort.
const char* GetAndroidData();
// Find $ANDROID_DATA, /data, or return null.
const char* GetAndroidDataSafe(std::string* error_msg);
+// Returns the default boot image location (ANDROID_ROOT/framework/boot.art).
+// Returns an empty string if ANDROID_ROOT is not set.
+std::string GetDefaultBootImageLocation(std::string* error_msg);
+
// Returns the dalvik-cache location, with subdir appended. Returns the empty string if the cache
// could not be found.
std::string GetDalvikCache(const char* subdir);