2

I'm using latest unofficial LOS 18.1 (by zeelog) on my Redmi Note 4/ mido. It works super-well and smooth and has everything I need - except for AOD (Always On Display). Before I go into more detail, a couple of disclaimers:

  1. I know there's other Roms out there that have it natively, such as crDroid (but I prefer LOS)
  2. I know that AOD drains a considerable amount of battery (but I don't mind)
  3. I know there's AOD apps (but I prefer native / in-built solutions)
  4. I know it probably could be done using Xposed / Substratum, (but I don't want to use that)

That being said - is there any way one could modify the Rom so that AOD becomes possible? If the option is there, obviously it can easily be turned on and off using Shell commands

settings put secure doze_always_on 1

and

settings put secure doze_always_on 0

, respectively (I would use the app Tasker for that).

From what I found out, presence/absence of AOD might be related to the Gapps package one is using. I also found out that (maybe only in older versions of Android?) there is a file called AmbientDisplayConfiguration.java in frameworks/base/core/java/android/hardware/display folder which has one or several boolean(s) for AOD that just need(s) to be changed from 0 to 1(?) However, I don't find that file/folder on my phone (although I'm rooted, of course). Maybe this is just present when compiling the Rom?

There are also flashable zips out there that claim to be able to activate AOD, but this did not work for me.

What exactly has to be done to enable it (given my phone/Rom constellation as mentioned)? Like which files have to be added or modified and/or which permissions have to be changed? Is it even possible to implement this feature after the Rom has been baked, or can this only be done in the building/ compilation process?

Thank you so much in advance for any hints! 🙂 Regards, Gary

P.S. please feel free to ask for any details I might have missed! 🙂

EDIT I finally dared to compile LOS 16 for my Xperia Tablet Z (pollux). I changed the values of two AOD-related bools in .../master/core/res/res/values/config.xml from false to true, flashed the finished zip through recovery after compiling successfully. AOD now works as intended 🙂. Will try that for my mido later as well. So to answer my own question - AOD seems to be something hardcoded into the ROM. After compiling the ROM, the user doesn't see that config.xml (not even if you're rooted, and it's not in framework-res.apk, I checked that). So either this has to be set before compiling the ROM or, possibly, one could use an overlay apk that achieves the same result. In my opinion the first option is best - obviously this requires you to build LOS from source yourself, which I would encourage anyone to do - it's a rewarding experience to be able to tweak the OS to your own likes instead of having to rely on devs' decisions. Once you get the hang of it of course you can modify many other things apart from just Ambient Display settings.

2
  • It can be overlayed, see how GSIs do it. Applauses for your determination in building the entire ROM just for this simple tweak, though! – Andy Yan Apr 13 at 9:15
  • @Andy Yan Sure, you're right :) However, this was just the last little incentive for me to actually go ahead and try compiling LOS myself. I'm still quite noob, could you possibly provide some more details for the overlay method? :) thx in advance, Gary – Gary Chainmiller Apr 14 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.