summaryrefslogtreecommitdiff
path: root/tools/aapt2/link/ManifestFixer_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/link/ManifestFixer_test.cpp')
-rw-r--r--tools/aapt2/link/ManifestFixer_test.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/aapt2/link/ManifestFixer_test.cpp b/tools/aapt2/link/ManifestFixer_test.cpp
index adea6273bc8b..fcc9f559a73f 100644
--- a/tools/aapt2/link/ManifestFixer_test.cpp
+++ b/tools/aapt2/link/ManifestFixer_test.cpp
@@ -832,4 +832,36 @@ TEST_F(ManifestFixerTest, UsesLibraryMustHaveNonEmptyName) {
EXPECT_THAT(Verify(input), NotNull());
}
+TEST_F(ManifestFixerTest, UsesFeatureAddDeprecated) {
+ std::string input = R"(
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android">
+ <uses-feature android:name="android.hardware.biometrics.fingerprint" />
+ <feature-group>
+ <uses-feature android:name="android.hardware.biometrics.fingerprint" />
+ </feature-group>
+ </manifest>)";
+
+ std::unique_ptr<xml::XmlResource> manifest = Verify(input);
+ ASSERT_THAT(manifest, NotNull());
+ EXPECT_THAT(manifest->root->FindChildWithAttribute("", "uses-feature",
+ xml::kSchemaAndroid, "name",
+ "android.hardware.biometrics.fingerprint"),
+ Ne(nullptr));
+ EXPECT_THAT(manifest->root->FindChildWithAttribute("", "uses-feature",
+ xml::kSchemaAndroid, "name",
+ "android.hardware.fingerprint"),
+ Ne(nullptr));
+
+ xml::Element* feature_group = manifest->root->FindChild("", "feature-group");
+ ASSERT_THAT(feature_group, Ne(nullptr));
+
+ EXPECT_THAT(feature_group->FindChildWithAttribute("", "uses-feature", xml::kSchemaAndroid, "name",
+ "android.hardware.biometrics.fingerprint"),
+ Ne(nullptr));
+ EXPECT_THAT(feature_group->FindChildWithAttribute("", "uses-feature", xml::kSchemaAndroid, "name",
+ "android.hardware.fingerprint"),
+ Ne(nullptr));
+}
+
} // namespace aapt