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

Unverified Commit 857c96bc authored by Steve Kondik's avatar Steve Kondik Committed by Michael Bestas
Browse files

androidfw: Fix CMSDK resource handling on N

 * Consider the CMSDK package identifier in the new dynamic resource
   conditions.

Change-Id: I3e84d12ac86a6eb1d3407aa64234f80a0e945e70
parent 5210100b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -326,10 +326,16 @@ bool AssetManager::addDefaultAssets()
    String8 path(root);
    path.appendPath(kSystemAssets);

    bool ret = addAssetPath(path, NULL, false /* appAsLib */, true /* isSystemAsset */);
    if (ret) {
        String8 pathCM(root);
        pathCM.appendPath(kCMSDKAssets);

    return addAssetPath(path, NULL, false /* appAsLib */, true /* isSystemAsset */);
        if (!addAssetPath(pathCM, NULL, false /* appAsLib */, false /* isSystemAsset */)) {
            ALOGE("Failed to load CMSDK resources!");
        }
    }
    return ret;
}

int32_t AssetManager::nextAssetPath(const int32_t cookie) const
+8 −4
Original line number Diff line number Diff line
@@ -5190,7 +5190,8 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
                }

                uint32_t packageId = Res_GETPACKAGE(rid) + 1;
                if (packageId != APP_PACKAGE_ID && packageId != SYS_PACKAGE_ID) {
                if (packageId != APP_PACKAGE_ID && packageId != SYS_PACKAGE_ID &&
                        packageId != CMSDK_PACKAGE_ID) {
                    outValue->dataType = Res_value::TYPE_DYNAMIC_REFERENCE;
                }
                outValue->data = rid;
@@ -5211,7 +5212,8 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
                        outValue->data = rid;
                        outValue->dataType = Res_value::TYPE_DYNAMIC_REFERENCE;
                        return true;
                    } else if (packageId == APP_PACKAGE_ID || packageId == SYS_PACKAGE_ID) {
                    } else if (packageId == APP_PACKAGE_ID || packageId == SYS_PACKAGE_ID ||
                            packageId == CMSDK_PACKAGE_ID) {
                        // We accept packageId's generated as 0x01 in order to support
                        // building the android system resources
                        outValue->data = rid;
@@ -5357,7 +5359,8 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
            }

            uint32_t packageId = Res_GETPACKAGE(rid) + 1;
            if (packageId != APP_PACKAGE_ID && packageId != SYS_PACKAGE_ID) {
            if (packageId != APP_PACKAGE_ID && packageId != SYS_PACKAGE_ID &&
                    packageId != CMSDK_PACKAGE_ID) {
                outValue->dataType = Res_value::TYPE_DYNAMIC_ATTRIBUTE;
            }
            outValue->data = rid;
@@ -5372,7 +5375,8 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
                    outValue->data = rid;
                    outValue->dataType = Res_value::TYPE_DYNAMIC_ATTRIBUTE;
                    return true;
                } else if (packageId == APP_PACKAGE_ID || packageId == SYS_PACKAGE_ID) {
                } else if (packageId == APP_PACKAGE_ID || packageId == SYS_PACKAGE_ID ||
                        packageId == CMSDK_PACKAGE_ID) {
                    // We accept packageId's generated as 0x01 in order to support
                    // building the android system resources
                    outValue->data = rid;