Exact copy of GCE Camera.
Changes in Android.mk file to update build target to camera.vsoc
Change-Id: Id2ced4bfb13717a179d20c29875fa3b3fc1dec0c
diff --git a/guest/hals/camera/GceEmulatedCameraHotplugThread.cpp b/guest/hals/camera/GceEmulatedCameraHotplugThread.cpp
new file mode 100644
index 0000000..da6bb7d
--- /dev/null
+++ b/guest/hals/camera/GceEmulatedCameraHotplugThread.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_NDEBUG 0
+#define LOG_TAG "EmulatedCamera_HotplugThread"
+#include <cutils/log.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "EmulatedCameraHotplugThread.h"
+#include "EmulatedCameraFactory.h"
+
+#define SubscriberInfo EmulatedCameraHotplugThread::SubscriberInfo
+
+namespace android {
+
+EmulatedCameraHotplugThread::EmulatedCameraHotplugThread(
+ size_t totalCameraCount) :
+ Thread(/*canCallJava*/false) {}
+
+EmulatedCameraHotplugThread::~EmulatedCameraHotplugThread() {}
+
+status_t EmulatedCameraHotplugThread::requestExitAndWait() {
+ ALOGE("%s: Not implemented. Use requestExit + join instead",
+ __FUNCTION__);
+ return INVALID_OPERATION;
+}
+
+void EmulatedCameraHotplugThread::requestExit() {
+ ALOGV("%s: Requesting thread exit", __FUNCTION__);
+ mRunning = false;
+}
+
+status_t EmulatedCameraHotplugThread::readyToRun() {
+ return OK;
+}
+
+bool EmulatedCameraHotplugThread::threadLoop() {
+ // Thread is irrelevant right now; hoplug is not supported.
+ return false;
+}
+
+String8 EmulatedCameraHotplugThread::getFilePath(int cameraId) const {
+ return String8();
+}
+
+bool EmulatedCameraHotplugThread::createFileIfNotExists(int cameraId) const
+{
+ return true;
+}
+
+int EmulatedCameraHotplugThread::getCameraId(String8 filePath) const {
+ // Not used anywhere.
+ return NAME_NOT_FOUND;
+}
+
+int EmulatedCameraHotplugThread::getCameraId(int wd) const {
+ // Not used anywhere.
+ return NAME_NOT_FOUND;
+}
+
+SubscriberInfo* EmulatedCameraHotplugThread::getSubscriberInfo(int cameraId)
+{
+ // Not used anywhere.
+ return NULL;
+}
+
+bool EmulatedCameraHotplugThread::addWatch(int cameraId) {
+ return true;
+}
+
+bool EmulatedCameraHotplugThread::removeWatch(int cameraId) {
+ return true;
+}
+
+int EmulatedCameraHotplugThread::readFile(String8 filePath) const {
+ return 1;
+}
+
+} //namespace android