diff options
author | Michael Wright <michaelwr@google.com> | 2015-04-21 19:01:58 +0100 |
---|---|---|
committer | Michael Wright <michaelwr@google.com> | 2015-04-21 22:41:15 +0100 |
commit | 45ccacf937d0d5a957348327ad9947ae96c5d472 (patch) | |
tree | 50f2b18d1e686a039d66dd3c8cd54cab79e43c63 /services | |
parent | 671024b4cd58d6843a34649365851401eb65bb7a (diff) | |
download | frameworks_native-45ccacf937d0d5a957348327ad9947ae96c5d472.zip frameworks_native-45ccacf937d0d5a957348327ad9947ae96c5d472.tar.gz frameworks_native-45ccacf937d0d5a957348327ad9947ae96c5d472.tar.bz2 |
Default to TOOL_TYPE_STYLUS for external stylus events.
Change-Id: Ife6a7c4802e8b1ec1ff8445e639f8a6d90a00592
Diffstat (limited to 'services')
-rw-r--r-- | services/inputflinger/InputReader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 3e9f765..8de8132 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); } |