diff options
author | Mike Lockwood <lockwood@android.com> | 2009-11-25 11:54:18 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-25 11:54:18 -0800 |
commit | dfaf2e03ad7c4d55ede1d2ef100ff4e21c04cd5c (patch) | |
tree | 49ce089d9bb8560f05b6b08419e87bb229b426a2 /tests | |
parent | 3f6ee1a180268ca2e30723ce2c45b81c2e671abb (diff) | |
parent | 30348b0de11b6c6cba43dfc7960e4d2084af6d8b (diff) | |
download | frameworks_base-dfaf2e03ad7c4d55ede1d2ef100ff4e21c04cd5c.zip frameworks_base-dfaf2e03ad7c4d55ede1d2ef100ff4e21c04cd5c.tar.gz frameworks_base-dfaf2e03ad7c4d55ede1d2ef100ff4e21c04cd5c.tar.bz2 |
am 30348b0d: Merge change I086d681f into eclair-mr2
Merge commit '30348b0de11b6c6cba43dfc7960e4d2084af6d8b' into eclair-mr2-plus-aosp
* commit '30348b0de11b6c6cba43dfc7960e4d2084af6d8b':
Remove HardwareService and move vibrator support to VibratorService.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/permission/src/com/android/framework/permission/tests/VibratorServicePermissionTest.java (renamed from tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java) | 56 |
1 files changed, 11 insertions, 45 deletions
diff --git a/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java b/tests/permission/src/com/android/framework/permission/tests/VibratorServicePermissionTest.java index 2290c1d..274ac00 100644 --- a/tests/permission/src/com/android/framework/permission/tests/HardwareServicePermissionTest.java +++ b/tests/permission/src/com/android/framework/permission/tests/VibratorServicePermissionTest.java @@ -19,7 +19,7 @@ package com.android.framework.permission.tests; import junit.framework.TestCase; import android.os.Binder; -import android.os.IHardwareService; +import android.os.IVibratorService; import android.os.RemoteException; import android.os.ServiceManager; import android.test.suitebuilder.annotation.SmallTest; @@ -28,25 +28,25 @@ import android.test.suitebuilder.annotation.SmallTest; * Verify that Hardware apis cannot be called without required permissions. */ @SmallTest -public class HardwareServicePermissionTest extends TestCase { +public class VibratorServicePermissionTest extends TestCase { - private IHardwareService mHardwareService; + private IVibratorService mVibratorService; @Override protected void setUp() throws Exception { - mHardwareService = IHardwareService.Stub.asInterface( - ServiceManager.getService("hardware")); + mVibratorService = IVibratorService.Stub.asInterface( + ServiceManager.getService("vibrator")); } /** - * Test that calling {@link android.os.IHardwareService#vibrate(long)} requires permissions. + * Test that calling {@link android.os.IVibratorService#vibrate(long)} requires permissions. * <p>Tests permission: * {@link android.Manifest.permission#VIBRATE} * @throws RemoteException */ public void testVibrate() throws RemoteException { try { - mHardwareService.vibrate(2000, new Binder()); + mVibratorService.vibrate(2000, new Binder()); fail("vibrate did not throw SecurityException as expected"); } catch (SecurityException e) { // expected @@ -54,7 +54,7 @@ public class HardwareServicePermissionTest extends TestCase { } /** - * Test that calling {@link android.os.IHardwareService#vibratePattern(long[], + * Test that calling {@link android.os.IVibratorService#vibratePattern(long[], * int, android.os.IBinder)} requires permissions. * <p>Tests permission: * {@link android.Manifest.permission#VIBRATE} @@ -62,7 +62,7 @@ public class HardwareServicePermissionTest extends TestCase { */ public void testVibratePattern() throws RemoteException { try { - mHardwareService.vibratePattern(new long[] {0}, 0, new Binder()); + mVibratorService.vibratePattern(new long[] {0}, 0, new Binder()); fail("vibratePattern did not throw SecurityException as expected"); } catch (SecurityException e) { // expected @@ -70,51 +70,17 @@ public class HardwareServicePermissionTest extends TestCase { } /** - * Test that calling {@link android.os.IHardwareService#cancelVibrate()} requires permissions. + * Test that calling {@link android.os.IVibratorService#cancelVibrate()} requires permissions. * <p>Tests permission: * {@link android.Manifest.permission#VIBRATE} * @throws RemoteException */ public void testCancelVibrate() throws RemoteException { try { - mHardwareService.cancelVibrate(new Binder()); + mVibratorService.cancelVibrate(new Binder()); fail("cancelVibrate did not throw SecurityException as expected"); } catch (SecurityException e) { // expected } } - - /** - * Test that calling {@link android.os.IHardwareService#setFlashlightEnabled(boolean)} - * requires permissions. - * <p>Tests permissions: - * {@link android.Manifest.permission#HARDWARE_TEST} - * {@link android.Manifest.permission#FLASHLIGHT} - * @throws RemoteException - */ - public void testSetFlashlightEnabled() throws RemoteException { - try { - mHardwareService.setFlashlightEnabled(true); - fail("setFlashlightEnabled did not throw SecurityException as expected"); - } catch (SecurityException e) { - // expected - } - } - - /** - * Test that calling {@link android.os.IHardwareService#enableCameraFlash(int)} requires - * permissions. - * <p>Tests permission: - * {@link android.Manifest.permission#HARDWARE_TEST} - * {@link android.Manifest.permission#CAMERA} - * @throws RemoteException - */ - public void testEnableCameraFlash() throws RemoteException { - try { - mHardwareService.enableCameraFlash(100); - fail("enableCameraFlash did not throw SecurityException as expected"); - } catch (SecurityException e) { - // expected - } - } } |