Support profileable application action

Fixes: 129358330
Test: make -j16 aapt2_run_host_unit_tests && cat out/target/product/walleye/obj/PACKAGING/aapt2_run_host_unit_tests_intermediates/result.xml | grep "failure message"
Change-Id: Id9ec59447a99a5f6e0bfe47c0b8ce3553bf751c7
This commit is contained in:
Chris Craik
2019-04-04 12:46:47 -07:00
parent dd07ae579c
commit 335b565eb6
2 changed files with 19 additions and 0 deletions

View File

@@ -367,6 +367,7 @@ bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor,
application_action["uses-library"].Action(RequiredNameIsNotEmpty);
application_action["library"].Action(RequiredNameIsNotEmpty);
application_action["profileable"];
xml::XmlNodeAction& static_library_action = application_action["static-library"];
static_library_action.Action(RequiredNameIsJavaPackage);

View File

@@ -671,6 +671,24 @@ TEST_F(ManifestFixerTest, ApplicationInjectDebuggable) {
{}, "application", xml::kSchemaAndroid, "debuggable", "true"), NotNull());
}
TEST_F(ManifestFixerTest, ApplicationProfileable) {
std::string shell = R"(
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android">
<application>
<profileable android:shell="true"/>
</application>
</manifest>)";
EXPECT_THAT(Verify(shell), NotNull());
std::string noshell = R"(
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android">
<application>
<profileable/>
</application>
</manifest>)";
EXPECT_THAT(Verify(noshell), NotNull());
}
TEST_F(ManifestFixerTest, IgnoreNamespacedElements) {
std::string input = R"EOF(