summaryrefslogtreecommitdiffstats
path: root/services/inputflinger/InputReader.cpp
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-04-21 21:46:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-21 21:46:32 +0000
commite893dddb3f6f84bfdbf875df643ad4b20fb77599 (patch)
treea26012f10c29e32f9840d977e09a7cdd075d766c /services/inputflinger/InputReader.cpp
parent5e17a5de888632c7e72171765bc70c8b9169f7ed (diff)
parent45ccacf937d0d5a957348327ad9947ae96c5d472 (diff)
downloadframeworks_native-e893dddb3f6f84bfdbf875df643ad4b20fb77599.zip
frameworks_native-e893dddb3f6f84bfdbf875df643ad4b20fb77599.tar.gz
frameworks_native-e893dddb3f6f84bfdbf875df643ad4b20fb77599.tar.bz2
Merge "Default to TOOL_TYPE_STYLUS for external stylus events."
Diffstat (limited to 'services/inputflinger/InputReader.cpp')
-rw-r--r--services/inputflinger/InputReader.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index c7d9503..8709692 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -6511,6 +6511,11 @@ void ExternalStylusInputMapper::sync(nsecs_t when) {
mStylusState.when = when;
+ mStylusState.toolType = mTouchButtonAccumulator.getToolType();
+ if (mStylusState.toolType == AMOTION_EVENT_TOOL_TYPE_UNKNOWN) {
+ mStylusState.toolType = AMOTION_EVENT_TOOL_TYPE_STYLUS;
+ }
+
int32_t pressure = mSingleTouchMotionAccumulator.getAbsolutePressure();
if (mRawPressureAxis.valid) {
mStylusState.pressure = float(pressure) / mRawPressureAxis.maxValue;
@@ -6521,7 +6526,6 @@ void ExternalStylusInputMapper::sync(nsecs_t when) {
}
mStylusState.buttons = mTouchButtonAccumulator.getButtonState();
- mStylusState.toolType = mTouchButtonAccumulator.getToolType();
mContext->dispatchExternalStylusState(mStylusState);
}