Remove assist swipe from TOUCH_NAVIGATION devices
Bug: 9019927 Change-Id: I0a67ee00038b6fba7818f64ba02515767e34fe06 (cherry picked from commit 681a3d710402b80a8375a05172b1fb6f720295be)
This commit is contained in:
@@ -2701,12 +2701,6 @@ void TouchInputMapper::dump(String8& dump) {
|
|||||||
mPointerYZoomScale);
|
mPointerYZoomScale);
|
||||||
dump.appendFormat(INDENT4 "MaxSwipeWidth: %f\n",
|
dump.appendFormat(INDENT4 "MaxSwipeWidth: %f\n",
|
||||||
mPointerGestureMaxSwipeWidth);
|
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.
|
// Abort current pointer usages because the state has changed.
|
||||||
abortPointerUsage(when, 0 /*policyFlags*/);
|
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.
|
// Inform the dispatcher about the changes.
|
||||||
@@ -3621,7 +3611,6 @@ void TouchInputMapper::reset(nsecs_t when) {
|
|||||||
|
|
||||||
mPointerGesture.reset();
|
mPointerGesture.reset();
|
||||||
mPointerSimple.reset();
|
mPointerSimple.reset();
|
||||||
mNavigation.reset();
|
|
||||||
|
|
||||||
if (mPointerController != NULL) {
|
if (mPointerController != NULL) {
|
||||||
mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL);
|
mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL);
|
||||||
@@ -3772,8 +3761,6 @@ void TouchInputMapper::sync(nsecs_t when) {
|
|||||||
mPointerController->setSpots(mCurrentCookedPointerData.pointerCoords,
|
mPointerController->setSpots(mCurrentCookedPointerData.pointerCoords,
|
||||||
mCurrentCookedPointerData.idToIndex,
|
mCurrentCookedPointerData.idToIndex,
|
||||||
mCurrentCookedPointerData.touchingIdBits);
|
mCurrentCookedPointerData.touchingIdBits);
|
||||||
} else if (mDeviceMode == DEVICE_MODE_NAVIGATION) {
|
|
||||||
dispatchNavigationAssist(when, policyFlags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatchHoverExit(when, policyFlags);
|
dispatchHoverExit(when, policyFlags);
|
||||||
@@ -5495,44 +5482,6 @@ void TouchInputMapper::abortPointerSimple(nsecs_t when, uint32_t policyFlags) {
|
|||||||
dispatchPointerSimple(when, policyFlags, false, false);
|
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,
|
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,
|
int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags,
|
||||||
const PointerProperties* properties, const PointerCoords* coords,
|
const PointerProperties* properties, const PointerCoords* coords,
|
||||||
|
|||||||
@@ -1437,10 +1437,6 @@ private:
|
|||||||
// The maximum swipe width.
|
// The maximum swipe width.
|
||||||
float mPointerGestureMaxSwipeWidth;
|
float mPointerGestureMaxSwipeWidth;
|
||||||
|
|
||||||
// The start and end Y thresholds for invoking the assist navigation swipe.
|
|
||||||
float mNavigationAssistStartY;
|
|
||||||
float mNavigationAssistEndY;
|
|
||||||
|
|
||||||
struct PointerDistanceHeapElement {
|
struct PointerDistanceHeapElement {
|
||||||
uint32_t currentPointerIndex : 8;
|
uint32_t currentPointerIndex : 8;
|
||||||
uint32_t lastPointerIndex : 8;
|
uint32_t lastPointerIndex : 8;
|
||||||
@@ -1615,15 +1611,6 @@ private:
|
|||||||
}
|
}
|
||||||
} mPointerSimple;
|
} 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.
|
// The pointer and scroll velocity controls.
|
||||||
VelocityControl mPointerVelocityControl;
|
VelocityControl mPointerVelocityControl;
|
||||||
VelocityControl mWheelXVelocityControl;
|
VelocityControl mWheelXVelocityControl;
|
||||||
@@ -1659,8 +1646,6 @@ private:
|
|||||||
bool down, bool hovering);
|
bool down, bool hovering);
|
||||||
void abortPointerSimple(nsecs_t when, uint32_t policyFlags);
|
void abortPointerSimple(nsecs_t when, uint32_t policyFlags);
|
||||||
|
|
||||||
void dispatchNavigationAssist(nsecs_t when, uint32_t policyFlags);
|
|
||||||
|
|
||||||
// Dispatches a motion event.
|
// Dispatches a motion event.
|
||||||
// If the changedId is >= 0 and the action is POINTER_DOWN or POINTER_UP, the
|
// 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
|
// method will take care of setting the index and transmuting the action to DOWN or UP
|
||||||
|
|||||||
Reference in New Issue
Block a user