summaryrefslogtreecommitdiff
path: root/media
diff options
context:
space:
mode:
authorHangyu Kuang <hkuang@google.com>2019-05-30 12:08:41 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-30 12:08:41 -0700
commitff4c7413d9ef1357950daf54ca02674c98076bb6 (patch)
treec1e22695bb3aff346bb675d588709fd57609701a /media
parentc8d25de4422b2fe8131e456dcde354d8e7280d65 (diff)
parent4637dfa5cdb14f045473a6a0f98c929f849e905b (diff)
downloadav-ff4c7413d9ef1357950daf54ca02674c98076bb6.tar.gz
[ECOService]: Add a setprop to disable ECOService. am: 369f06ffbb
am: 4637dfa5cd Change-Id: Iffb33f46db9e3f9baa7ed917cad72cc26c24644e
Diffstat (limited to 'media')
-rw-r--r--media/eco/ECOService.cpp6
-rw-r--r--media/eco/include/eco/ECODebug.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/media/eco/ECOService.cpp b/media/eco/ECOService.cpp
index 6cc4be4..e95dee5 100644
--- a/media/eco/ECOService.cpp
+++ b/media/eco/ECOService.cpp
@@ -49,6 +49,12 @@ ECOService::ECOService() : BnECOService() {
ECOLOGI("ECOService::obtainSession w: %d, h: %d, isCameraRecording: %d", width, height,
isCameraRecording);
+ bool disable = property_get_bool(kDisableEcoServiceProperty, false);
+ if (disable) {
+ ECOLOGE("ECOService:: Failed to obtainSession as ECOService is disable");
+ return STATUS_ERROR(ERROR_UNSUPPORTED, "ECOService is disable");
+ }
+
if (width <= 0) {
return STATUS_ERROR(ERROR_ILLEGAL_ARGUMENT, "Width can not be <= 0");
}
diff --git a/media/eco/include/eco/ECODebug.h b/media/eco/include/eco/ECODebug.h
index b250f64..1d0e5e9 100644
--- a/media/eco/include/eco/ECODebug.h
+++ b/media/eco/include/eco/ECODebug.h
@@ -26,6 +26,7 @@ namespace android {
namespace media {
namespace eco {
+static const char* kDisableEcoServiceProperty = "media.ecoservice.disable";
static const char* kDebugLogsLevelProperty = "media.ecoservice.log.level";
static const char* kDebugLogStats = "media.ecoservice.log.stats";
static const char* kDebugLogStatsSize = "media.ecoservice.log.stats.size";