8

Whenever the "battery low" popup appears in my tablet, the brightness goes to full. This makes no sense because the brightness should be decreased to the minimum instead of going to the maximum, as battery is low. This is also annoying as I have to lower the brightness.

I've looked in the settings to disable this but found no such option.

So, How do I prevent brightness from going 100% when the battery low popup appears?

I am running Android Kitkat 4.4.2 and my tablet is not rooted.

10
  • Is your brightness set to auto? And are you using any battery improving app?
    – Lucky
    Commented Aug 23, 2015 at 15:29
  • @Lucky "Is your brightness set to auto?" -- My tablet doesn't have such an option. I keep it at the minimum. "And are you using any battery improving app?" -- My tablet came with the "Lenovo Power Manager". It doesn't have any option related to brightness, however. So I don't think that's the culprit. But now, I've found a "protective glasses" (dims the screen brightness when enabled) option in this app that is currently disabled. I'll try that and see if it can prevent this problem. Waiting for the battery to become low to try it...
    – Spikatrix
    Commented Aug 23, 2015 at 15:36
  • Have you tried that 'protective glasses' option? What's the result? Also, I don't have much hope that the brightness can be prevented from going up without root access (there is a file under /sys) or a factory reset or a system setting which you said doesn't exist. // There is an action in Tasker app Display -> Brightness which may be able to override the settings your system is following. I'll have to wait for 15% to test in my system.
    – Firelord
    Commented Aug 24, 2015 at 6:10
  • @Firelord I noticed that the 'protective glasses' option, when enabled, presents me with a slider that adjusts brightness. When system brightness is at the minimum and when this option is enabled, the slider is at maximum level and the brightness of the screen decreases lower than the minimum kennel provided by the system. Decreasing the slider when the system brightness is at the minimum, decreases the brightness even more! But when the system brightness is at the maximum and the brightness of the option is at the minimum, the screen's brightness is low but the bottom bar has full brightness.
    – Spikatrix
    Commented Aug 24, 2015 at 12:45
  • @Firelord The bottom bar is the bar which contains the 3 buttons back, home and recent apps. Do you think the extra brightness of the bar will affect battery? And oh! I've not tried the 'protective glasses' option to counter the problem presented in this question. Still waiting for battery to drain
    – Spikatrix
    Commented Aug 24, 2015 at 12:48

4 Answers 4

4
+25

Automation is the preferred option, or rather only option in this case, since Android OS does not offer any settings for requirements quoted.

Many apps are available. I prefer using MacroDroid , since it is free (upto 5 macros) and easy to learn.

MacroDroid creates and runs Macros to automate

A macro consists of the following (elaborating on app help):

Trigger

Event(s) occurring on the device (e.g incoming SMS, headphones inserted). Multiple triggers are evaluated to logical (OR)- meaning, any of the trigger conditions met would fire macro

Actions

An action that the device can perform (e.g. set wallpaper, take picture)

Constraints

A constraint that must be satisfied for the trigger to fire (e.g. day of week, battery level). Multiple constraints are evaluated to logical (AND)- meaning, all the constraints must be satisfied to fire trigger

Notes on solution offered

  1. Tested on KitKat. I don't visualise any issues with higher Android versions

  2. This cannot "read" when the low battery level indication comes up, but for this macro assuming it to be 15 %. You can see the battery level in your tablet and accordingly tweak the macro

  3. Doesn't require root

  4. This solution does not address Android system explanation for high/low Brightness and how they are activated

System Settings

  1. Do not Greenify MacroDroid and exclude it from task killers, if you use them.

  2. Enable MacroDroid in "Auto Protect"(Huawei phones) or "Stamina Mode" (Sony phones or "Power Nap" (Stamina Mode Xposed module for non Sony devices). Also, if you update to Marshmallow in the future, exclude MacroDroid from Doze. Refer this: Is there a way to exclude an app from Doze?

These features prevent app(s) to be active when the device is not awake, conserving battery. May not be pertinent to your phone but adding this as a general precaution.

  1. Enable MacroDroid in accessibility settings and also allow it as device administrator in security settings.

  2. For Lollipop, enable notification access from notification settings


tl;dr: Your macro would look like this

Trigger:

Battery Leveldecreases to → (choose percentage by sliding scale or 15 %)

Actions:

  • Brightness0 (Choose On sliding scale- doesn't require root)
  • Wait before next action → set to 10 seconds (recommended to separate previous and next actions ensuring both happen)
  • Dim ScreenDimmer On → 10% (Choose On sliding scale- doesn't require root, if the earlier action is not good enough for you - this is akin to "screen filter" apps like Darker)

Constraints:

None (Macro always runs)


Testing Macro

Name and save the macro and from 3 button menu on right side

  • Test Actions: To see how macro behaves at each action without reference to trigger/constraint conditions

  • Test Macro: To see how macro behaves as expected ( with reference to trigger/action/constraints, that is, macro as a whole)

Trouble shooting

Macro doesn't run at all- In most cases, it is due to correct system settings not being applied. To verify this, from the 3 button help option on the main app interface select System Log and see if your macro had run when it was triggered. If your macro name doesn't figure, recheck system settings

3

Note: the solution below requires your Android to be rooted.


I believe that automation without root wouldn't straightly deal with the issue, since it is not changing or overriding anything, but doing its own stuff over the existing changes. I was about to post on similar lines until I realized that the key to the solution is a file named max_brightness, a file under /sys, hence a part of Linux kernel and directly managed by it. I found that setting the brightness limit in that file is the best way to go here. You may disagree with a better solution.

I noticed that once your custom maximum brightness is set, neither Android nor an app was able to set brightness beyond that custom level unless they changed the content of that file, which often an app has no reason to and none of them changed either. Besides, the file is owned by root and is part of group root, so any app or even system_server would require root privilege to make changes into that file.

Finding that file is bit tricky. In my MTK device with Android 4.2, that file appears to be under /sys/devices/platform/leds-mt65xx/leds/lcd-backlight/.

In my Qualcomm device with Android 5.0.2 and above, the file appeared to be in /sys/devices/mdp.0/qcom,mdss_fb_primary.168/leds/lcd-backlight/.

I assume that the best way to find that file is to run a search query (setup for that), such as:

(Requires busybox)

adb shell su -c 'find /sys/ -type f -iname "max_brightness"'

In my Qualcomm device, the output it gives is:

/sys/devices/f9924000.i2c/i2c-2/2-0068/leds/red/max_brightness
/sys/devices/f9924000.i2c/i2c-2/2-0068/leds/blue/max_brightness
/sys/devices/f9924000.i2c/i2c-2/2-0068/leds/green/max_brightness
/sys/devices/mdp.0/qcom,mdss_fb_primary.168/leds/lcd-backlight/max_brightness
/sys/devices/qcom,camera-led-flash.81/leds/torch-light/max_brightness
/sys/devices/msm_sdcc.1/leds/mmc0::/max_brightness
/sys/devices/msm_sdcc.2/leds/mmc1::/max_brightness
/sys/devices/01-qcom,leds-d300/leds/led:flash_torch/max_brightness
/sys/devices/01-qcom,leds-d300/leds/led:flash_0/max_brightness
/sys/devices/01-qcom,leds-d300/leds/led:flash_1/max_brightness
/sys/devices/01-qcom,leds-e200/leds/kpdbl-lut-2/max_brightness
/sys/devices/01-qcom,leds-e200/leds/kpdbl-pwm-3/max_brightness
/sys/devices/01-qcom,leds-e200/leds/kpdbl-pwm-4/max_brightness
/sys/devices/01-qcom,leds-e200/leds/button-backlight/max_brightness

The location where lcd-backlight is mentioned was the only one that made sense to me and this is how I found the file in my device. Don't you worry asking about others. I attempted changing the brightness of the screen and looked for the changes in the file named brightness (also located under those said locations). None of them reflected the correct output other than the one at /sys/devices/mdp.0/qcom,mdss_fb_primary.168/leds/lcd-backlight.

Only for demonstration, try setting a limit in max_brightness

adb shell su -c 'echo LIMIT > PATH_TO_MAX_BRIGHTNESS'   # in my case PATH_TO_MAX_BRIGHTNESS is /sys/devices/mdp.0/qcom,mdss_fb_primary.168/leds/lcd-backlight/ and set LIMIT to a value less than 30 (not limited to). 

Now try maxing the brightness by using brightness slider or a third party app and you would notice that the brightness of your screen doesn't exceed beyond a certain point even when slider or the app's configuration appears to be at maximum. The brightness for that "certain point" would certainly be less than the default one you are used to.

Note that the maximum value in max_brightness is often found to be 255 and the brightness ranges from 0-255. Often, not always true, that is. And fear not from setting the limit to 0. It would cause the screen not to lit until you revert the changes or restart the device.

Find a limit which would not disturb you in your sleep or drains the battery heavily when battery runs low on juice.


Automation

For , use any automation app that can run a command with root privilege and when the context of your preferred trigger is met. I recommend a time based trigger.

Some working examples:

  • In Tasker, setup a profile with your preferred context, create a task and use the action: Code → Run Shell:

    • Command: echo LIMIT > PATH_TO_MAX_BRIGHTNESS
    • check Use Root
  • In MacroDroid, setup your preferred trigger and for action install Secure Settings, choose it → Actions → Run Command:

    • Command: echo LIMIT > PATH_TO_MAX_BRIGHTNESS
    • check Use Root
  • In Automate, as part of your flow, when setting up an action for your trigger, select Shell command superuser under Apps and do:

    • Command Line: echo LIMIT > PATH_TO_MAX_BRIGHTNESS


    Make sure to install all the permissions the flow require.

  • In DroidAutomation, setup your trigger and under task, select Root → Execute a command line and type: echo LIMIT > PATH_TO_MAX_BRIGHTNESS

As you would've guessed, you would have to setup two profiles for every app. One to setup a limit and the other to set the maximum brightness to the default you're used to.

Explicit low battery triggers:

  • Tasker

    • State → Battery Level → set the range
    • Alternative: Event → System → Intent Received → leave everything untouched but set the Action to android.intent.action.BATTERY_LOW.
  • MacroDroid

    Follow beeshayms' answer to setup the trigger

  • Automate

    Go to Apps → Broadcast receive → leave everything untouched but select Battery low in Action

  • Droid Automation

    Select Low battery from Add a trigger


I would like you to keep this under consideration that using a low battery or 100% battery trigger would defeat the purpose of this answer, which is to override the changes Android want to make. As an example, if you setup LIMIT to 0 whenever the battery reaches 100%, what would happen is your Android would lit the screen to maximum as usual and in few milliseconds (you read correctly) your automation app would run and set the limit. Your sleep may get interrupted in those milliseconds.

In an another situation, when low battery intent is broadcasted by system, Cool Guy's tablet may end up with a screen lit to maximum and in few milliseconds, the brightness would fall back to LIMIT.

The workaround is to set up the battery level to 16 or more for battery low trigger and 99 or less for full battery charge.

2
  • Have not grasped advantage of time based trigger, would you care to clarify? -Guess I got lost trying to understand system stuff in your solution:)
    – beeshyams
    Commented Jan 6, 2016 at 1:30
  • My recommendation on time based trigger doesn't require an additional trigger for "battery low" or "battery 100%". It is my assumption that regardless of charging level, during a certain period OP would always be sleeping, so why bother about charging level at all. Just make sure that system never interrupts the sleep of OP by high brightness, no matter what (you can setup special conditions, such as if call comes during that time, restore brightness). Actually, it is only a recommendation, nothing mandatory. The parts of my solution are very much independent.
    – Firelord
    Commented Jan 6, 2016 at 1:35
2

Try using an app called Screen filter. CAUTION: Do not set the brightness below 17 because you cant see anything. You can text at nighy n the person sitting next to you wont even see

1

Disclaimer: Not tested on Lollipop as my device is NOT on Lollipop, my device doesn't brighten up screen on full charge. Would request OP or Samsung S4 galaxy users to confirm. Theoretically should work

Firelord in his solution has highlighted a point that my earlier solution entails that the screen is lit for milli seconds that could possibly cause a disturbance to OP. However, his method involves rooting and identifying the file to change the maximum brightness levels

IMO, this approach lacks universality, since it is applicable to those who are rooted and have the understanding to identify the file to change brightness levels (technical merit apart). Hence, I am presenting an alternate solution which provides similar results but without rooting

This involves using a screen filter app Darker. This is available in free version (which can reduce brightness to 20%) and Pro Version (which can reduce brightness to below 20%, down to zero brightness). App description relevant here says

Darker can lower your screen brightness to extremely low levels, to help prevent eyestrain during the night

Macro Logic:

  • Activate the Darker app whenever power to charge is connected to decrease screen brightness to a comfortable level
  • When charger is manually disconnected on waking up , tap the stop button of the app to revert to normal brightness (from notification panel)

  • If there is a need to answer a call or text message, either manually do the above or add as a constraint in the macro

Your macro would look like this

Trigger:

*Power Connected/Removed →Connected

Actions:

  • Launch ApplicationDarkerKeep existing (Darker is previously configured to comfortable darkness level and this option selects that)

Constraints:

None (Macro always runs)

Note

  • Darker app is running whenever charging is ongoing. This is a trade-off in not rooting device
  • Refer to earlier solution for MacroDroid related information
  • Figure below gives an idea of the reduction in screen brightness using the Darker app. Panel on extreme left is without using Darker app but keeping screen at minimum brightness level. In the middle is using Darker (free version ) keeping screen brightness at 20% and the last one is using the Pro version app at 10% brightness

Tap to enlarge

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .