libcamera_client: Add utils function isCameraServiceDisabled.
Note: ndk_vendor/ACameraManager.cpp is vendor code whcih can't depend on
a framework library without it being vndk, which libcamera_client isn't.
Bug: 168061412
Test: builds
Test: Camera app, native cts imagereader test(validity)
Change-Id: I87d8e056d0e8ef938d5c8f976417ca707d6471d9
Merged-In: I87d8e056d0e8ef938d5c8f976417ca707d6471d9
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit f5b9cc68a46184bd18ecf7c4d9d150460acd19e1)
diff --git a/camera/CameraUtils.cpp b/camera/CameraUtils.cpp
index 67fc116..f9b1b37 100644
--- a/camera/CameraUtils.cpp
+++ b/camera/CameraUtils.cpp
@@ -23,6 +23,7 @@
#include <system/window.h>
#include <system/graphics.h>
+#include <cutils/properties.h>
#include <utils/Log.h>
namespace android {
@@ -122,4 +123,10 @@
return OK;
}
+bool CameraUtils::isCameraServiceDisabled() {
+ char value[PROPERTY_VALUE_MAX];
+ property_get("config.disable_cameraservice", value, "0");
+ return (strncmp(value, "0", 2) != 0 && strncasecmp(value, "false", 6) != 0);
+}
+
} /* namespace android */