summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
-rw-r--r--tools/aapt/ResourceTable.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index b9bf7991edb3..ff306ce5be6b 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -4732,6 +4732,32 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) {
return NO_ERROR;
}
+const String16 kTransitionElements[] = {
+ String16("fade"),
+ String16("changeBounds"),
+ String16("slide"),
+ String16("explode"),
+ String16("changeImageTransform"),
+ String16("changeTransform"),
+ String16("changeClipBounds"),
+ String16("autoTransition"),
+ String16("recolor"),
+ String16("changeScroll"),
+ String16("transitionSet"),
+ String16("transition"),
+ String16("transitionManager"),
+};
+
+static bool IsTransitionElement(const String16& name) {
+ for (int i = 0, size = sizeof(kTransitionElements) / sizeof(kTransitionElements[0]);
+ i < size; ++i) {
+ if (name == kTransitionElements[i]) {
+ return true;
+ }
+ }
+ return false;
+}
+
status_t ResourceTable::modifyForCompat(const Bundle* bundle,
const String16& resourceName,
const sp<AaptFile>& target,
@@ -4768,6 +4794,11 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle,
continue;
}
+ if (bundle->getNoVersionTransitions() && (IsTransitionElement(node->getElementName()))) {
+ // We were told not to version transition tags, so skip the children here.
+ continue;
+ }
+
const Vector<XMLNode::attribute_entry>& attrs = node->getAttributes();
for (size_t i = 0; i < attrs.size(); i++) {
const XMLNode::attribute_entry& attr = attrs[i];