Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de329f21 authored by Sally Qi's avatar Sally Qi
Browse files

Enable refreshrate indicator on external display.

- Add flag for it as well.

Bug: 301647974
Test: play with external monitor; adb shell device_config put
core_graphics
com.android.graphics.surfaceflinger.flags.refresh_rate_overlay_on_external_display
true

Change-Id: I530a7a74b2ec7be1c1a35a1310c87e073764c77a
parent adcd90a3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ void FlagManager::dump(std::string& result) const {
    /// Trunk stable server flags ///
    DUMP_SERVER_FLAG(late_boot_misc2);
    DUMP_SERVER_FLAG(dont_skip_on_early);
    DUMP_SERVER_FLAG(refresh_rate_overlay_on_external_display);

    /// Trunk stable readonly flags ///
    DUMP_READ_ONLY_FLAG(connected_display);
@@ -190,6 +191,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(multithreaded_present, "debug.sf.multithreaded_prese

/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "")
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")

/// Exceptions ///
bool FlagManager::dont_skip_on_early() const {
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public:
    /// Trunk stable server flags ///
    bool late_boot_misc2() const;
    bool dont_skip_on_early() const;
    bool refresh_rate_overlay_on_external_display() const;

    /// Trunk stable readonly flags ///
    bool connected_display() const;
+2 −1
Original line number Diff line number Diff line
@@ -8413,7 +8413,8 @@ status_t SurfaceFlinger::setSmallAreaDetectionThreshold(int32_t appId, float thr
void SurfaceFlinger::enableRefreshRateOverlay(bool enable) {
    bool setByHwc = getHwComposer().hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG);
    for (const auto& [id, display] : mPhysicalDisplays) {
        if (display.snapshot().connectionType() == ui::DisplayConnectionType::Internal) {
        if (display.snapshot().connectionType() == ui::DisplayConnectionType::Internal ||
            FlagManager::getInstance().refresh_rate_overlay_on_external_display()) {
            if (const auto device = getDisplayDeviceLocked(id)) {
                const auto enableOverlay = [&](const bool setByHwc) FTL_FAKE_GUARD(
                                                   kMainThreadContext) {
+6 −0
Original line number Diff line number Diff line
@@ -70,3 +70,9 @@ flag {
  is_fixed_read_only: true
}

flag {
  name: "refresh_rate_overlay_on_external_display"
  namespace: "core_graphics"
  description: "enable refresh rate indicator on the external display"
  bug: "301647974"
}