Loading tests/permission/src/com/android/framework/permission/tests/VibratorServicePermissionTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.framework.permission.tests; import junit.framework.TestCase; import android.media.AudioManager; import android.os.Binder; import android.os.IVibratorService; import android.os.Process; Loading Loading @@ -47,7 +48,8 @@ public class VibratorServicePermissionTest extends TestCase { */ public void testVibrate() throws RemoteException { try { mVibratorService.vibrate(Process.myUid(), null, 2000, new Binder()); mVibratorService.vibrate(Process.myUid(), null, 2000, AudioManager.STREAM_ALARM, new Binder()); fail("vibrate did not throw SecurityException as expected"); } catch (SecurityException e) { // expected Loading @@ -63,7 +65,8 @@ public class VibratorServicePermissionTest extends TestCase { */ public void testVibratePattern() throws RemoteException { try { mVibratorService.vibratePattern(Process.myUid(), null, new long[] {0}, 0, new Binder()); mVibratorService.vibratePattern(Process.myUid(), null, new long[] {0}, 0, AudioManager.STREAM_ALARM, new Binder()); fail("vibratePattern did not throw SecurityException as expected"); } catch (SecurityException e) { // expected Loading Loading
tests/permission/src/com/android/framework/permission/tests/VibratorServicePermissionTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.framework.permission.tests; import junit.framework.TestCase; import android.media.AudioManager; import android.os.Binder; import android.os.IVibratorService; import android.os.Process; Loading Loading @@ -47,7 +48,8 @@ public class VibratorServicePermissionTest extends TestCase { */ public void testVibrate() throws RemoteException { try { mVibratorService.vibrate(Process.myUid(), null, 2000, new Binder()); mVibratorService.vibrate(Process.myUid(), null, 2000, AudioManager.STREAM_ALARM, new Binder()); fail("vibrate did not throw SecurityException as expected"); } catch (SecurityException e) { // expected Loading @@ -63,7 +65,8 @@ public class VibratorServicePermissionTest extends TestCase { */ public void testVibratePattern() throws RemoteException { try { mVibratorService.vibratePattern(Process.myUid(), null, new long[] {0}, 0, new Binder()); mVibratorService.vibratePattern(Process.myUid(), null, new long[] {0}, 0, AudioManager.STREAM_ALARM, new Binder()); fail("vibratePattern did not throw SecurityException as expected"); } catch (SecurityException e) { // expected Loading