Added use_adpf_cpu_hint method to flagmanager
Bug: 195990840
Test: make;
Check output of:
adb shell dumpsys SurfaceFlinger | grep -A 10 "FlagManager"
Change-Id: I7d81808a33abc87eeb32a2b90d8ada6cd458f8e7
diff --git a/services/surfaceflinger/FlagManager.cpp b/services/surfaceflinger/FlagManager.cpp
index f0c5b58..7602e6d 100644
--- a/services/surfaceflinger/FlagManager.cpp
+++ b/services/surfaceflinger/FlagManager.cpp
@@ -33,6 +33,7 @@
void FlagManager::dump(std::string& result) const {
base::StringAppendF(&result, "FlagManager values: \n");
base::StringAppendF(&result, "demo_flag: %" PRId64 "\n", demo_flag());
+ base::StringAppendF(&result, "use_adpf_cpu_hint: %s\n", use_adpf_cpu_hint() ? "true" : "false");
}
namespace {
@@ -90,4 +91,10 @@
std::optional<int64_t> sysPropVal = std::nullopt;
return getValue("DemoFeature__demo_flag", sysPropVal, kDemoFlag);
}
+
+bool FlagManager::use_adpf_cpu_hint() const {
+ std::optional<bool> sysPropVal = std::nullopt;
+ return getValue("AdpfFeature__adpf_cpu_hint", sysPropVal, false);
+}
+
} // namespace android
diff --git a/services/surfaceflinger/FlagManager.h b/services/surfaceflinger/FlagManager.h
index 65e30a4..24d83a2 100644
--- a/services/surfaceflinger/FlagManager.h
+++ b/services/surfaceflinger/FlagManager.h
@@ -31,6 +31,8 @@
int64_t demo_flag() const;
+ bool use_adpf_cpu_hint() const;
+
private:
friend class FlagManagerTest;