OSDN Git Service

Always update external stylus state.
authorMichael Wright <michaelwr@google.com>
Mon, 20 Apr 2015 21:03:54 +0000 (22:03 +0100)
committerMichael Wright <michaelwr@google.com>
Mon, 20 Apr 2015 21:03:54 +0000 (22:03 +0100)
This prevents us from dropping any states (namely the pressure
transition from non-zero to zero) if we get the touch up before we
get the stylus data.

Change-Id: Ifc198628d35b7079dc5ec23d81f9681d122757a0

services/inputflinger/InputReader.cpp

index 5654799..0e60d4d 100644 (file)
@@ -4127,13 +4127,13 @@ void TouchInputMapper::timeoutExpired(nsecs_t when) {
 }
 
 void TouchInputMapper::updateExternalStylusState(const StylusState& state) {
+    mExternalStylusState.copyFrom(state);
     if (mExternalStylusId != -1 || mExternalStylusDataTimeout != LLONG_MAX) {
         // We're either in the middle of a fused stream of data or we're waiting on data before
         // dispatching the initial down, so go ahead and dispatch now that we have fresh stylus
         // data.
         mExternalStylusDataTimeout = LLONG_MAX;
         mExternalStylusDataPending = true;
-        mExternalStylusState.copyFrom(state);
         processRawTouches(false /*timeout*/);
     }
 }