auto import from //branches/cupcake/...@130745
diff --git a/test-runner/android/test/TouchUtils.java b/test-runner/android/test/TouchUtils.java
index c4bca41..52d2ee8 100644
--- a/test-runner/android/test/TouchUtils.java
+++ b/test-runner/android/test/TouchUtils.java
@@ -73,7 +73,7 @@
*/
@Deprecated
public static void dragQuarterScreenUp(ActivityInstrumentationTestCase test) {
- dragQuarterScreenDown(test, test.getActivity());
+ dragQuarterScreenUp(test, test.getActivity());
}
/**
@@ -269,9 +269,9 @@
inst.waitForIdleSync();
eventTime = SystemClock.uptimeMillis();
- event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
- x + (ViewConfiguration.getTouchSlop() / 2.0f),
- y + (ViewConfiguration.getTouchSlop() / 2.0f), 0);
+ final int touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop();
+ event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
+ x + (touchSlop / 2.0f), y + (touchSlop / 2.0f), 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();
@@ -309,9 +309,9 @@
inst.waitForIdleSync();
eventTime = SystemClock.uptimeMillis();
+ final int touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop();
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_CANCEL,
- x + (ViewConfiguration.getTouchSlop() / 2.0f),
- y + (ViewConfiguration.getTouchSlop() / 2.0f), 0);
+ x + (touchSlop / 2.0f), y + (touchSlop / 2.0f), 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();
@@ -345,9 +345,9 @@
eventTime = SystemClock.uptimeMillis();
- event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
- x + (ViewConfiguration.getTouchSlop() / 2.0f),
- y + (ViewConfiguration.getTouchSlop() / 2.0f), 0);
+ final int touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop();
+ event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
+ x + (touchSlop / 2.0f), y + (touchSlop / 2.0f), 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();
@@ -405,9 +405,9 @@
inst.waitForIdleSync();
eventTime = SystemClock.uptimeMillis();
- event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
- x + ViewConfiguration.getTouchSlop() / 2,
- y + ViewConfiguration.getTouchSlop() / 2, 0);
+ final int touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop();
+ event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
+ x + touchSlop / 2, y + touchSlop / 2, 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();