Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ab6f2de authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "SystemConfig: Allow runtime differentiation of vendor configurations"...

Merge "SystemConfig: Allow runtime differentiation of vendor configurations" am: 8629072a am: 0fd9b2e0 am: 5117f62b am: cb361491 am: d8d247e7

Change-Id: If4b735c2d0db8ef5c312a4846163ae608de48e22
parents 47b30768 d8d247e7
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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;