SF: fix a crash in FlagManager
When dumping the flag, don't dump the server flags if boot
is still in progress.
Test: adb shell dumpsys SurfaceFlinger while booting
Bug: 309017367
Change-Id: I44d12351c55366ff8dae6decb15beebd87db99e1
diff --git a/services/surfaceflinger/FlagManager.h b/services/surfaceflinger/FlagManager.h
index 10784a7..cefce9b 100644
--- a/services/surfaceflinger/FlagManager.h
+++ b/services/surfaceflinger/FlagManager.h
@@ -46,6 +46,10 @@
bool use_adpf_cpu_hint() const;
bool use_skia_tracing() const;
+ /// Trunk stable server flags ///
+ bool late_boot_misc2() const;
+ bool dont_skip_on_early() const;
+
/// Trunk stable readonly flags ///
bool connected_display() const;
bool enable_small_area_detection() const;
@@ -55,10 +59,6 @@
bool hdcp_level_hal() const;
bool multithreaded_present() const;
- /// Trunk stable server flags ///
- bool late_boot_misc2() const;
- bool dont_skip_on_early() const;
-
protected:
// overridden for unit tests
virtual std::optional<bool> getBoolProperty(const char*) const;
@@ -69,6 +69,9 @@
FlagManager(const FlagManager&) = delete;
+ void dumpFlag(std::string& result, bool readonly, const char* name,
+ std::function<bool()> getter) const;
+
std::atomic_bool mBootCompleted = false;
std::atomic_bool mUnitTestMode = false;