Update libgui to use android::base properties instead of cutils
Clean up cutils/properties.h headers as some files were including it and
not using it.
Also update DebugEGLImageTracker to use android::base properties because
it works on host and is generally more concise.
Bug: 155436554
Test: build, flash and boot
Change-Id: I1dc7060cae9811b69aac9bb36b71b69cd6ecba93
diff --git a/libs/gui/DebugEGLImageTracker.cpp b/libs/gui/DebugEGLImageTracker.cpp
index ab6f364..5762dab 100644
--- a/libs/gui/DebugEGLImageTracker.cpp
+++ b/libs/gui/DebugEGLImageTracker.cpp
@@ -14,13 +14,14 @@
* limitations under the License.
*/
+#include <android-base/properties.h>
#include <android-base/stringprintf.h>
-#include <cutils/properties.h>
#include <gui/DebugEGLImageTracker.h>
#include <cinttypes>
#include <unordered_map>
+using android::base::GetBoolProperty;
using android::base::StringAppendF;
std::mutex DebugEGLImageTracker::mInstanceLock;
@@ -57,10 +58,7 @@
DebugEGLImageTracker *DebugEGLImageTracker::getInstance() {
std::lock_guard lock(mInstanceLock);
if (mInstance == nullptr) {
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.sf.enable_egl_image_tracker", value, "0");
- const bool enabled = static_cast<bool>(atoi(value));
-
+ const bool enabled = GetBoolProperty("debug.sf.enable_egl_image_tracker", false);
if (enabled) {
mInstance = new DebugEGLImageTrackerImpl();
} else {