diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2014-08-06 14:31:08 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2014-08-27 11:08:18 -0700 |
commit | acc0095bc84914d3ce41ad8298f698c37935b8a8 (patch) | |
tree | 35fef13c48d2c2e28ca2ac94964325226c220c4d /media/tests/MediaFrameworkTest | |
parent | a9bdc43ec2b8862db579aaced357184b7496468f (diff) | |
download | frameworks_base-acc0095bc84914d3ce41ad8298f698c37935b8a8.zip frameworks_base-acc0095bc84914d3ce41ad8298f698c37935b8a8.tar.gz frameworks_base-acc0095bc84914d3ce41ad8298f698c37935b8a8.tar.bz2 |
Camera2: Correct error handling
- Report capture failures from service to application
- Only go to error state for device-level errors
- Adjust binder interface method names to match the service side names
- Reduce failed session creation logging
- Don't fire CaptureSession.onActive for CameraDevice.onBusy
- Check with session to determine capture failure reason
Bug: 17160301
Bug: 15524101
Bug: 14448494
Bug: 11272459
Change-Id: I9dd606004fd7845910dc865738fbe17f1640f07d
Diffstat (limited to 'media/tests/MediaFrameworkTest')
2 files changed, 10 insertions, 10 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java index b6bb578..cc50c43 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java @@ -245,7 +245,7 @@ public class CameraBinderTest extends AndroidTestCase { * android.hardware.camera2.CaptureResultExtras) */ @Override - public void onCameraError(int errorCode, CaptureResultExtras resultExtras) + public void onDeviceError(int errorCode, CaptureResultExtras resultExtras) throws RemoteException { // TODO Auto-generated method stub @@ -283,7 +283,7 @@ public class CameraBinderTest extends AndroidTestCase { * @see android.hardware.camera2.ICameraDeviceCallbacks#onCameraIdle() */ @Override - public void onCameraIdle() throws RemoteException { + public void onDeviceIdle() throws RemoteException { // TODO Auto-generated method stub } diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java index 7b2e7dd..3cae19d 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java @@ -88,10 +88,10 @@ public class CameraDeviceBinderTest extends AndroidTestCase { /* * (non-Javadoc) * @see - * android.hardware.camera2.ICameraDeviceCallbacks#onCameraError(int, + * android.hardware.camera2.ICameraDeviceCallbacks#onDeviceError(int, * android.hardware.camera2.CaptureResultExtras) */ - public void onCameraError(int errorCode, CaptureResultExtras resultExtras) + public void onDeviceError(int errorCode, CaptureResultExtras resultExtras) throws RemoteException { // TODO Auto-generated method stub @@ -99,9 +99,9 @@ public class CameraDeviceBinderTest extends AndroidTestCase { /* * (non-Javadoc) - * @see android.hardware.camera2.ICameraDeviceCallbacks#onCameraIdle() + * @see android.hardware.camera2.ICameraDeviceCallbacks#onDeviceIdle() */ - public void onCameraIdle() throws RemoteException { + public void onDeviceIdle() throws RemoteException { // TODO Auto-generated method stub } @@ -432,7 +432,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { // Cancel and make sure we eventually quiesce status = mCameraUser.cancelRequest(streamingId, null); - verify(mMockCb, timeout(WAIT_FOR_IDLE_TIMEOUT_MS).times(1)).onCameraIdle(); + verify(mMockCb, timeout(WAIT_FOR_IDLE_TIMEOUT_MS).times(1)).onDeviceIdle(); // Submit a few capture requests int requestId1 = submitCameraRequest(request, /* streaming */false); @@ -442,7 +442,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { int requestId5 = submitCameraRequest(request, /* streaming */false); // And wait for more idle - verify(mMockCb, timeout(WAIT_FOR_IDLE_TIMEOUT_MS).times(2)).onCameraIdle(); + verify(mMockCb, timeout(WAIT_FOR_IDLE_TIMEOUT_MS).times(2)).onDeviceIdle(); } @@ -472,7 +472,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { status = mCameraUser.flush(null); assertEquals(CameraBinderTestUtils.NO_ERROR, status); - verify(mMockCb, timeout(WAIT_FOR_FLUSH_TIMEOUT_MS).times(1)).onCameraIdle(); + verify(mMockCb, timeout(WAIT_FOR_FLUSH_TIMEOUT_MS).times(1)).onDeviceIdle(); // Now a streaming request int streamingId = submitCameraRequest(request, /* streaming */true); @@ -484,7 +484,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { status = mCameraUser.flush(null); assertEquals(CameraBinderTestUtils.NO_ERROR, status); - verify(mMockCb, timeout(WAIT_FOR_FLUSH_TIMEOUT_MS).times(2)).onCameraIdle(); + verify(mMockCb, timeout(WAIT_FOR_FLUSH_TIMEOUT_MS).times(2)).onDeviceIdle(); // TODO: When errors are hooked up, count that errors + successful // requests equal to 5. |