use of android.hardware.ICameraServiceListener in project android_frameworks_base by ResurrectionRemix.
the class CameraBinderTest method testAddRemoveListeners.
/**
* <pre>
* adb shell am instrument \
* -e class 'com.android.mediaframeworktest.integration.CameraBinderTest#testAddRemoveListeners' \
* -w com.android.mediaframeworktest/.MediaFrameworkIntegrationTestRunner
* </pre>
*/
@SmallTest
public void testAddRemoveListeners() throws Exception {
for (int cameraId = 0; cameraId < mUtils.getGuessedNumCameras(); ++cameraId) {
ICameraServiceListener listener = new DummyCameraServiceListener();
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was removed before added");
} catch (ServiceSpecificException e) {
assertEquals("Listener was removed before added", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
mUtils.getCameraService().addListener(listener);
try {
mUtils.getCameraService().addListener(listener);
fail("Listener was wrongly added again");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly added again", e.errorCode, ICameraService.ERROR_ALREADY_EXISTS);
}
mUtils.getCameraService().removeListener(listener);
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was wrongly removed twice");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly removed twice", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
}
}
use of android.hardware.ICameraServiceListener in project android_frameworks_base by AOSPA.
the class CameraBinderTest method testAddRemoveListeners.
/**
* <pre>
* adb shell am instrument \
* -e class 'com.android.mediaframeworktest.integration.CameraBinderTest#testAddRemoveListeners' \
* -w com.android.mediaframeworktest/.MediaFrameworkIntegrationTestRunner
* </pre>
*/
@SmallTest
public void testAddRemoveListeners() throws Exception {
for (int cameraId = 0; cameraId < mUtils.getGuessedNumCameras(); ++cameraId) {
ICameraServiceListener listener = new DummyCameraServiceListener();
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was removed before added");
} catch (ServiceSpecificException e) {
assertEquals("Listener was removed before added", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
mUtils.getCameraService().addListener(listener);
try {
mUtils.getCameraService().addListener(listener);
fail("Listener was wrongly added again");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly added again", e.errorCode, ICameraService.ERROR_ALREADY_EXISTS);
}
mUtils.getCameraService().removeListener(listener);
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was wrongly removed twice");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly removed twice", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
}
}
use of android.hardware.ICameraServiceListener in project android_frameworks_base by crdroidandroid.
the class CameraBinderTest method testAddRemoveListeners.
/**
* <pre>
* adb shell am instrument \
* -e class 'com.android.mediaframeworktest.integration.CameraBinderTest#testAddRemoveListeners' \
* -w com.android.mediaframeworktest/.MediaFrameworkIntegrationTestRunner
* </pre>
*/
@SmallTest
public void testAddRemoveListeners() throws Exception {
for (int cameraId = 0; cameraId < mUtils.getGuessedNumCameras(); ++cameraId) {
ICameraServiceListener listener = new DummyCameraServiceListener();
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was removed before added");
} catch (ServiceSpecificException e) {
assertEquals("Listener was removed before added", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
mUtils.getCameraService().addListener(listener);
try {
mUtils.getCameraService().addListener(listener);
fail("Listener was wrongly added again");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly added again", e.errorCode, ICameraService.ERROR_ALREADY_EXISTS);
}
mUtils.getCameraService().removeListener(listener);
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was wrongly removed twice");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly removed twice", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
}
}
use of android.hardware.ICameraServiceListener in project platform_frameworks_base by android.
the class CameraBinderTest method testAddRemoveListeners.
/**
* <pre>
* adb shell am instrument \
* -e class 'com.android.mediaframeworktest.integration.CameraBinderTest#testAddRemoveListeners' \
* -w com.android.mediaframeworktest/.MediaFrameworkIntegrationTestRunner
* </pre>
*/
@SmallTest
public void testAddRemoveListeners() throws Exception {
for (int cameraId = 0; cameraId < mUtils.getGuessedNumCameras(); ++cameraId) {
ICameraServiceListener listener = new DummyCameraServiceListener();
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was removed before added");
} catch (ServiceSpecificException e) {
assertEquals("Listener was removed before added", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
mUtils.getCameraService().addListener(listener);
try {
mUtils.getCameraService().addListener(listener);
fail("Listener was wrongly added again");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly added again", e.errorCode, ICameraService.ERROR_ALREADY_EXISTS);
}
mUtils.getCameraService().removeListener(listener);
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was wrongly removed twice");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly removed twice", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
}
}
use of android.hardware.ICameraServiceListener in project android_frameworks_base by DirtyUnicorns.
the class CameraBinderTest method testAddRemoveListeners.
/**
* <pre>
* adb shell am instrument \
* -e class 'com.android.mediaframeworktest.integration.CameraBinderTest#testAddRemoveListeners' \
* -w com.android.mediaframeworktest/.MediaFrameworkIntegrationTestRunner
* </pre>
*/
@SmallTest
public void testAddRemoveListeners() throws Exception {
for (int cameraId = 0; cameraId < mUtils.getGuessedNumCameras(); ++cameraId) {
ICameraServiceListener listener = new DummyCameraServiceListener();
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was removed before added");
} catch (ServiceSpecificException e) {
assertEquals("Listener was removed before added", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
mUtils.getCameraService().addListener(listener);
try {
mUtils.getCameraService().addListener(listener);
fail("Listener was wrongly added again");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly added again", e.errorCode, ICameraService.ERROR_ALREADY_EXISTS);
}
mUtils.getCameraService().removeListener(listener);
try {
mUtils.getCameraService().removeListener(listener);
fail("Listener was wrongly removed twice");
} catch (ServiceSpecificException e) {
assertEquals("Listener was wrongly removed twice", e.errorCode, ICameraService.ERROR_ILLEGAL_ARGUMENT);
}
}
}
Aggregations