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

Commit fcfcfad3 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "SF: enable touch timer and content detection by default" into main

parents 946faa4a 3f84c50c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -92,7 +92,12 @@ void Scheduler::startTimers() {
    using namespace sysprop;
    using namespace std::string_literals;

    if (const int64_t millis = set_touch_timer_ms(0); millis > 0) {
    const int32_t defaultTouchTouchTimerValue =
            FlagManager::getInstance().enable_fro_dependent_features() &&
                    sysprop::enable_frame_rate_override(true)
            ? 200
            : 0;
    if (const int32_t millis = set_touch_timer_ms(defaultTouchTouchTimerValue); millis > 0) {
        // Touch events are coming to SF every 100ms, so the timer needs to be higher than that
        mTouchTimer.emplace(
                "TouchTimer", std::chrono::milliseconds(millis),
+4 −1
Original line number Diff line number Diff line
@@ -4088,7 +4088,10 @@ void SurfaceFlinger::initScheduler(const sp<const DisplayDevice>& display) {

    FeatureFlags features;

    if (sysprop::use_content_detection_for_refresh_rate(false)) {
    const auto defaultContentDetectionValue =
            FlagManager::getInstance().enable_fro_dependent_features() &&
            sysprop::enable_frame_rate_override(true);
    if (sysprop::use_content_detection_for_refresh_rate(defaultContentDetectionValue)) {
        features |= Feature::kContentDetection;
        if (FlagManager::getInstance().enable_small_area_detection()) {
            features |= Feature::kSmallDirtyContentDetection;
+2 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ void FlagManager::dump(std::string& result) const {
    DUMP_READ_ONLY_FLAG(add_sf_skipped_frames_to_trace);
    DUMP_READ_ONLY_FLAG(use_known_refresh_rate_for_fps_consistency);
    DUMP_READ_ONLY_FLAG(cache_if_source_crop_layer_only_moved);
    DUMP_READ_ONLY_FLAG(enable_fro_dependent_features);

#undef DUMP_READ_ONLY_FLAG
#undef DUMP_SERVER_FLAG
@@ -195,6 +196,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(add_sf_skipped_frames_to_trace, "")
FLAG_MANAGER_READ_ONLY_FLAG(use_known_refresh_rate_for_fps_consistency, "")
FLAG_MANAGER_READ_ONLY_FLAG(cache_if_source_crop_layer_only_moved,
                            "debug.sf.cache_source_crop_only_moved")
FLAG_MANAGER_READ_ONLY_FLAG(enable_fro_dependent_features, "")

/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "")
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public:
    bool add_sf_skipped_frames_to_trace() const;
    bool use_known_refresh_rate_for_fps_consistency() const;
    bool cache_if_source_crop_layer_only_moved() const;
    bool enable_fro_dependent_features() const;

protected:
    // overridden for unit tests
+7 −0
Original line number Diff line number Diff line
@@ -98,5 +98,12 @@ flag {
  namespace: "core_graphics"
  description: "do not flatten layers if source crop is only moved"
  bug: "305718400"
}

flag {
  name: "enable_fro_dependent_features"
  namespace: "core_graphics"
  description: "enable frame rate override dependent features by default"
  bug: "314217419"
  is_fixed_read_only: true
}