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

Commit ab2da497 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AAPT2: Handle inflating compiled attributes."

parents 63fd2d6b 4b8ca8be
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -236,16 +236,22 @@ static void CopyAttributes(Element* el, android::ResXMLParser* parser, StringPoo
        attr.name = util::Utf16ToUtf8(StringPiece16(str16, len));
      }

      uint32_t res_id = parser->getAttributeNameResID(i);
      if (res_id > 0) {
        attr.compiled_attribute = AaptAttribute(::aapt::Attribute(), {res_id});
      }

      str16 = parser->getAttributeStringValue(i, &len);
      if (str16) {
        attr.value = util::Utf16ToUtf8(StringPiece16(str16, len));
      }

      } else {
        android::Res_value res_value;
        if (parser->getAttributeValue(i, &res_value) > 0) {
          attr.compiled_value = ResourceUtils::ParseBinaryResValue(
              ResourceType::kAnim, {}, parser->getStrings(), res_value, out_pool);
        }
      }


      el->attributes.push_back(std::move(attr));
    }