diff options
author | Patrick Scott <phanna@android.com> | 2009-07-02 11:31:12 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2009-07-06 08:31:33 -0400 |
commit | 18dd5f0d25f1004e123dc265dc498a8bf8897af9 (patch) | |
tree | 89e57901a4e7e67871d529fdb9b2febef201c456 /tests/permission | |
parent | f8e3ba5bfad14f3037d72eb6243258c13169cbd8 (diff) | |
download | frameworks_base-18dd5f0d25f1004e123dc265dc498a8bf8897af9.zip frameworks_base-18dd5f0d25f1004e123dc265dc498a8bf8897af9.tar.gz frameworks_base-18dd5f0d25f1004e123dc265dc498a8bf8897af9.tar.bz2 |
Improve the Vibrator service by keeping track of multiple vibration requests.
There are 2 types of vibrations: simple and repeated. Simple vibrations run for
a given length of time while repeated patterns run until canceled or the calling
process dies.
If a vibration is currently running and another request is issued, the newer
request always takes precedence unless the current vibration is a simple one and
the time left is longer than the new request.
If a repeating vibration is running and a new request overrides that vibration,
the current vibration is pushed onto a stack. Once the new vibration completes,
the previous vibration resumes. IBinder tokens are used to identify Vibration
requests which means that multiple calls to Vibrator.vibrate with the same
Vibrator object will override previous vibrations on that object.
Diffstat (limited to 'tests/permission')
-rw-r--r-- | tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java b/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java index 719e758..aebd68c 100644 --- a/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java +++ b/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java @@ -46,7 +46,7 @@ public class HardwareServicePermissionTest extends TestCase { */ public void testVibrate() throws RemoteException { try { - mHardwareService.vibrate(2000); + mHardwareService.vibrate(2000, new Binder()); fail("vibrate did not throw SecurityException as expected"); } catch (SecurityException e) { // expected @@ -77,7 +77,7 @@ public class HardwareServicePermissionTest extends TestCase { */ public void testCancelVibrate() throws RemoteException { try { - mHardwareService.cancelVibrate(); + mHardwareService.cancelVibrate(new Binder()); fail("cancelVibrate did not throw SecurityException as expected"); } catch (SecurityException e) { // expected |