account arrowhead-down arrowhead-up mobile-menu search sm-bold-x x-skinny-rounded x-skinny arrowhead-right social-facebook social-googleplus social-instagram social-linkedin social-pinterest social-qzone social-renren social-tencent social-twitter social-vkontakt social-weibo social-youku social-youtube

Please help us improve our website

Take our customer survey to evaluate your visit.

It should only take a few minutes to answer five quick questions. Just click the Launch survey button at the end of your visit to begin.

cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the Open Devices community!

This is where we discuss open source and development related questions on our Open Devices initiative.

Adding brightness levels for more control

SOLVED
Highlighted
Apprentice
Message 1 of 2
952 Views
Message 1 of 2

Adding brightness levels for more control

My Xperia X on the latest Sony AOSP 8.1 doesn't have nearly enough levels of brightness between the lowest setting and one tick up from there. This makes my adaptive brightness pretty unusable since it fluctuates all over the place from pretty bright to far too bright.

 

I'd like to modify the source to add more levels but I'm not clear on how to do it, even with the source comments.

 

Here's my git-diff showing my attempted edits that don't seem to do what I thought they would do (relevant bits starting at line 134):

 

https://github.com/retro486/device-sony-suzu/commit/6ad390422f68a0a654d7ce632203c802387bff4f#diff-e0...

 

Thanks for any guidance!

 

Edit: Specifically I'd like to make it logrithmic, something like: 1%, 2%, 4%, 7%, 9%, 11%, 13%, 15%, 20%, 25%, 30%, 35%, 40%, 50%, 60% 70%, 80%, 90% 100% but will need to tune it depending on my ambient light sensor's behavior (see where it jumps a lot and add more resolution there).

1 ACCEPTED SOLUTION

Accepted Solutions
Apprentice
Message 2 of 2
1,366 Views
Message 2 of 2

Re: Adding brightness levels for more control

So I realized the trick isn't to add MORE levels, it's to remove levels and fine tune them so there's a better spread (i.e., don't max out the backlight because it washes out the colors).

 

Here's my updated changes that ended up making me pretty happy:

 

https://github.com/retro486/device-sony-suzu/commit/e43e6751ee351d7f2891d41a9f3a6f9882988a62

1 REPLY 1
Apprentice
Message 2 of 2
1,367 Views
Message 2 of 2

Re: Adding brightness levels for more control

So I realized the trick isn't to add MORE levels, it's to remove levels and fine tune them so there's a better spread (i.e., don't max out the backlight because it washes out the colors).

 

Here's my updated changes that ended up making me pretty happy:

 

https://github.com/retro486/device-sony-suzu/commit/e43e6751ee351d7f2891d41a9f3a6f9882988a62