summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-07-02 10:04:20 -0700
committerJames Dong <jdong@google.com>2009-07-02 10:04:20 -0700
commita1b653d41df9a7999e1dba2a508295671ff6771d (patch)
tree74c7c4639f56b4aab2e076eaadb7d436cab68113
parenta54755962ca7725d1e2b6cacbbaece6f1cbf5af4 (diff)
downloadframeworks_base-a1b653d41df9a7999e1dba2a508295671ff6771d.zip
frameworks_base-a1b653d41df9a7999e1dba2a508295671ff6771d.tar.gz
frameworks_base-a1b653d41df9a7999e1dba2a508295671ff6771d.tar.bz2
Return CAMERA_ERROR_SERVER_DIED to camera app when camera service dies (bug 1956726)
-rw-r--r--core/java/android/hardware/Camera.java2
-rw-r--r--core/jni/android_hardware_Camera.cpp6
-rw-r--r--include/ui/Camera.h6
-rw-r--r--libs/ui/Camera.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 3ce951f..091bc17 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -371,7 +371,7 @@ public class Camera {
}
private native final void native_takePicture();
- // These match the enum in libs/android_runtime/android_hardware_Camera.cpp
+ // These match the enum in include/ui/Camera.h
/** Unspecified camerar error. @see #ErrorCallback */
public static final int CAMERA_ERROR_UNKNOWN = 1;
/** Media server died. In this case, the application must release the
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 3dcc09f..77a8a72 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -38,12 +38,6 @@ enum CallbackMessageID {
kErrorCallback = 5
};
-enum CameraError {
- kCameraErrorUnknown = 1,
- kCameraErrorMediaServer = 100
-};
-
-
struct fields_t {
jfieldID context;
jfieldID surface;
diff --git a/include/ui/Camera.h b/include/ui/Camera.h
index 97e0e90..e3544ab 100644
--- a/include/ui/Camera.h
+++ b/include/ui/Camera.h
@@ -76,6 +76,12 @@ enum {
CAMERA_MSG_COMPRESSED_IMAGE
};
+// camera fatal errors
+enum {
+ CAMERA_ERROR_UKNOWN = 1,
+ CAMERA_ERROR_SERVER_DIED = 100
+};
+
class ICameraService;
class ICamera;
class Surface;
diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp
index a481ce7..975594f 100644
--- a/libs/ui/Camera.cpp
+++ b/libs/ui/Camera.cpp
@@ -312,7 +312,7 @@ void Camera::dataCallback(int32_t msgType, const sp<IMemory>& dataPtr)
void Camera::binderDied(const wp<IBinder>& who) {
LOGW("ICamera died");
- notifyCallback(CAMERA_MSG_ERROR, DEAD_OBJECT, 0);
+ notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, 0);
}
void Camera::DeathNotifier::binderDied(const wp<IBinder>& who) {