summaryrefslogtreecommitdiff
path: root/camera/provider/2.4/default/service.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'camera/provider/2.4/default/service.cpp')
-rw-r--r--camera/provider/2.4/default/service.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/camera/provider/2.4/default/service.cpp b/camera/provider/2.4/default/service.cpp
index 7eeb6379c9..4475f7d981 100644
--- a/camera/provider/2.4/default/service.cpp
+++ b/camera/provider/2.4/default/service.cpp
@@ -14,21 +14,40 @@
* limitations under the License.
*/
+#ifdef LAZY_SERVICE
+#define LOG_TAG "android.hardware.camera.provider@2.4-service-lazy"
+#else
#define LOG_TAG "android.hardware.camera.provider@2.4-service"
+#endif
#include <android/hardware/camera/provider/2.4/ICameraProvider.h>
-#include <hidl/LegacySupport.h>
-
#include <binder/ProcessState.h>
+#include <hidl/LegacySupport.h>
-using android::hardware::camera::provider::V2_4::ICameraProvider;
+using android::status_t;
+using android::hardware::defaultLazyPassthroughServiceImplementation;
using android::hardware::defaultPassthroughServiceImplementation;
+using android::hardware::camera::provider::V2_4::ICameraProvider;
+
+#ifdef LAZY_SERVICE
+const bool kLazyService = true;
+#else
+const bool kLazyService = false;
+#endif
int main()
{
- ALOGI("Camera provider Service is starting.");
+ ALOGI("CameraProvider@2.4 legacy service is starting.");
// The camera HAL may communicate to other vendor components via
// /dev/vndbinder
android::ProcessState::initWithDriver("/dev/vndbinder");
- return defaultPassthroughServiceImplementation<ICameraProvider>("legacy/0", /*maxThreads*/ 6);
+ status_t status;
+ if (kLazyService) {
+ status = defaultLazyPassthroughServiceImplementation<ICameraProvider>("legacy/0",
+ /*maxThreads*/ 6);
+ } else {
+ status = defaultPassthroughServiceImplementation<ICameraProvider>("legacy/0",
+ /*maxThreads*/ 6);
+ }
+ return status;
}