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

Commit b727f7eb authored by Jake Wharton's avatar Jake Wharton Committed by Android (Google) Code Review
Browse files

Merge "Add rule emissions for appComponentFactory"

parents 6f10a213 e4bd1602
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -259,6 +259,13 @@ class ManifestVisitor : public BaseVisitor {
            AddClass(node->line_number, result.value());
          }
        }
        attr = node->FindAttribute(xml::kSchemaAndroid, "appComponentFactory");
        if (attr) {
          Maybe<std::string> result = util::GetFullyQualifiedClassName(package_, attr->value);
          if (result) {
            AddClass(node->line_number, result.value());
          }
        }
        if (main_dex_only_) {
          xml::Attribute* default_process = node->FindAttribute(xml::kSchemaAndroid, "process");
          if (default_process) {
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ TEST(ProguardRulesTest, ManifestRuleDefaultConstructorOnly) {
  std::unique_ptr<xml::XmlResource> manifest = test::BuildXmlDom(R"(
      <manifest xmlns:android="http://schemas.android.com/apk/res/android">
        <application
            android:appComponentFactory="com.foo.BarAppComponentFactory"
            android:backupAgent="com.foo.BarBackupAgent"
            android:name="com.foo.BarApplication"
            >
@@ -54,6 +55,7 @@ TEST(ProguardRulesTest, ManifestRuleDefaultConstructorOnly) {

  std::string actual = GetKeepSetString(set);

  EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarAppComponentFactory { <init>(); }"));
  EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarBackupAgent { <init>(); }"));
  EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarApplication { <init>(); }"));
  EXPECT_THAT(actual, HasSubstr("-keep class com.foo.BarActivity { <init>(); }"));