[Magisk] MIUI Auto Brightness Fix for Mi 9

Search This thread

arddy1

Senior Member
Jun 18, 2016
175
191
Jakarta
yes its 2047... so. what shall i do/flash/patch to make it work with my mi 9 se?

Have tried the module? If it doesnt work, then i dont know what to do.
I have tried this on some phone like redmi note 5, mi max, mi mix 2s, and all work with different value. Although you installed the wrong module, it should causes the autobrightness behave differently if it really works.
If it doesnt work, the culprit may be: incompatible rom, other module interfering, region settings, or may the hardware..
 

*justintime*

Senior Member
Dec 20, 2008
1,423
486
Xiaomi Mi 11
Xiaomi Mi 11 Ultra
I just curious maybe its causes by region settings. Because in my experiences it may cause system behave differently or lose some features. And also it works in some eu rom, while some doesnt. Not sure if its caused by different hardware parts.

If you want to try, you need to wipe the data and set region in startup. I am using region indonesia.







Some eu users said its working. Just try it!



-------



Update! V3 released with changelog:

- lowered the backlight especially in high brightness level while maintain the visibility. Aside the benefit for eyes, it can reduce risk of amoled burn in.

- adjusted sensor lux value and added more brightness step to get smoother backlight change.
I cant change region settings in RevOS.

If I could only control the brightness boost when I am outside it will help a lot.
When you pull the slider down its keeping to go to full brightness.

Verstuurd vanaf mijn MI 9 met Tapatalk
 

simcold

Senior Member
Nov 15, 2011
536
71
Latest version working on xiaomi.eu 9.5.16?

Wysłane z mojego MI 9 przy użyciu Tapatalka
 

arddy1

Senior Member
Jun 18, 2016
175
191
Jakarta
Ican confirm that doesn't work on xiaomi eu 9.5.16

Not working.....

Wysłane z mojego MI 9 przy użyciu Tapatalka

For the not working ones, what is your region setting?

works for me on eu 9.5.16 (v3)

For the working one, what is your region setting?

I'm still investigating what causes this module works in some users and doesnt in others. My first suspect is region settings in initial startup.
 

simcold

Senior Member
Nov 15, 2011
536
71
My is poland

Wysłane z mojego MI 9 przy użyciu Tapatalka
 
Last edited:

*justintime*

Senior Member
Dec 20, 2008
1,423
486
Xiaomi Mi 11
Xiaomi Mi 11 Ultra
For the not working ones, what is your region setting?







For the working one, what is your region setting?



I'm still investigating what causes this module works in some users and doesnt in others. My first suspect is region settings in initial startup.
You can't set any region on Xiaomi.eu Roms.

From what I have read the region is hard coded to Poland on that Rom.

Verstuurd vanaf mijn MI 9 met Tapatalk
 

arddy1

Senior Member
Jun 18, 2016
175
191
Jakarta
You can't set any region on Xiaomi.eu Roms.

From what I have read the region is hard coded to Poland on that Rom.

Verstuurd vanaf mijn MI 9 met Tapatalk

Oh really? Thanks for the info. I havent used eu roms for long time so i dont know it cant change region anymore..

If its not the region, things are getting harder to figure. What makes the system doesnt use the framework I made. It should be at system level, not the hardware..
 

*justintime*

Senior Member
Dec 20, 2008
1,423
486
Xiaomi Mi 11
Xiaomi Mi 11 Ultra
Oh really? Thanks for the info. I havent used eu roms for long time so i dont know it cant change region anymore..



If its not the region, things are getting harder to figure. What makes the system doesnt use the framework I made. It should be at system level, not the hardware..
Yeah but maybe Poland as fixed region in Xiaomi.eu is the bottleneck.

What region are you on? Because on when is was on global set region on the Netherlands which is also Europe it didn't work either....

Verstuurd vanaf mijn MI 9 met Tapatalk
 

arddy1

Senior Member
Jun 18, 2016
175
191
Jakarta
Yeah but maybe Poland as fixed region in Xiaomi.eu is the bottleneck.

What region are you on? Because on when is was on global set region on the Netherlands which is also Europe it didn't work either....

Verstuurd vanaf mijn MI 9 met Tapatalk

I'm using region Indonesia.

May I know, what is your network operator code (mcc)? You can see it with app Aida64, in Network section.
I'm suspecting it caused by vendor overlay implementation by detecting operator code. It may trigger overlay apks in vendor partition then causes conflict to my module which uses framework-res overlay.
 

*justintime*

Senior Member
Dec 20, 2008
1,423
486
Xiaomi Mi 11
Xiaomi Mi 11 Ultra
I'm using region Indonesia.

May I know, what is your network operator code (mcc)? You can see it with app Aida64, in Network section.
I'm suspecting it caused by vendor overlay implementation by detecting operator code. It may trigger overlay apks in vendor partition then causes conflict to my module which uses framework-res overlay.

It's 20416

What's yours?? Because I saw you can spoof this.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 46
    The idea originally comes from my MIUI Auto Brightness Fix thread in Mi Mix 2s forum. Because i switched device to Mi 9, now i want to make mods for this device brightness too.

    My experience with Miui roms, i think everything is fine and acceptable, except for the Auto Brightness! The screen goes very dark in low lights, and ridiculously bright in not-so-bright lights that makes my eyes sore. I never used the auto brightness before. But after I found this mod, then I can using this great feature in miui again. If you experience the same thing, then try this magisk module!

    So what this module do? It adds framework-res to the /system/media/theme/default. With a magisk module you can do it systemlessly! To install it, just download the module then browse it in Magisk Manager.

    If you dont like my setting values, just unzip my module, find framework-res file, unzip it, then edit the theme_values.xml to any values you want under "config_autoBrightnessLcdBacklightValues", then zip all back

    To test if this module works, tap the Kernel Version in About Phone 5 times, then you will enter CIT. Go to num 21 light sensor. Cover your upper phone with your hands till the light sensor DAC reach 0. If the backlight is not going under module lowest value (ex: 80), then this module works! My module limits the minimal auto brightness and change its behavior. Its usually less bright than the stock in medium light condition. There's should be any noticeably difference.

    Remember, this mod only works on MIUI-based roms with android pie! Tested working on official MIUI, Xiaomi.eu, Revolution OS.

    The download links in attachment.
    Guide:
    1. Legacy method, using framework-res file. Less compatibilty but safer to update rom and easier to costumize.
    V1 : Initial release.
    V2: Lower brightness in medium light.
    V3: Lower brightness in bright light. Brightness steps added to make it smoother.
    V3.1: A bit adjustment to lower brightness in very low light. Lowest backlight value is now 80.
    V4: More responsive to light changes. Lower brightness in low light to compensate new lowest 80 value.
    V5: For android 10 and backwards. Better and smoother brightness in low light. Doesn't work on dark mode.
    V6: for MIUI 12 android 10. Lowest val 160 of new max 4095

    2. Alternative method, using modified system overlay apk file. Use this if legacy method doesn't work. Still in testing wheter can survive after rom update.
    V3b: take values from v3
    V3.1b: take values from v3.1
    V4b: take values from v4
    V5b: take values from v5. For android 10 only! Works on dark mode. There are some lowest brightness variations (20,40,60,80).
    V6b: take values from v6, for MIUI 12 android 10

    Notes:
    - DON'T activate DC anti flickering mode, it ruins the light sensor to become inaccurate.
    - Only V4 and upwards have responsitivity adjustment. More responsive means it needs less light increments to trigger auto brightness adjustment. Android 10 cant use V4 or it wouldn't work.
    - Less bright = better battery life plus reducing risk of amoled burn-in.
    - Editing the values can cause a mess. Add .disable_magisk file in cache partition if your phone cant boot then uninstall the module in manager.
    8
    I flashed v5b on Hellas miui and masik and eu latest and I Everytime I do that , I lost the ability to share my internet from Bluetooth/USB , the features is completely gone , check my screenshot to see the difference

    Confirmed, thanks for the report. I have already fix that. Please redownload in OP. Now it should work again.

    Update: V5b(rev)
    Fix bluetooth and usb tethering problems.

    Yes. I want minimal with 40. Please

    Wysłane z mojego MI 9 przy użyciu Tapatalka

    Even we can go up to 30/20.

    At the moment our device is getting in to 0 value when we are in a pitch dark. If we manually increase to 20, this is very good for reading. I have put system wide dark mode via developer settings.

    Here you go, the lower brightness version of v5b(rev). Link attached in this post.
    6
    UPDATE!
    V5
    Features:
    - support android 10. The responsivity adjustment works now. (b alternative version is not backward compatible)
    - support dark mode (b alternative version only)
    - better and smoother in low brightness (a bit brighter). Lowest value still same.

    Links in OP.
    Note: the apk for 5b version is taken from xiaomi.eu rom (9.10.31). If there's issue when installed on official/another rom please report here.
    3
    UPDATE! V4 Module released with changelog:
    - More responsive/adaptive screen brightness in light changes.
    - for alternative method now using separate overlay apk, not modified one from system. So it must be safe for update rom.
    - Lower brightness in low light a bit to compensate new 80 lowest value.

    Download links in OP!
    2
    This was the missing piece with the MI9 experience.
    I hate the auto brightness on the MI9

    Definitely going to try out.... But I can't download the file?


    Yeah dunno why it cant be downloaded. I have added the mirror link