From eaeb19048672337714c1724de7992be8cb3f2124 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Thu, 5 Sep 2013 18:15:57 -0700 Subject: [PATCH] Added support for supports-input manifest element Change-Id: Ifa7c87908081585c1940b5a47fdf5138a287d9ea --- .../android/content/pm/PackageParser.java | 3 + core/res/res/values/attrs_manifest.xml | 23 ++- tools/aapt/Command.cpp | 139 +++++++++++------- 3 files changed, 109 insertions(+), 56 deletions(-) diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index b4321643204be..541dcb93d9563 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -1311,6 +1311,9 @@ public class PackageParser { // Just skip this tag XmlUtils.skipCurrentTag(parser); continue; + } else if (tagName.equals("supports-input")) { + XmlUtils.skipCurrentTag(parser); + continue; } else if (tagName.equals("eat-comment")) { // Just skip this tag diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 60ed0e5b515f6..05ca120595472 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -1718,20 +1718,20 @@ - + - + - + - + + + + + + diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index cadac02f1e049..1e3b05899d08b 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -621,6 +621,7 @@ int doDump(Bundle* bundle) bool isLauncherActivity = false; bool isSearchable = false; bool withinApplication = false; + bool withinSupportsInput = false; bool withinReceiver = false; bool withinService = false; bool withinIntentFilter = false; @@ -711,11 +712,26 @@ int doDump(Bundle* bundle) String8 activityIcon; String8 receiverName; String8 serviceName; + Vector supportedInput; while ((code=tree.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) { if (code == ResXMLTree::END_TAG) { depth--; if (depth < 2) { + if (withinSupportsInput && !supportedInput.isEmpty()) { + printf("supports-input: '"); + const size_t N = supportedInput.size(); + for (size_t i=0; i