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

Commit 4e19c48a authored by Ryan Mitchell's avatar Ryan Mitchell Committed by Michele
Browse files

Fix aapt2 JavaClassGenerator Maybe#value() call before check

Previous refactor accidentally assumed all attributes would have
resolvable symbols when generating the R class. Restore previous
behavior of calling SkipSymbol before retrieving the attribute
comment.

Bug: 145685954
Test: m TeleService
Change-Id: Ie8e1092556bc0b6a764462ffa0b99a876bcbd70e
parent 6572dcfa
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -304,9 +304,11 @@ void JavaClassGenerator::ProcessStyleable(const ResourceNameRef& name, const Res
    auto documentation_remove_iter = std::remove_if(documentation_attrs.begin(),
                                                    documentation_attrs.end(),
                                                    [&](StyleableAttr entry) -> bool {
      StringPiece attr_comment_line = entry.symbol.value().attribute->GetComment();
      return SkipSymbol(entry.symbol) || attr_comment_line.contains("@removed")
                                      || attr_comment_line.contains("@hide");
      if (SkipSymbol(entry.symbol)) {
        return true;
      }
      const StringPiece attr_comment_line = entry.symbol.value().attribute->GetComment();
      return attr_comment_line.contains("@removed") || attr_comment_line.contains("@hide");
    });
    documentation_attrs.erase(documentation_remove_iter, documentation_attrs.end());