Moving touch event into dialog bounds.
bug: 10665940
Change-Id: Ia0556938e267509bafbb434502dcdf01af9d8bb3
diff --git a/tests/tests/app/AndroidManifest.xml b/tests/tests/app/AndroidManifest.xml
index af7d997..d92cfbe 100644
--- a/tests/tests/app/AndroidManifest.xml
+++ b/tests/tests/app/AndroidManifest.xml
@@ -19,6 +19,7 @@
package="com.android.cts.app">
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
+ <uses-permission android:name="android.permission.INJECT_EVENTS" />
<application>
<uses-library android:name="android.test.runner" />
</application>
diff --git a/tests/tests/app/src/android/app/cts/DialogTest.java b/tests/tests/app/src/android/app/cts/DialogTest.java
index 1f6e2ab..68b01ee 100644
--- a/tests/tests/app/src/android/app/cts/DialogTest.java
+++ b/tests/tests/app/src/android/app/cts/DialogTest.java
@@ -371,7 +371,7 @@
long now = SystemClock.uptimeMillis();
MotionEvent touchMotionEvent = MotionEvent.obtain(now, now, MotionEvent.ACTION_DOWN,
- -20.0f, -20.0f, 0);
+ 0.0f, 0.0f, 0);
mInstrumentation.sendPointerSync(touchMotionEvent);
assertFalse(d.dispatchTouchEventResult);
@@ -387,7 +387,7 @@
d.setCanceledOnTouchOutside(true);
touchMotionEvent = MotionEvent.obtain(now + 1, now, MotionEvent.ACTION_DOWN,
- -20.0f, -20.0f, 0);
+ 0.0f, 0.0f, 0);
mInstrumentation.sendPointerSync(touchMotionEvent);
assertTrue(d.dispatchTouchEventResult);
@@ -403,7 +403,7 @@
final TestDialog d = (TestDialog) mActivity.getDialog();
long eventTime = SystemClock.uptimeMillis();
final MotionEvent trackBallEvent = MotionEvent.obtain(eventTime, eventTime,
- MotionEvent.ACTION_DOWN, -20.0f, -20.0f, 0);
+ MotionEvent.ACTION_DOWN, 0.0f, 0.0f, 0);
assertNull(d.trackballEvent);
assertNull(d.onTrackballEvent);