diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-12-02 14:50:21 -0800 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2014-12-02 15:40:17 -0800 |
commit | 4c488ff931fe6b2fc79ef854febc98b4cb748402 (patch) | |
tree | 83c4d20398ce41b7ade1bc1ea460e3e2a87c5fdf /tools/aapt/Resource.cpp | |
parent | 92ad4dd017a13364b4001bdb04911202932f81c2 (diff) |
AAPT: Add custom transition classes to Proguard keep set
Bug:18590044
Change-Id: Ib24831e669a09f0e6f32434081c0e2499702399c
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r-- | tools/aapt/Resource.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 0d8db1354f3e..bfd05318d8bc 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -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; } |