Buggy code:
public class TouchTracker implements View . OnTouchListener { RippleDrawable mHotspotDrawable ; TouchTracker . PerformClick mPerformClick ; TouchTracker . CheckForTap mPendingCheckForTap ; TouchTracker . CheckForLongPress mPendingCheckForLongPress ; TouchTracker . UnsetPressedState mUnsetPressedState ; boolean mHasPerformedLongPress ; int mTouchSlop ; boolean mPrePressed ; boolean mInsideScrollContainer ; public TouchTracker ( RippleDrawable hotspot ) { } public void setInsideScrollContainer ( boolean inside ) { } @ Override public boolean onTouch ( View v , MotionEvent event ) { final float x = event . getX ( ) ; final float y = event . getY ( ) ; if ( ( v . isClickable ( ) ) || ( v . isLongClickable ( ) ) ) { switch ( event . getAction ( ) ) { case MotionEvent . ACTION_UP : <START_BUG> if ( ( mPrePressed ) || ( v . isPressed ( ) ) ) { <END_BUG> boolean focusTaken = false ; if ( ( ( v . isFocusable ( ) ) && ( v . isFocusableInTouchMode ( ) ) ) && ( ! ( v . isFocused ( ) ) ) ) { focusTaken = v . requestFocus ( ) ; } if ( mPrePressed ) { setPressed ( v , true , x , y ) ; } if ( ! ( mHasPerformedLongPress ) ) { removeLongPressCallback ( v ) ; if ( ! focusTaken ) { if ( ( mPerformClick ) == null ) { mPerformClick = new TouchTracker . PerformClick ( v ) ; } if ( ! ( v . post ( mPerformClick ) ) ) { v . performClick ( ) ; } } } if ( ( mUnsetPressedState ) == null ) { mUnsetPressedState = new TouchTracker . UnsetPressedState ( v ) ; } if ( mPrePressed ) { v . postDelayed ( mUnsetPressedState , ViewConfiguration . getPressedStateDuration ( ) ) ; } else if ( ! ( v . post ( mUnsetPressedState ) ) ) { mUnsetPressedState . run ( ) ; } removeTapCallback ( v ) ; } break ; case MotionEvent . ACTION_DOWN : mHasPerformedLongPress = false ; if ( mInsideScrollContainer ) { mPrePressed = true ; if ( ( mPendingCheckForTap ) == null ) { mPendingCheckForTap = new TouchTracker . CheckForTap ( v ) ; } mPendingCheckForTap . x = event . getX ( ) ; mPendingCheckForTap . y = event . getY ( ) ; v . postDelayed ( mPendingCheckForTap , ViewConfiguration . getTapTimeout ( ) ) ; } else { setPressed ( v , true , x , y ) ; checkForLongClick ( v , 0 ) ; } break ; case MotionEvent . ACTION_MOVE : mHotspotDrawable . setHotspot ( x , y ) ; if ( ( mTouchSlop ) == ( - 1 ) ) { mTouchSlop = ViewConfiguration . get ( v . getContext ( ) ) . getScaledTouchSlop ( ) ; } if ( ! ( pointInView ( v , x , y , mTouchSlop ) ) ) { removeTapCallback ( v ) ; if ( v . isPressed ( ) ) { removeLongPressCallback ( v ) ; v . setPressed ( false ) ; } } break ; case MotionEvent . ACTION_CANCEL : v . setPressed ( false ) ; removeTapCallback ( v ) ; removeLongPressCallback ( v ) ; break ; } return true ; } return false ; } private void checkForLongClick ( View target , int delayOffset ) { } void setPressed ( View target , boolean pressed , float x , float y ) { } public boolean pointInView ( View target , float localX , float localY , float slop ) { } void removeTapCallback ( View target ) { } void removeLongPressCallback ( View target ) { } private static final class PerformClick implements Runnable { WeakReference < View > target ; private PerformClick ( View target ) { } @ Override public void run ( ) { } } final class CheckForTap implements Runnable { View target ; float x ; float y ; CheckForTap ( View target ) { } @ Override public void run ( ) { } } private final class CheckForLongPress implements Runnable { View target ; private CheckForLongPress ( View target ) { } @ Override public void run ( ) { } } private final class UnsetPressedState implements Runnable { View target ; private UnsetPressedState ( View target ) { } @ Override public void run ( ) { } } }

Fix:
if ( ( ( mPrePressed ) && ( pointInView ( v , x , y , mTouchSlop ) ) ) || ( v . isPressed ( ) ) ) {