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

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

Merge "Fix deserialization of @id aliases"

parents 2aea1e07 4abc8285
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -738,8 +738,14 @@ std::unique_ptr<Item> ParseBinaryResValue(const ResourceType& type, const Config
                                          const android::Res_value& res_value,
                                          StringPool* dst_pool) {
  if (type == ResourceType::kId) {
    if (res_value.dataType != android::Res_value::TYPE_REFERENCE &&
        res_value.dataType != android::Res_value::TYPE_DYNAMIC_REFERENCE) {
      // plain "id" resources are actually encoded as dummy values (aapt1 uses an empty string,
      // while aapt2 uses a false boolean).
      return util::make_unique<Id>();
    }
    // fall through to regular reference deserialization logic
  }

  const uint32_t data = util::DeviceToHost32(res_value.data);
  switch (res_value.dataType) {