summaryrefslogtreecommitdiffstats
path: root/camera/libcameraservice
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2009-08-13 09:24:47 -0700
committerMarco Nelissen <marcone@google.com>2009-08-13 09:24:47 -0700
commitae7f3c5dcb4e7bfd56afcd1f86a8f37888afb358 (patch)
tree162070857403450fd4ce24051e2bed8906a55ed5 /camera/libcameraservice
parent3f8f9da85f4189bfef68cf13a1b643674b5e0726 (diff)
downloadframeworks_base-ae7f3c5dcb4e7bfd56afcd1f86a8f37888afb358.zip
frameworks_base-ae7f3c5dcb4e7bfd56afcd1f86a8f37888afb358.tar.gz
frameworks_base-ae7f3c5dcb4e7bfd56afcd1f86a8f37888afb358.tar.bz2
In the simulator, make sure that the preview thread is a Java thread,
since we won't be going through the binder in single process mode.
Diffstat (limited to 'camera/libcameraservice')
-rw-r--r--camera/libcameraservice/Android.mk10
-rw-r--r--camera/libcameraservice/CameraHardwareStub.h11
2 files changed, 18 insertions, 3 deletions
diff --git a/camera/libcameraservice/Android.mk b/camera/libcameraservice/Android.mk
index be78a62..ecaebff 100644
--- a/camera/libcameraservice/Android.mk
+++ b/camera/libcameraservice/Android.mk
@@ -25,6 +25,10 @@ LOCAL_SRC_FILES:= \
LOCAL_MODULE:= libcamerastub
+ifeq ($(TARGET_SIMULATOR),true)
+LOCAL_CFLAGS += -DSINGLE_PROCESS
+endif
+
LOCAL_SHARED_LIBRARIES:= libui
include $(BUILD_STATIC_LIBRARY)
@@ -48,7 +52,11 @@ LOCAL_SHARED_LIBRARIES:= \
LOCAL_MODULE:= libcameraservice
-LOCAL_CFLAGS+=-DLOG_TAG=\"CameraService\"
+LOCAL_CFLAGS += -DLOG_TAG=\"CameraService\"
+
+ifeq ($(TARGET_SIMULATOR),true)
+LOCAL_CFLAGS += -DSINGLE_PROCESS
+endif
ifeq ($(USE_CAMERA_STUB), true)
LOCAL_STATIC_LIBRARIES += libcamerastub
diff --git a/camera/libcameraservice/CameraHardwareStub.h b/camera/libcameraservice/CameraHardwareStub.h
index efae935..dd3c706 100644
--- a/camera/libcameraservice/CameraHardwareStub.h
+++ b/camera/libcameraservice/CameraHardwareStub.h
@@ -67,8 +67,15 @@ private:
class PreviewThread : public Thread {
CameraHardwareStub* mHardware;
public:
- PreviewThread(CameraHardwareStub* hw)
- : Thread(false), mHardware(hw) { }
+ PreviewThread(CameraHardwareStub* hw) :
+#ifdef SINGLE_PROCESS
+ // In single process mode this thread needs to be a java thread,
+ // since we won't be calling through the binder.
+ Thread(true),
+#else
+ Thread(false),
+#endif
+ mHardware(hw) { }
virtual void onFirstRef() {
run("CameraPreviewThread", PRIORITY_URGENT_DISPLAY);
}