summaryrefslogtreecommitdiffstats
path: root/tests/permission
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-11-24 00:30:52 -0500
committerMike Lockwood <lockwood@android.com>2009-11-25 12:54:58 -0500
commit3a32213c4029a03fe39486f3d6ebd0ea18928ee1 (patch)
tree261ab976911438a818b190771e49cd649d72de2f /tests/permission
parentf90b1261a53bc0bfc772337551eb4c540022cd22 (diff)
downloadframeworks_base-3a32213c4029a03fe39486f3d6ebd0ea18928ee1.zip
frameworks_base-3a32213c4029a03fe39486f3d6ebd0ea18928ee1.tar.gz
frameworks_base-3a32213c4029a03fe39486f3d6ebd0ea18928ee1.tar.bz2
Remove HardwareService and move vibrator support to VibratorService.
The lights support is only needed by PowerManagerService and NotificationManagerService, so we do not need a Binder API for it. Move backlight and notification light support to new LightsService class. The camera flash is now handled directly by the camera HAL, so the flash Hardware service flash support is obsolete. Change-Id: I086d681f54668e7f7de3e8b90df3de19d59833c5 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'tests/permission')
-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
- }
- }
}