diff options
Diffstat (limited to 'tools/aapt/ResourceTable.cpp')
-rw-r--r-- | tools/aapt/ResourceTable.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index 661409e3d4bc..63498f7cef08 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -4730,6 +4730,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, @@ -4766,6 +4792,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]; |