Remove use of mCanceled

It is possible for mCanceled to be set to true even though it
was canceled without ever playing back the cancelation message.
This can end up putting us in an incorrect state where the user
must release both fingers so ACTION_UP finally sets mCanceled to
false.

The cancel() method was still being called and since it does the
proper checks for removing/sending messages, the use of mCanceled
is unneccessary.

Change-Id: I38679d3bf65157a9ba5ca3d898c5c8d55e5df9f5
REF: LETTUCE-293
(cherry picked from commit a726a3d990)
(cherry picked from commit 8bcb714b05)
This commit is contained in:
d34d
2015-05-19 14:44:55 -07:00
committed by Abhisek Devkota
parent acf62d111f
commit dd3f6bdf28

View File

@@ -91,7 +91,6 @@ public class EnableAccessibilityController {
private final float mTouchSlop;
private boolean mDestroyed;
private boolean mCanceled;
private float mFirstPointerDownX;
private float mFirstPointerDownY;
@@ -177,12 +176,6 @@ public class EnableAccessibilityController {
public boolean onTouchEvent(MotionEvent event) {
final int pointerCount = event.getPointerCount();
final int action = event.getActionMasked();
if (mCanceled) {
if (action == MotionEvent.ACTION_UP) {
mCanceled = false;
}
return true;
}
switch (action) {
case MotionEvent.ACTION_POINTER_DOWN: {
if (pointerCount > 2) {
@@ -218,7 +211,6 @@ public class EnableAccessibilityController {
}
private void cancel() {
mCanceled = true;
if (mHandler.hasMessages(MESSAGE_SPEAK_WARNING)) {
mHandler.removeMessages(MESSAGE_SPEAK_WARNING);
} else if (mHandler.hasMessages(MESSAGE_ENABLE_ACCESSIBILITY)) {