summaryrefslogtreecommitdiff
path: root/core/java/android/os/Environment.java
diff options
context:
space:
mode:
authorDario Freni <dariofreni@google.com>2018-06-01 14:02:08 +0100
committerDario Freni <dariofreni@google.com>2018-08-17 16:34:03 +0000
commit2bef1768a8bc63d21740fdbb2ff59c0bf15a3275 (patch)
tree6fed8f7234dfffcbc16102cccd600c5c591ef3ed /core/java/android/os/Environment.java
parent804574644849ef39d63d6515497469ee3b33b1d8 (diff)
Support /product-services partition
This CL is largely an adaptation of Change-Id I16175933cebd9ec665d190cc5d564b5414a91827 . I also used the same way for testing the change. This CL will support the followings. - installing a RRO package for framework from /product-services/overlay - installing apps from /product-services/app - installing priv-apps from /product-services/priv-app - installing permissions from /product-services/etc/[default-permissions|permissions|sysconfig] Bug: 80741439 Test: `mm` under frameworks/base/tests/[libs|privapp]-permissions adb sync && adb reboot adb shell cmd package list libraries => confirmed com.android.test.libs.product_services library adb shell cmd package dump \ com.android.framework.permission.privapp.tests.product_services => confirmed that the package is a priv-app And I moved vendor/overlay/framework-res__auto_generated_rro.apk into system/product-services/overlay/ on taimen, and I confirmed that the RRO was installed properly. Change-Id: I7a6a30bf8e8db9f2738594d187bb9148f138b8da (cherry picked from commit a4af41736894bd3bf5bdc2a279acbeed2a24dd3d)
Diffstat (limited to 'core/java/android/os/Environment.java')
-rw-r--r--core/java/android/os/Environment.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index e32ed9deb270..347f60f6b9be 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -45,6 +45,7 @@ public class Environment {
private static final String ENV_ODM_ROOT = "ODM_ROOT";
private static final String ENV_VENDOR_ROOT = "VENDOR_ROOT";
private static final String ENV_PRODUCT_ROOT = "PRODUCT_ROOT";
+ private static final String ENV_PRODUCT_SERVICES_ROOT = "PRODUCT_SERVICES_ROOT";
/** {@hide} */
public static final String DIR_ANDROID = "Android";
@@ -67,6 +68,8 @@ public class Environment {
private static final File DIR_ODM_ROOT = getDirectory(ENV_ODM_ROOT, "/odm");
private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor");
private static final File DIR_PRODUCT_ROOT = getDirectory(ENV_PRODUCT_ROOT, "/product");
+ private static final File DIR_PRODUCT_SERVICES_ROOT = getDirectory(ENV_PRODUCT_SERVICES_ROOT,
+ "/product_services");
private static UserEnvironment sCurrentUser;
private static boolean sUserRequired;
@@ -196,6 +199,16 @@ public class Environment {
}
/**
+ * Return root directory of the "product_services" partition holding middleware
+ * services if any. If present, the partition is mounted read-only.
+ *
+ * @hide
+ */
+ public static File getProductServicesDirectory() {
+ return DIR_PRODUCT_SERVICES_ROOT;
+ }
+
+ /**
* Return the system directory for a user. This is for use by system
* services to store files relating to the user. This directory will be
* automatically deleted when the user is removed.