[Overlay] Enable Night Light, Auto-Brightness, Ambient Display & more on Treble ROM

MishaalRahman

Editor in Chief
Nov 2, 2015
1,038
2,115
153
www.xda-developers.com
[Overlay] Enable Night Light, Auto-Brightness, Ambient Display & more on Treble ROM

Hello.

By default, phhusson's generic AOSP Treble ROM is bare bones. That means it does not include features such as Night Light, Ambient Display, or Adaptive Brightness. Luckily all you need is the right overlay and you can bring these features back.

I tested this on the Huawei Mate 10 Pro and everything seems to work save for the lift-to-wake gesture. I am not sure if a simple overlay can enable that, as I already target the right boolean value for it. As for Adaptive Brightness, the lux and corresponding backlight values were borrowed from the Huawei Mate 9's framework-res.

Update 2/19/18

With the release of phhusson's Android 8.1 Oreo Treble GSI, I thought I would take the time to update my overlay as well with a new feature: Always on Display. You can download the overlay from the attachment in this comment, and install it using the same set of instructions below (don't install the overlay attached in this post if you want AOD). Please read the warnings carefully. I accept no responsibility for anything you do with your phone.

Update 2/6/18

I have updated the attached framework overlay to include the following features:
  1. WiFi automatic wakeup
  2. Pinner service for the default camera app and critical framework files

This should work on any device that can boot phhusson's Treble ROM.

Installation Instructions

  1. Download the attached overlay
  2. With root, push the overlay to /vendor/overlay. Create the folder if it doesn't exist.
  3. Run the following command in a rooted terminal or ADB shell:
    Code:
    chcon u:object_r:vendor_overlay_file:s0 /vendor/overlay;chcon u:object_r:vendor_overlay_file:s0 /vendor/overlay/framework-res__auto_generated_rro.apk
  4. Reboot

XDA Labs adds emojis in the command for some reason. Open this thread in a browser to get the right command.

Why do you need to run that command? Without it, the overlay won't be seen as installed and isn't enabled. I'm not sure why, but according to phhusson it's an SELinux-related issue and this command fixes that.

Enjoy!
 

Attachments

Last edited:

mrassol

Senior Member
May 31, 2007
229
16
0
Rennes
Hello, not working on mate 9, all commands OK - no output error (I added mount -o rw,remount /system and mount -o rw,remount /vendor) to copy your files, but even after reboot no new things

EDIT : after "installing" the app (click on it with a root explorer), all options are now visible but not working
 
Last edited:

MishaalRahman

Editor in Chief
Nov 2, 2015
1,038
2,115
153
www.xda-developers.com
Hello, not working on mate 9, all commands OK - no output error (I added mount -o rw,remount /system and mount -o rw,remount /vendor) to copy your files, but even after reboot no new things

EDIT : after "installing" the app (click on it with a root explorer), all options are now visible but not working
If you install it as a regular app, it won't work. It MUST be pushed to /vendor/overlay manually, and you MUST run that command.

how can i get the root access on the rom?:)
Install phhusson's SuperUser from the Play Store.

It is also not working on honor v9 .
Did you follow the steps exactly? This can't be installed like a regular app.
 
  • Like
Reactions: Beetle84

mrassol

Senior Member
May 31, 2007
229
16
0
Rennes
you did'nt read my post ;)

I did all you wrote (I even add mount -o rw,remount /system and mount -o rw,remount /vendor) and nothing changed
AFTER that, I install the apk from /vendor/overlay using a root explorer and now the options are visible, brightness is working (I didn't saw it first), night mode is also working, ambiant display is also working but the option to turn on phone on pickup don't work.

So my bad, I didn't test it so much
 

独影阑珊

Member
Nov 18, 2017
36
8
18
Hubei Xianning
If you install it as a regular app, it won't work. It MUST be pushed to /vendor/overlay manually, and you MUST run that command.



Install phhusson's SuperUser from the Play Store.



Did you follow the steps exactly? This can't be installed like a regular app.
When I try to open it as a regular app , my phone display it can not open .I am sure it be pushed to /vendor/overlay .,and I have run the commed and rebooted system at least 5 times.but it still useless.(I am sorry my English is poor.)
 

etern1ty

Senior Member
Aug 6, 2010
126
13
0
Took me a while to get it to work on my mate 10 pro, then realised I had to manually set the permissions on the folder, and file for it to work. Great job!

Is there a way I could edit the minimum and maximum brightness it reaches?

Thanks again :)
 

MishaalRahman

Editor in Chief
Nov 2, 2015
1,038
2,115
153
www.xda-developers.com
Took me a while to get it to work on my mate 10 pro, then realised I had to manually set the permissions on the folder, and file for it to work. Great job!

Is there a way I could edit the minimum and maximum brightness it reaches?

Thanks again :)
Ah, I forgot about that. I believe the folder permissions are 755 and the APK should be 644, correct? As for setting the brightness, do you want to increase the minimum and lower the maximum of the adaptive brightness?
 

etern1ty

Senior Member
Aug 6, 2010
126
13
0
Ah, I forgot about that. I believe the folder permissions are 755 and the APK should be 644, correct? As for setting the brightness, do you want to increase the minimum and lower the maximum of the adaptive brightness?
Yeah, that sounds right :) I just matched the other folders and APKs. I was hoping to decrease the minimum (so it's darker), I don't notice a big effect on my mate 10 pro.

Is there a guide for going about this? I'm interested to learn how to make these sorts of modifications myself.

Cheers
 

MishaalRahman

Editor in Chief
Nov 2, 2015
1,038
2,115
153
www.xda-developers.com
Yeah, that sounds right :) I just matched the other folders and APKs. I was hoping to decrease the minimum (so it's darker), I don't notice a big effect on my mate 10 pro.

Is there a guide for going about this? I'm interested to learn how to make these sorts of modifications myself.

Cheers
Decompile my overlay. Look in /res/values/arrays.xml. Look at "config_autoBrightnessLcdBacklightValues" array and change the first item, <item>6</item> to <item>1</item>. Build the APK, sign it, and then push.
 
  • Like
Reactions: etern1ty
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone