From f0f4db9f0173df1389706f7e7f4c5e245659dd6a Mon Sep 17 00:00:00 2001
From: Tao Bao <tbao@google.com>
Date: Tue, 24 Jan 2017 23:29:11 -0800
Subject: [PATCH] recovery: Allow accessing sysfs_leds.

Bug: 34077703
Test: recovery image can set the backlight brightness.
Change-Id: I34d72e1a0e959c2d9f48b3b9c55c4eb2d1cc41bf
---
 public/recovery.te | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/public/recovery.te b/public/recovery.te
index 9bab7e2f7..c607d034c 100644
--- a/public/recovery.te
+++ b/public/recovery.te
@@ -56,6 +56,12 @@ recovery_only(`
 
   allow recovery sysfs_batteryinfo:file r_file_perms;
 
+  # Read from /sys/class/leds/lcd-backlight/max_brightness and write to /s/c/l/l/brightness to
+  # control backlight brightness.
+  allow recovery sysfs_leds:dir r_dir_perms;
+  allow recovery sysfs_leds:file rw_file_perms;
+  allow recovery sysfs_leds:lnk_file read;
+
   allow recovery kernel:system syslog_read;
 
   # Access /dev/usb-ffs/adb/ep0
-- 
GitLab