Open DrRambone opened 5 years ago
Create an overlay, see https://github.com/phhusson/treble_experimentations/wiki/How-to-create-an-overlay%3F
I did https://github.com/uvitor/vendor_hardware_overlay/tree/master/Samsung/beyond2ltexx
When I run test script it returns a lot of issues saying it doesn't corresponds to an available option(or something like that)even so I built it and it doesn't show me any new option to choose (cmd overlay list).
0422-3800.zip Here are the original stock framework res, and the apk overlay made by me following yours instructions.
Tried enabling automatic brightness using an overlay and I was stuck on bootloop. I investigated further and found this in the logcat:
06-14 23:23:27.717 5616 5616 W SystemServer: ***********************************************
06-14 23:23:27.718 5616 5616 E SystemServer: BOOT FAILURE making Power Manager Service ready
06-14 23:23:27.718 5616 5616 E SystemServer: java.lang.IllegalArgumentException: backlight[256] is out of range of [0, 255] (too high)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.internal.util.Preconditions.checkArrayElementsInRange(Preconditions.java:524)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.display.BrightnessMappingStrategy$PhysicalMappingStrategy.<init>(BrightnessMappingStrategy.java:598)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.display.BrightnessMappingStrategy.create(BrightnessMappingStrategy.java:82)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.display.DisplayPowerController.<init>(DisplayPowerController.java:477)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.display.DisplayManagerService$LocalService.initPowerManagement(DisplayManagerService.java:2186)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.power.PowerManagerService.systemReady(PowerManagerService.java:783)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.SystemServer.startOtherServices(SystemServer.java:1703)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.SystemServer.run(SystemServer.java:437)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.server.SystemServer.main(SystemServer.java:296)
06-14 23:23:27.718 5616 5616 E SystemServer: at java.lang.reflect.Method.invoke(Native Method)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
06-14 23:23:27.718 5616 5616 E SystemServer: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
Apparently, com.android.server.display.BrightnessMappingStrategy$PhysicalMappingStrategy
checks if the backlight values are within the range set by PowerManager.BRIGHTNESS_OFF
and PowerManager.BRIGHTNESS_ON
. The S10's backlight values go up to 486 at 800 nits, when PowerManager.BRIGHTNESS_ON
is set to only 255.
I removed the excess values from Samsung's overlay and limited it to 255 at 420 nits, and the system booted fine with auto-brightness fully working, although we can't utilize peak brightness anymore.
One solution I could think of is to create a resource like config_screenBrightnessExtendedMaximum
(this is what Samsung actually did) and use that instead of PowerManager.BRIGHTNESS_ON
. This way, other devices that have a different implementation for HBM won't be affected and we can just create an overlay for any devices' usage.
References
You should already be able to go to the higher brightness values by going in treble settings and ticking samsung high brightness
Ah, didn't notice that. Regarding the overlay, it's possible to override it, right? Since the vendor overlay's priority is 0.
I'll get started on creating an overlay for the S10 then.
Ah, didn't notice that. Regarding the overlay, it's possible to override it, right? Since the vendor overlay's priority is 0.
I'll get started on creating an overlay for the S10 then.
Hello, can you share your overlay?
@elmkzgirxp did you get your overlay working? mine does nothing at all.
Yes, it's working as expected. Try this: framework-res__auto_generated_rro.zip
I currently don't have time to make an overlay repository for the S10, so I just decompiled Samsung's RRO and signed it.
@phhusson @Flatty11 On the S10 SM-G9730 the Autobrightess works well. Sometimes upon waking (I think from doze) the brightness is very high.
Is there a specific file I can turn off battery optimization? On Samsungs/Pixels stock android, this fell under "Device health services".
I believe the doze turns off the light sensor and forgets its ambient light setting.
The app "YAAB" appears to add auto brightness without much issue.
Auto-brightness non-functional