summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2020-03-10 16:18:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-10 16:18:57 +0000
commit02e00a379b73b5f4ac858cc85af36c42d1811b4a (patch)
treea6a907a2fff30b04eb3f0988569bb3f277b893c2 /core/java
parentba592a2da06237b14092e9d3e23c789ff338751b (diff)
parent50c61752a8beaa5329b0ecc19b2c3733b14ffd2e (diff)
Merge "SystemConfig: Allow runtime differentiation of vendor configurations" into rvc-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/server/SystemConfig.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java
index 3378c073eace..d40924b603a5 100644
--- a/core/java/com/android/server/SystemConfig.java
+++ b/core/java/com/android/server/SystemConfig.java
@@ -82,6 +82,9 @@ public class SystemConfig {
// property for runtime configuration differentiation
private static final String SKU_PROPERTY = "ro.boot.product.hardware.sku";
+ // property for runtime configuration differentiation in vendor
+ private static final String VENDOR_SKU_PROPERTY = "ro.boot.product.vendor.sku";
+
// Group-ids that are given to all packages as read from etc/permissions/*.xml.
int[] mGlobalGids;
@@ -468,6 +471,17 @@ public class SystemConfig {
readPermissions(Environment.buildPath(
Environment.getVendorDirectory(), "etc", "permissions"), vendorPermissionFlag);
+ String vendorSkuProperty = SystemProperties.get(VENDOR_SKU_PROPERTY, "");
+ if (!vendorSkuProperty.isEmpty()) {
+ String vendorSkuDir = "sku_" + vendorSkuProperty;
+ readPermissions(Environment.buildPath(
+ Environment.getVendorDirectory(), "etc", "sysconfig", vendorSkuDir),
+ vendorPermissionFlag);
+ readPermissions(Environment.buildPath(
+ Environment.getVendorDirectory(), "etc", "permissions", vendorSkuDir),
+ vendorPermissionFlag);
+ }
+
// Allow ODM to customize system configs as much as Vendor, because /odm is another
// vendor partition other than /vendor.
int odmPermissionFlag = vendorPermissionFlag;