diff options
author | Alok Kediya <kediya@codeaurora.org> | 2013-09-28 17:30:54 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2013-10-31 19:38:38 -0600 |
commit | 64f04883e56a35b244f67e4f3447d34b9aae86d5 (patch) | |
tree | 4d810029547eedf989c27bf67c35383d40b29e2a /src/com/android/camera | |
parent | c7c3265bdeff87a58725a86ce251ecb4d83cd4c5 (diff) | |
download | android_packages_apps_Snap-64f04883e56a35b244f67e4f3447d34b9aae86d5.tar.gz android_packages_apps_Snap-64f04883e56a35b244f67e4f3447d34b9aae86d5.tar.bz2 android_packages_apps_Snap-64f04883e56a35b244f67e4f3447d34b9aae86d5.zip |
Camera: Shutdown the camera in case of UNKNOWN_ERROR.
Currently the camera application shuts down the camera
only in case of SERVER_DIED error. But if the camera driver
goes into a bad state, it just sends a UNKNOWN_ERROR. So
shutdown the camera even in UNKNOWN_ERROR case.
(cherrypicked from commit 432da3d40184abbffc0ca75fa10cb20e76520bdb )
Change-Id: I5d9329538646dad30eacd30b3cfa3bfd6769b600
(cherry picked from commit 14b02e245490c780fca5952a4d5b84f99225c0e6)
(cherry picked from commit a1f653ce704efc7110b00e8ee7d56a954be6eb23)
(cherry picked from commit 7b6c06353bf26a0a7b3c50ebeb8337d05e471a11)
Diffstat (limited to 'src/com/android/camera')
-rw-r--r-- | src/com/android/camera/CameraErrorCallback.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/camera/CameraErrorCallback.java b/src/com/android/camera/CameraErrorCallback.java index 22f800ef9..7029ac427 100644 --- a/src/com/android/camera/CameraErrorCallback.java +++ b/src/com/android/camera/CameraErrorCallback.java @@ -25,7 +25,8 @@ public class CameraErrorCallback @Override public void onError(int error, android.hardware.Camera camera) { Log.e(TAG, "Got camera error callback. error=" + error); - if (error == android.hardware.Camera.CAMERA_ERROR_SERVER_DIED) { + if (error == android.hardware.Camera.CAMERA_ERROR_SERVER_DIED + || error == android.hardware.Camera.CAMERA_ERROR_UNKNOWN) { // We are not sure about the current state of the app (in preview or // snapshot or recording). Closing the app is better than creating a // new Camera object. |