[Asus Transformer TF700] ikkeT:
About the auto brightness still... It seems the brighness has a bug at the darker environment. I've played around with the brightness settings and values (https://github.com/zombi-x-lp/andro...mmit/e986c09848fd0f30461deefa300a4522840b321c), and can now reproduce the screen getting blank. In a dark room, do:

1. turn on the adaptive brightness

2. start sliding the slider to left, don't lift the finger from slider

3. screen goes blank at some point close to left border

4. slide the slider right, even though you can't see it due screen being blank.

5. screen comes back on

So I suspect what happens is that the adaptive brightness doesn't care about the minimum brightness level of 10 (of 0-255). If our tablet goes below 10, screen blanks. I saw via adb shell, that the brightness goes to 1. I believe the slider is "a relative brightness multiplier", and while being on the left side, it boost down the brightness value compared to what sensor tells it to set the brightness to. And there likely is a bug, it let's the brightness go too low, below minimum of 10, thus causing us blank screen.

So first, if you want auto brightness, make sure your brightness slider is not too low.

Secondly, someone find the location of brightness code in OMNI, and check if there's a bug :)

It' easy to create new brightness scales. Here's quick howto on changing the brightness scales, e.g. if you want to have screen constantly on brighter side or dimmer side:

1. create directories and go there:

mkdir -p my-overlay/res/values; cd my-overlay

2.. create your scale for brightness, the first table is sensor LUX values, and the second one is for the corresponding brightness values:

cat > res/values/config.xml<<EOF
<resources>
<bool name="config_automatic_brightness_available">true</bool>

<integer-array name="config_autoBrightnessLevels">
<item>10</item>
<item>50</item>
<item>100</item>
<item>200</item>
<item>300</item>
<item>400</item>
<item>500</item>
<item>600</item>
<item>700</item>
<item>900</item>
<item>1100</item>
<item>1400</item>
<item>1700</item>
<item>2100</item>
<item>2500</item>
<item>3000</item>
<item>4000</item>
</integer-array>

<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>10</item>
<item>40</item>
<item>60</item>
<item>64</item>
<item>68</item>
<item>72</item>
<item>76</item>
<item>80</item>
<item>84</item>
<item>88</item>
<item>92</item>
<item>96</item>
<item>100</item>
<item>130</item>
<item>160</item>
<item>190</item>
<item>220</item>
<item>255</item>
</integer-array>
</resources>
EOF

3. create manifest file:

cat > AndroidManifest.xml<<EOF
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.frameworkres.overlay">
</manifest>
EOF

4. compile overlay (change your path to aapt tool, this is from zombi compile environment):

../prebuilts/sdk/tools/linux/aapt package -S res/ -M AndroidManifest.xml -f -v -F framework-res-overlay.apk

5. Copy the framework-res-overlay.apk file over to your tablet, and put it in place:

su
mount -o remount,rw /system
mkdir /vendor/overlay
cp /sdcard/Download/framework-res-overlay.apk /vendor/overlay/

6. reboot, the new values should be in use.

This is really nice way to test settings, since you can override pretty much any setting in that config.xml, not only brightness. And you don't need to compile loads of stuff, aapt tool takes seconds to execute. Ultimate tweak tool ;)

-ikke

---------- Post added at 05:55 PM ---------- Previous post was at 05:48 PM ----------

Oh, and btw, here are all the options you can override, with comments: http://androidxref.com/5.1.0_r1/xref/frameworks/base/core/res/res/values/config.xml

---------- Post added at 06:15 PM ---------- Previous post was at 05:55 PM ----------

It might be that the calculations are done here: http://androidxref.com/5.1.0_r1/xre...id/server/display/DisplayPowerController.java

So perhaps that's the place to hunt the bug.