mobicore: allow loading trustlets from the vendor folder
authorDanny Wood <danwood76@gmail.com>
Tue, 26 Nov 2019 14:03:03 +0000 (14:03 +0000)
committerDanny Wood <danwood76@gmail.com>
Thu, 9 Apr 2020 12:45:10 +0000 (13:45 +0100)
Change-Id: I471a76d03636859d78b7fb9582c7fb7c9769ca7a

mobicore/daemon/Registry/PrivateRegistry.cpp

index 694ed151fc7ae98e7ebb4d178bc26750f40c4f40..ed28389723ede6eccc91b497c96c689c004aa373 100644 (file)
@@ -72,6 +72,7 @@
 
 #define MC_REGISTRY_CONTAINER_PATH "/data/app/mcRegistry"
 #define MC_REGISTRY_DEFAULT_PATH "/system/app/mcRegistry"
+#define MC_REGISTRY_VENDOR_PATH "/vendor/app/mcRegistry"
 #define MC_REGISTRY_FALLBACK_PATH "/data/app/mcRegistry"
 #define AUTH_TOKEN_FILE_NAME "00000000.authtokcont"
 #define ENV_MC_AUTH_TOKEN_PATH "MC_AUTH_TOKEN_PATH"
@@ -138,8 +139,12 @@ string getTlRegistryPath()
     if (doesDirExist(MC_REGISTRY_DEFAULT_PATH)) {
         registryPath = MC_REGISTRY_DEFAULT_PATH;
         LOG_I(" Using MC_REGISTRY_PATH %s", registryPath.c_str());
+    } else if (doesDirExist(MC_REGISTRY_VENDOR_PATH)) {
+        // Second, attempt to use regular registry environment variable.
+        registryPath = MC_REGISTRY_VENDOR_PATH;
+        LOG_I(" Using MC_REGISTRY_VENDOR_PATH %s", registryPath.c_str());
     } else if (doesDirExist(MC_REGISTRY_FALLBACK_PATH)) {
-        // Second, attempt to use fallback registry environment variable.
+        // Third, attempt to use fallback registry environment variable.
         registryPath = MC_REGISTRY_FALLBACK_PATH;
         LOG_I(" Using MC_REGISTRY_FALLBACK_PATH %s", registryPath.c_str());
     }