Skip to content
Snippets Groups Projects
Commit 50c61752 authored by Roopesh Nataraja's avatar Roopesh Nataraja Committed by Steven Moreland
Browse files

SystemConfig: Allow runtime differentiation of vendor configurations

Single vendor can support multiple sku's with different capabilities.
Add support to load capability xml's from below vendor locations.

vendor/etc/sysconf/sku_${ro.boot.product.vendor.sku}/*.xml
vendor/etc/permissions/sku_${ro.boot.product.vendor.sku}/*.xml

Bug : 148582757
Test: Copy capability xml's to above mentioned vendor locations
      during compilation and check if it gets loaded by
      SystemConfig at runtime.

Change-Id: Ic1a332d30224f6d26afdfc230ea7c1462aefa243
(cherry picked from commit 62e21252)
Merged-In: Ic1a332d30224f6d26afdfc230ea7c1462aefa243
parent 10c0d0d2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment