Turn up brightness a little when UI crashes (#20142)

* implement ui check and brightness set in thermald

* fix bugs

* only set once

* duh

* forgot factor for tici
old-commit-hash: 4c243da0194b8fcefb3c7cba3472fa983ccd7052
This commit is contained in:
robbederks
2021-02-24 15:25:06 +01:00
committed by GitHub
parent ddc95515d0
commit 2db03fdbe2
5 changed files with 25 additions and 0 deletions
+4
View File
@@ -101,3 +101,7 @@ class HardwareBase:
@abstractmethod
def get_thermal_config(self):
pass
@abstractmethod
def set_screen_brightness(self, percentage):
pass
+4
View File
@@ -348,3 +348,7 @@ class Android(HardwareBase):
def get_thermal_config(self):
return ThermalConfig(cpu=((5, 7, 10, 12), 10), gpu=((16,), 10), mem=(2, 10), bat=(29, 1000), ambient=(25, 1))
def set_screen_brightness(self, percentage):
with open("/sys/class/leds/lcd-backlight/brightness", "w") as f:
f.write(str(int(percentage * 2.55)))
+3
View File
@@ -76,3 +76,6 @@ class Pc(HardwareBase):
def get_thermal_config(self):
return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), ambient=(None, 1))
def set_screen_brightness(self, percentage):
pass
+4
View File
@@ -183,3 +183,7 @@ class Tici(HardwareBase):
def get_thermal_config(self):
return ThermalConfig(cpu=((1, 2, 3, 4, 5, 6, 7, 8), 1000), gpu=((48,49), 1000), mem=(15, 1000), bat=(None, 1), ambient=(70, 1000))
def set_screen_brightness(self, percentage):
with open("/sys/class/backlight/panel0-backlight/brightness", "w") as f:
f.write(str(percentage * 10.23))