diff options
author | Alan Newberger <alann@google.com> | 2014-08-20 11:21:19 -0700 |
---|---|---|
committer | Alan Newberger <alann@google.com> | 2014-08-20 11:21:19 -0700 |
commit | e4094bd3b85ce20e81a1677319192ed2274d0525 (patch) | |
tree | 818e579a7d7017f08f53b1eab6c646e23f6f1fb0 /camera2/portability/src/com/android/ex | |
parent | 489e29ecbfd2ffe10ebd199204f3ee242b1bd1f8 (diff) | |
download | android_frameworks_ex-e4094bd3b85ce20e81a1677319192ed2274d0525.tar.gz android_frameworks_ex-e4094bd3b85ce20e81a1677319192ed2274d0525.tar.bz2 android_frameworks_ex-e4094bd3b85ce20e81a1677319192ed2274d0525.zip |
Log null returns from Camera.getParameters
There is some evidence that we may be getting null parameters on N10.
Specfically, AndroidCameraProxyImpl.getParameters is returning null,
and from analysis the only two options are that the API1 returns null,
or our synchronous waiting for threads is compromised and we are returning
without error too fast. The latter would presumably show up on many
devices, but we are only seeing an issue on N10, so I suspect an API/HAL
issue. Adding logging and a thrown exception, and cleaning up
GET_PARAMETERS message creation slightly to make more consistent with
other invocations.
Bug: 17109801
Change-Id: I1705345d03ed16ef22b170a11fcaf0c6fb2a2c4d
Diffstat (limited to 'camera2/portability/src/com/android/ex')
-rw-r--r-- | camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java index c26a1a3..a9aba37 100644 --- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java +++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java @@ -223,6 +223,10 @@ class AndroidCameraAgentImpl extends CameraAgent { public synchronized Parameters getBlocking() { if (mParameters == null) { mParameters = mCamera.getParameters(); + if (mParameters == null) { + Log.e(TAG, "Camera object returned null parameters!"); + throw new IllegalStateException("camera.getParameters returned null"); + } } return mParameters; } @@ -880,9 +884,8 @@ class AndroidCameraAgentImpl extends CameraAgent { mDispatchThread.runJobSync(new Runnable() { @Override public void run() { - Message getParametersMessage = mCameraHandler.obtainMessage( - CameraActions.GET_PARAMETERS, parametersHolder); - mCameraHandler.sendMessage(getParametersMessage); + mCameraHandler.obtainMessage( + CameraActions.GET_PARAMETERS, parametersHolder).sendToTarget(); mCameraHandler.post(bundle.mUnlockRunnable); } }, bundle.mWaitLock, CAMERA_OPERATION_TIMEOUT_MS, "get parameters"); |