summaryrefslogtreecommitdiff
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2016-08-02 02:57:35 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-08-02 02:57:35 +0000
commit72979573d925d4def627d7fef29ea8ee920c934e (patch)
tree24038d74e8451b8006b3f24a49ea878fe59c8c5e /tools/aapt/Command.cpp
parent4453f846f9d7d7fdfa3a6c88b8f453b8c5762477 (diff)
parent12e5b87771d176dd2941db6f01b4034f9ac444a1 (diff)
AAPT: faketouch feature implied if no touchscreen feature requested. am: ca955a4c3a am: 76cbcd495e
am: 12e5b87771 Change-Id: Idf7c77d4122ab88b0fe1a1b3c42a196fd532d45c
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 288b2a320de6..cbad4b9b48a9 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -529,6 +529,16 @@ struct FeatureGroup {
int openGLESVersion;
};
+static bool hasFeature(const char* name, const FeatureGroup& grp,
+ const KeyedVector<String8, ImpliedFeature>& implied) {
+ String8 name8(name);
+ ssize_t idx = grp.features.indexOfKey(name8);
+ if (idx < 0) {
+ idx = implied.indexOfKey(name8);
+ }
+ return idx >= 0;
+}
+
static void addImpliedFeature(KeyedVector<String8, ImpliedFeature>* impliedFeatures,
const char* name, const char* reason, bool sdk23) {
String8 name8(name);
@@ -616,9 +626,16 @@ static void addParentFeatures(FeatureGroup* grp, const String8& name) {
} else if (name == "android.hardware.location.gps" ||
name == "android.hardware.location.network") {
grp->features.add(String8("android.hardware.location"), Feature(true));
+ } else if (name == "android.hardware.faketouch.multitouch") {
+ grp->features.add(String8("android.hardware.faketouch"), Feature(true));
+ } else if (name == "android.hardware.faketouch.multitouch.distinct" ||
+ name == "android.hardware.faketouch.multitouch.jazzhands") {
+ grp->features.add(String8("android.hardware.faketouch.multitouch"), Feature(true));
+ grp->features.add(String8("android.hardware.faketouch"), Feature(true));
} else if (name == "android.hardware.touchscreen.multitouch") {
grp->features.add(String8("android.hardware.touchscreen"), Feature(true));
- } else if (name == "android.hardware.touchscreen.multitouch.distinct") {
+ } else if (name == "android.hardware.touchscreen.multitouch.distinct" ||
+ name == "android.hardware.touchscreen.multitouch.jazzhands") {
grp->features.add(String8("android.hardware.touchscreen.multitouch"), Feature(true));
grp->features.add(String8("android.hardware.touchscreen"), Feature(true));
} else if (name == "android.hardware.opengles.aep") {
@@ -2033,8 +2050,12 @@ int doDump(Bundle* bundle)
}
}
- addImpliedFeature(&impliedFeatures, "android.hardware.touchscreen",
- "default feature for all apps", false);
+ // If the app hasn't declared the touchscreen as a feature requirement (either
+ // directly or implied, required or not), then the faketouch feature is implied.
+ if (!hasFeature("android.hardware.touchscreen", commonFeatures, impliedFeatures)) {
+ addImpliedFeature(&impliedFeatures, "android.hardware.faketouch",
+ "default feature for all apps", false);
+ }
const size_t numFeatureGroups = featureGroups.size();
if (numFeatureGroups == 0) {