diff options
author | Mike Lockwood <lockwood@android.com> | 2009-11-25 15:05:51 -0500 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-11-25 15:05:51 -0500 |
commit | 726a570258828d85e401ab62fd4220812fe9344f (patch) | |
tree | 11af59ce57ec093c026aac8516bddc31cb031a5a /tests | |
parent | 3fdee335fe95ab94ef1ee619ad37f9369447fde5 (diff) | |
parent | dfaf2e03ad7c4d55ede1d2ef100ff4e21c04cd5c (diff) | |
download | frameworks_base-726a570258828d85e401ab62fd4220812fe9344f.zip frameworks_base-726a570258828d85e401ab62fd4220812fe9344f.tar.gz frameworks_base-726a570258828d85e401ab62fd4220812fe9344f.tar.bz2 |
resolved conflicts for merge of dfaf2e03 to master
Change-Id: I440d2042dd404a421789063e42102699fa33b7c0
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 - } - } } |