diff options
author | Jayant Chowdhary <jchowdhary@google.com> | 2020-09-08 16:25:17 -0700 |
---|---|---|
committer | Fei Wang <wangzfei@google.com> | 2020-10-13 19:04:12 +0000 |
commit | ab0d91f104852e80ae582d172acd86d5a486de7f (patch) | |
tree | 365b8a31857959ee52822e642cdde5a1f2086754 /camera/CameraUtils.cpp | |
parent | 5e710feacb9b8d8f7db1f4e15d2e9d2aac83da0e (diff) |
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)
Diffstat (limited to 'camera/CameraUtils.cpp')
-rw-r--r-- | camera/CameraUtils.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/camera/CameraUtils.cpp b/camera/CameraUtils.cpp index 67fc116558..f9b1b37dc9 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 @@ status_t CameraUtils::getRotationTransform(const CameraMetadata& staticInfo, 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 */ |