[ECOService]: Add a setprop to disable ECOService.

Bug: 117877984
Test: Unit Test.
Change-Id: Ie354de13151df0d85937b1f846c8cfab04a80894
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 @@
     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 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";