Merge "AAPT: Add custom transition classes to Proguard keep set" into lmp-mr1-dev

This commit is contained in:
Adam Lesinski
2014-12-02 23:50:49 +00:00
committed by Android (Google) Code Review

View File

@ -2985,6 +2985,8 @@ status_t
writeProguardForLayouts(ProguardKeepSet* keep, const sp<AaptAssets>& assets)
{
status_t err;
const String8 kTransition("transition");
const String8 kTransitionPrefix("transition-");
// tag:attribute pairs that should be checked in layout files.
KeyedVector<String8, Vector<NamespaceAttributePair> > kLayoutTagAttrPairs;
@ -2997,6 +2999,10 @@ writeProguardForLayouts(ProguardKeepSet* keep, const sp<AaptAssets>& assets)
addTagAttrPair(&kXmlTagAttrPairs, "PreferenceScreen", RESOURCES_ANDROID_NAMESPACE, "fragment");
addTagAttrPair(&kXmlTagAttrPairs, "header", RESOURCES_ANDROID_NAMESPACE, "fragment");
// tag:attribute pairs that should be checked in transition files.
KeyedVector<String8, Vector<NamespaceAttributePair> > kTransitionTagAttrPairs;
addTagAttrPair(&kTransitionTagAttrPairs, kTransition.string(), NULL, "class");
const Vector<sp<AaptDir> >& dirs = assets->resDirs();
const size_t K = dirs.size();
for (size_t k=0; k<K; k++) {
@ -3014,6 +3020,9 @@ writeProguardForLayouts(ProguardKeepSet* keep, const sp<AaptAssets>& assets)
} else if ((dirName == String8("menu")) || (strncmp(dirName.string(), "menu-", 5) == 0)) {
startTags.add(String8("menu"));
tagAttrPairs = NULL;
} else if (dirName == kTransition || (strncmp(dirName.string(), kTransitionPrefix.string(),
kTransitionPrefix.size()) == 0)) {
tagAttrPairs = &kTransitionTagAttrPairs;
} else {
continue;
}