Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7907df75 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

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.
parent 991ac9e1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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)
@@ -50,6 +54,10 @@ LOCAL_MODULE:= libcameraservice

LOCAL_CFLAGS += -DLOG_TAG=\"CameraService\"

ifeq ($(TARGET_SIMULATOR),true)
LOCAL_CFLAGS += -DSINGLE_PROCESS
endif

ifeq ($(USE_CAMERA_STUB), true)
LOCAL_STATIC_LIBRARIES += libcamerastub
LOCAL_CFLAGS += -include CameraHardwareStub.h
+9 −2
Original line number Diff line number Diff line
@@ -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);
        }