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

Commit b70efcbb authored by Ying Wang's avatar Ying Wang Committed by Android Git Automerger
Browse files

am 3c05f1fb: am b5fb50a1: Merge "Add instrumentation as a source tag for...

am 3c05f1fb: am b5fb50a1: Merge "Add instrumentation as a source tag for proguard keep options." into eclair

Merge commit '3c05f1fb'

* commit '3c05f1fb':
  Add instrumentation as a source tag for proguard keep options.
parents 6d001c0f 3c05f1fb
Loading
Loading
Loading
Loading
+44 −36
Original line number Diff line number Diff line
@@ -1750,18 +1750,27 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass
        depth++;
        String8 tag(tree.getElementName(&len));
        // printf("Depth %d tag %s\n", depth, tag.string());
        bool keepTag = false;
        if (depth == 1) {
            if (tag != "manifest") {
                fprintf(stderr, "ERROR: manifest does not start with <manifest> tag\n");
                return -1;
            }
            pkg = getAttribute(tree, NULL, "package", NULL);
        } else if (depth == 2 && tag == "application") {
        } else if (depth == 2) {
            if (tag == "application") {
                inApplication = true;
                keepTag = true;
            } else if (tag == "instrumentation") {
                keepTag = true;
            }
        if (inApplication) {
            if (tag == "application" || tag == "activity" || tag == "service" || tag == "receiver"
                    || tag == "provider") {
        }
        if (!keepTag && inApplication && depth == 3) {
            if (tag == "activity" || tag == "service" || tag == "receiver" || tag == "provider") {
                keepTag = true;
            }
        }
        if (keepTag) {
            String8 name = getAttribute(tree, "http://schemas.android.com/apk/res/android",
                    "name", &error);
            if (error != "") {
@@ -1797,7 +1806,6 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& ass
            }
        }
    }
    }

    return NO_ERROR;
}