OSDN Git Service

Remove access to the backlight brightness
authorHendrik Wagenaar <hendrikw@google.com>
Thu, 2 Feb 2017 18:00:48 +0000 (10:00 -0800)
committerAlex Vakulenko <avakulenko@google.com>
Fri, 3 Feb 2017 23:58:20 +0000 (15:58 -0800)
* We don't need to set the display brightness at the moment, and
  access to the brightness fd requires an SELinux policy change
  that we'd like to avoid, so ifdef out the code for now.

Bug: None
Test: To be tested along with Nick's SELinux policy cl
Change-Id: Ic6de9a1bd15d0eab2780bda31ec67fab94f8d6da

libs/vr/libvrflinger/hardware_composer.cpp

index e0b592e..cc08209 100644 (file)
@@ -211,11 +211,15 @@ bool HardwareComposer::Resume() {
     layer->Initialize(hwc2_hidl_.get(), &native_display_metrics_);
   }
 
+#if ENABLE_BACKLIGHT_BRIGHTNESS
+  // TODO(hendrikw): This isn't required at the moment. It's possible that there
+  //                 is another method to access this when needed.
   // Open the backlight brightness control sysfs node.
   backlight_brightness_fd_ = LocalHandle(kBacklightBrightnessSysFile, O_RDWR);
   ALOGW_IF(!backlight_brightness_fd_,
            "HardwareComposer: Failed to open backlight brightness control: %s",
            strerror(errno));
+#endif // ENABLE_BACKLIGHT_BRIGHTNESS
 
   // Open the vsync event node for the primary display.
   // TODO(eieio): Move this into a platform-specific class.