diff options
author | 2013-05-17 14:25:52 -0700 | |
---|---|---|
committer | 2013-05-17 21:30:02 +0000 | |
commit | 4361e1f46ef9e30c78679b5e2717b74d66191692 (patch) | |
tree | f9b9d1fe7fd81511e7931ef19fd22b5ca105135d | |
parent | 3c1ad55fcfa54c2c30073d07917da699d156dc58 (diff) |
Remove assist swipe from TOUCH_NAVIGATION devices
Bug: 9019927
Change-Id: I0a67ee00038b6fba7818f64ba02515767e34fe06
(cherry picked from commit 681a3d710402b80a8375a05172b1fb6f720295be)
-rw-r--r-- | services/input/InputReader.cpp | 51 | ||||
-rw-r--r-- | services/input/InputReader.h | 15 |
2 files changed, 0 insertions, 66 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 3d6b6e783c2a..10d759191875 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -2701,12 +2701,6 @@ void TouchInputMapper::dump(String8& dump) { mPointerYZoomScale); dump.appendFormat(INDENT4 "MaxSwipeWidth: %f\n", mPointerGestureMaxSwipeWidth); - } else if (mDeviceMode == DEVICE_MODE_NAVIGATION) { - dump.appendFormat(INDENT3 "Navigation Gesture Detector:\n"); - dump.appendFormat(INDENT4 "AssistStartY: %0.3f\n", - mNavigationAssistStartY); - dump.appendFormat(INDENT4 "AssistEndY: %0.3f\n", - mNavigationAssistEndY); } } @@ -3278,10 +3272,6 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) { // Abort current pointer usages because the state has changed. abortPointerUsage(when, 0 /*policyFlags*/); - } else if (mDeviceMode == DEVICE_MODE_NAVIGATION) { - // Compute navigation parameters. - mNavigationAssistStartY = mSurfaceHeight * 0.9f; - mNavigationAssistEndY = mSurfaceHeight * 0.5f; } // Inform the dispatcher about the changes. @@ -3621,7 +3611,6 @@ void TouchInputMapper::reset(nsecs_t when) { mPointerGesture.reset(); mPointerSimple.reset(); - mNavigation.reset(); if (mPointerController != NULL) { mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL); @@ -3772,8 +3761,6 @@ void TouchInputMapper::sync(nsecs_t when) { mPointerController->setSpots(mCurrentCookedPointerData.pointerCoords, mCurrentCookedPointerData.idToIndex, mCurrentCookedPointerData.touchingIdBits); - } else if (mDeviceMode == DEVICE_MODE_NAVIGATION) { - dispatchNavigationAssist(when, policyFlags); } dispatchHoverExit(when, policyFlags); @@ -5495,44 +5482,6 @@ void TouchInputMapper::abortPointerSimple(nsecs_t when, uint32_t policyFlags) { dispatchPointerSimple(when, policyFlags, false, false); } -void TouchInputMapper::dispatchNavigationAssist(nsecs_t when, uint32_t policyFlags) { - if (mCurrentCookedPointerData.touchingIdBits.count() == 1) { - if (mLastCookedPointerData.touchingIdBits.isEmpty()) { - // First pointer down. - uint32_t id = mCurrentCookedPointerData.touchingIdBits.firstMarkedBit(); - const PointerCoords& coords = mCurrentCookedPointerData.pointerCoordsForId(id); - if (coords.getY() >= mNavigationAssistStartY) { - // Start tracking the possible assist swipe. - mNavigation.activeAssistId = id; - return; - } - } else if (mNavigation.activeAssistId >= 0 - && mCurrentCookedPointerData.touchingIdBits.hasBit(mNavigation.activeAssistId)) { - const PointerCoords& coords = mCurrentCookedPointerData.pointerCoordsForId( - mNavigation.activeAssistId); - if (coords.getY() > mNavigationAssistEndY) { - // Swipe is still in progress. - return; - } - - // Detected assist swipe. - int32_t metaState = mContext->getGlobalMetaState(); - NotifyKeyArgs downArgs(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, - policyFlags | POLICY_FLAG_VIRTUAL, - AKEY_EVENT_ACTION_DOWN, 0, AKEYCODE_ASSIST, 0, metaState, when); - getListener()->notifyKey(&downArgs); - - NotifyKeyArgs upArgs(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, - policyFlags | POLICY_FLAG_VIRTUAL, - AKEY_EVENT_ACTION_UP, 0, AKEYCODE_ASSIST, 0, metaState, when); - getListener()->notifyKey(&upArgs); - } - } - - // Cancel the assist swipe. - mNavigation.activeAssistId = -1; -} - void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source, int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags, const PointerProperties* properties, const PointerCoords* coords, diff --git a/services/input/InputReader.h b/services/input/InputReader.h index ed2a5c10b052..f87f98e4081f 100644 --- a/services/input/InputReader.h +++ b/services/input/InputReader.h @@ -1437,10 +1437,6 @@ private: // The maximum swipe width. float mPointerGestureMaxSwipeWidth; - // The start and end Y thresholds for invoking the assist navigation swipe. - float mNavigationAssistStartY; - float mNavigationAssistEndY; - struct PointerDistanceHeapElement { uint32_t currentPointerIndex : 8; uint32_t lastPointerIndex : 8; @@ -1615,15 +1611,6 @@ private: } } mPointerSimple; - struct Navigation { - // The id of a pointer that is tracking a possible assist swipe. - int32_t activeAssistId; // -1 if none - - void reset() { - activeAssistId = -1; - } - } mNavigation; - // The pointer and scroll velocity controls. VelocityControl mPointerVelocityControl; VelocityControl mWheelXVelocityControl; @@ -1659,8 +1646,6 @@ private: bool down, bool hovering); void abortPointerSimple(nsecs_t when, uint32_t policyFlags); - void dispatchNavigationAssist(nsecs_t when, uint32_t policyFlags); - // Dispatches a motion event. // If the changedId is >= 0 and the action is POINTER_DOWN or POINTER_UP, the // method will take care of setting the index and transmuting the action to DOWN or UP |