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

Commit a4f14de7 authored by mamik's avatar mamik Committed by Mike Ma
Browse files

Update external display property in hardware_composer.

This change removes the "persist.vr.use_external_display" property and
updates the code path to always allow external displays.

Bug: 140287770
Test: Manual, ran on device and verified that it works
Change-Id: I8bedeb18c93b2a9dc3815177aa9a6a897b63c81e
parent f8cf14d4
Loading
Loading
Loading
Loading
+3 −14
Original line number Original line Diff line number Diff line
@@ -51,8 +51,6 @@ const char kDvrStandaloneProperty[] = "ro.boot.vr";


const char kRightEyeOffsetProperty[] = "dvr.right_eye_offset_ns";
const char kRightEyeOffsetProperty[] = "dvr.right_eye_offset_ns";


const char kUseExternalDisplayProperty[] = "persist.vr.use_external_display";

// Surface flinger uses "VSYNC-sf" and "VSYNC-app" for its version of these
// Surface flinger uses "VSYNC-sf" and "VSYNC-app" for its version of these
// events. Name ours similarly.
// events. Name ours similarly.
const char kVsyncTraceEventName[] = "VSYNC-vrflinger";
const char kVsyncTraceEventName[] = "VSYNC-vrflinger";
@@ -965,18 +963,9 @@ bool HardwareComposer::UpdateTargetDisplay() {
      external_display_ = GetDisplayParams(composer_.get(),
      external_display_ = GetDisplayParams(composer_.get(),
          *displays.external_display, /*is_primary*/ false);
          *displays.external_display, /*is_primary*/ false);


      if (property_get_bool(kUseExternalDisplayProperty, false)) {
      ALOGI("External display connected. Switching to external display.");
      ALOGI("External display connected. Switching to external display.");
      target_display_ = &(*external_display_);
      target_display_ = &(*external_display_);
      target_display_changed = true;
      target_display_changed = true;
      } else {
        ALOGI("External display connected, but sysprop %s is unset, so"
              " using primary display.", kUseExternalDisplayProperty);
        if (was_using_external_display) {
          target_display_ = &primary_display_;
          target_display_changed = true;
        }
      }
    } else {
    } else {
      // External display was disconnected
      // External display was disconnected
      external_display_ = std::nullopt;
      external_display_ = std::nullopt;