summaryrefslogtreecommitdiff
path: root/tools/aapt2/link
diff options
context:
space:
mode:
authorKevin Chyn <kchyn@google.com>2019-01-22 18:19:26 +0000
committerKevin Chyn <kchyn@google.com>2019-01-22 18:19:26 +0000
commit06f2c9fc73299b5440b25eab5718a1e757b4e1ab (patch)
tree39305517cef802bcd654f26ad65226bd324e9bde /tools/aapt2/link
parente1de284ae9e163b90c8bac9f428026f3213ef358 (diff)
Revert "Add android.hardware.fingerprint for pre-Q"
This reverts commit e1de284ae9e163b90c8bac9f428026f3213ef358. Reason for revert: b/115639644 comment #27 Change-Id: Icf1f067b4d8f6b83be86128f07a89608112cebeb
Diffstat (limited to 'tools/aapt2/link')
-rw-r--r--tools/aapt2/link/ManifestFixer.cpp22
-rw-r--r--tools/aapt2/link/ManifestFixer_test.cpp32
2 files changed, 0 insertions, 54 deletions
diff --git a/tools/aapt2/link/ManifestFixer.cpp b/tools/aapt2/link/ManifestFixer.cpp
index 5812ec44f1fb..85bf6f218ba0 100644
--- a/tools/aapt2/link/ManifestFixer.cpp
+++ b/tools/aapt2/link/ManifestFixer.cpp
@@ -213,27 +213,6 @@ static bool VerifyUsesFeature(xml::Element* el, SourcePathDiagnostics* diag) {
return true;
}
-static bool AddDeprecatedUsesFeatures(xml::Element* el, SourcePathDiagnostics* diag) {
- if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "name")) {
- if (attr->value.empty()) {
- return true;
- }
-
- // Add "android.hardware.fingerprint" when "android.hardware.biometric.fingerprint" is found,
- // since the former is deprecated in Q and the latter is not present pre-Q. (see b/115639644)
- if (attr->value == "android.hardware.biometrics.fingerprint") {
- auto element = el->CloneElement([&](const xml::Element& el, xml::Element* out_el) {
- xml::Attribute* cloned_attr = out_el->FindOrCreateAttribute(xml::kSchemaAndroid, "name");
- cloned_attr->value = "android.hardware.fingerprint";
- });
-
- el->parent->AppendChild(std::move(element));
- }
- }
-
- return true;
-}
-
bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor,
IDiagnostics* diag) {
// First verify some options.
@@ -268,7 +247,6 @@ bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor,
// Common <uses-feature> actions.
xml::XmlNodeAction uses_feature_action;
uses_feature_action.Action(VerifyUsesFeature);
- uses_feature_action.Action(AddDeprecatedUsesFeatures);
// Common component actions.
xml::XmlNodeAction component_action;
diff --git a/tools/aapt2/link/ManifestFixer_test.cpp b/tools/aapt2/link/ManifestFixer_test.cpp
index fcc9f559a73f..adea6273bc8b 100644
--- a/tools/aapt2/link/ManifestFixer_test.cpp
+++ b/tools/aapt2/link/ManifestFixer_test.cpp
@@ -832,36 +832,4 @@ 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