Use speed-profile with the cloud profile for apks loaded by other apps.

- Add `getOdexVisibility`, which returns the visibility of the odex file
  of an APK.
- Change `prepareAppProfile` to accept `userId` being `USER_NULL`. This
  is needed by the corresponding change in framework/base, which passes
  `USER_NULL` as `userId` to indicate that the current profile should
  remain unchanged.

Bug: 175039995
Test: atest CtsCompilationTestCases
Ignore-AOSP-First: Merge conflicts.
Change-Id: I6a9a1077cee6a6d6d02ac2375da55c4a10b11861
diff --git a/cmds/installd/installd_constants.h b/cmds/installd/installd_constants.h
index 00d8441..3623f9b 100644
--- a/cmds/installd/installd_constants.h
+++ b/cmds/installd/installd_constants.h
@@ -18,6 +18,8 @@
 #ifndef INSTALLD_CONSTANTS_H_
 #define INSTALLD_CONSTANTS_H_
 
+#include "cutils/multiuser.h"
+
 namespace android {
 namespace installd {
 
@@ -83,6 +85,15 @@
 constexpr int PROFILES_ANALYSIS_DONT_OPTIMIZE_SMALL_DELTA    = 2;
 constexpr int PROFILES_ANALYSIS_DONT_OPTIMIZE_EMPTY_PROFILES = 3;
 
+// NOTE: keep in sync with Installer.java
+constexpr int ODEX_NOT_FOUND = 0;
+constexpr int ODEX_IS_PUBLIC = 1;
+constexpr int ODEX_IS_PRIVATE = 2;
+
+// NOTE: keep in sync with UserHandle.java
+constexpr userid_t USER_NULL = -10000;
+constexpr userid_t USER_SYSTEM = 0;
+
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
 
 }  // namespace installd