Bug 716673 - Remove some dead code. r=pcwalton a=akeybl
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 10 Jan 2012 10:05:43 -0500
changeset 84985 142e0e5764d39d344399f7807e1d06d03276e15a
parent 84984 412fc777469b82afd4a289643a83172c2c6286e1
child 84986 ec0d8180ab04d5bcd394baac89521239f3978836
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspcwalton, akeybl
bugs716673
milestone11.0a2
Bug 716673 - Remove some dead code. r=pcwalton a=akeybl Events that come in for the non-primary pointer are ACTION_POINTER_DOWN rather than ACTION_DOWN, so this code will never get exercised.
mobile/android/base/ui/PanZoomController.java
--- a/mobile/android/base/ui/PanZoomController.java
+++ b/mobile/android/base/ui/PanZoomController.java
@@ -280,17 +280,17 @@ public class PanZoomController
             mLastEventTime = event.getEventTime();
             return false;
         case TOUCHING:
         case PANNING:
         case PANNING_LOCKED:
         case PANNING_HOLD:
         case PANNING_HOLD_LOCKED:
         case PINCHING:
-            mState = PanZoomState.PINCHING;
+            Log.e(LOGTAG, "Received impossible touch down while in " + mState);
             return false;
         }
         Log.e(LOGTAG, "Unhandled case " + mState + " in onTouchStart");
         return false;
     }
 
     @SuppressWarnings("fallthrough")
     private boolean onTouchMove(MotionEvent event) {
@@ -349,29 +349,17 @@ public class PanZoomController
         case PANNING:
         case PANNING_LOCKED:
         case PANNING_HOLD:
         case PANNING_HOLD_LOCKED:
             mState = PanZoomState.FLING;
             fling();
             return true;
         case PINCHING:
-            int points = event.getPointerCount();
-            if (points == 1) {
-                // last touch up
-                mState = PanZoomState.NOTHING;
-            } else if (points == 2) {
-                int pointRemovedIndex = event.getActionIndex();
-                int pointRemainingIndex = 1 - pointRemovedIndex; // kind of a hack
-                mState = PanZoomState.TOUCHING;
-                mX.firstTouchPos = mX.touchPos = event.getX(pointRemainingIndex);
-                mX.firstTouchPos = mY.touchPos = event.getY(pointRemainingIndex);
-            } else {
-                // still pinching, do nothing
-            }
+            mState = PanZoomState.NOTHING;
             return true;
         case ANIMATED_ZOOM:
             return false;
         }
         Log.e(LOGTAG, "Unhandled case " + mState + " in onTouchEnd");
         return false;
     }