[Android Head-Units] gustden:
Black screen on button press

This is for the user of the custom keys / launcher.sh apk.

I was playing around with the 'backlight current adjustment' and found something useful. If I set the minimum value to a value that shuts the screen off, I can then assign a button using the 'steering wheel mods' that will effectively turn the screen off. On my unit, the screen will be completely black when the minimum is set to '24'.

Here is what I did:

- Enter current adjustment screen - Car settings -> tools (3368 ) -> Backlight Current Adjustment (5768)

- Lower 'minimum(5-70)' field until screen just goes dark/off ( mine is 24 - see screenshot ).

- Turn headlights on and off, screen will be visible so the settings can be saved.

- Save the settings.

The brightness of the screen can be set using a shell command with a range of (0-255)

For example: settings put system screen_brightness 31 ( will set screen brightness very dim on my unit )

One nice thing with this is it does not change the Joying sliders for the brightness, just the screen output. If you turn the headlights on or off, the screen will change back to to what ever is set in the pull down slider.

I decided to assign the brightness setting to the 'SRC' key on the front of the unit ( Key Code 37 for the launcher.sh script )

I am using the following brightness:

Joying slider (headlights off): 100% (255)- Bright

Joying slider (headlights on): 24% -(61) Dim but to bright for complete darkness

The button rotates through the following brightness levels, and starts with the first one if it has not been pressed with 1 minute:

> settings put system screen_brightness 31 ( Very dim, can only be seen in very dark )

> settings put system screen_brightness 0 ( Shuts screen off )

> settings put system screen_brightness 61 ( Matches my Joying slider "headlight" ~24% on slider brightness )

When you shut the unit off, or change the headlights on or off, it will reset the brightness to the default values of the sliders.

Warning: I have played with backlight settings alot had have not had issues. You shouldn't get into trouble if you don't lower the maximum to a value that is too dark to see. However it is possible, if you intentionally lower both the slider (lights on/lights off) to the point of shutting the screen of, you could create a condition where everything is too dark to see. If you do happen to screw it up, a remote screen display such as "vysor" will allow you to see the screen to fix. Be careful and don't yell at me if you set your screen too dark to see!

37) # SRC/MODE - Screen dimmer / toggles when called
#
# Rotate brightness settings
#
next=`cat /data/$key.cnt`

# Start at the first selection if it has not been changes within 1 minute
if [ $next -gt 0 ]
then
found=`busybox find /data/$key.cnt -mmin -1 | wc -l`
if [ "$found" = "0" ]
then
next=0
fi
fi

case $next in
0) echo 1 > /data/$key.cnt
settings put system screen_brightness 31
;;
1) echo 2 > /data/$key.cnt
settings put system screen_brightness 0
;;
2) echo 0 > /data/$key.cnt
settings put system screen_brightness 60
;;
*) echo 0 > /data/$key.cnt
settings put system screen_brightness 255
;;
esac
;;