AAL省电的原理主要是通过根据显示内容来降低背光,然后通过调节gamma来补偿显示亮度,从而达到省电的效果。具体来说,gamma值越高,灰度越低,图像越暗。因此,颜色越暗的图片越省电,这也是为什么暗色主题风格可以省电的原因1。
AAL(Automatic Ambient Light)是一种能够根据环境光线自动调节屏幕亮度和背光的技术。当开启AAL功能后,设备会根据当前显示的内容来动态调整背光亮度。如果显示的内容较暗,那么背光也会被相应地调低,从而减少能耗。同时,通过调节gamma值,可以在保持图像可视性的前提下,进一步降低屏幕亮度,实现更高效的省电效果。
总的来说,AAL省电技术通过智能地调整屏幕亮度和背光,以及优化显示内容,来显著降低设备的能耗,延长电池续航时间
1.测试步骤
根据场景进行配置。查看包名adb shell dumpsys window | findstr mCurrentFocus 或者adb shell dumpsys window -a|grep mLastOpeningApp。
然后根据报名进行配置(主要配置config aal_mode=1的),如下是我的一些配置,供参考
只要是配置backlight="192。测3组参数,默认,配置值为192,配置值为255. 注意这里的backlight并不是真实的背光值,只是一个配置值而已。
配置好后,
adb push ams_aal_config.xml /vendor/etc/
adb reboot
2.AAL优化前后效果对比
例如AAL在Launcer界面同等条件下可以带来 374-242=132mA的优化
3.常用命令
1.查看包名
-
adb shell "dumpsys window | findstr mCurrentFocus"
-
adb shell "dumpsys window -a|grep mLastOpeningApp"
C:\Users\su>adb shell "dumpsys window -a|grep mLastOpeningApp" mLastOpeningApp=AppWindowToken{2fe8660 token=Token{b9cca63 ActivityRecord{aa76092 u0 com.android.gallery/com.android.gallery.app.GalleryActivity t19}}}
2.查看配置命令
adb shell "cat /vendor/etc/ams_aal_config.xml"
C:\Users\su>adb shell "cat /vendor/etc/ams_aal_config.xml"
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) 2012 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
aal_mode:
AAL_MODE_PERFORMANCE = 0;
AAL_MODE_BALANCE = 1;
AAL_MODE_LOWPOWER = 2;
component:
Package: com.foo
Activity: com.foo/.Blah
backlight Level: 0~255 (Default : 128)
-->
<ams_aal>
<!-- AAL_MODE_PERFORMANCE -->
<config aal_mode="0" component="com.rovio.angrybirds" backlight="160"/>
<!-- AAL_MODE_BALANCE -->
<config aal_mode="1" component="com.android.launcher3" backlight="192"/>
<config aal_mode="1" component="com.rovio.angrybirds" backlight="192"/>
<config aal_mode="1" component="com.vectorunit.yellow" backlight="192"/>
<config aal_mode="1" component="nl.dotsightsoftware.pacificfighter.release" backlight="160"/>
<config aal_mode="1" component="com.tencent.mm" backlight="200"/>
<config aal_mode="1" component="com.tencent.mm/.plugin.voip.ui.VideoActivity" backlight="255"/>
<!-- AAL_MODE_LOWPOWER -->
<config aal_mode="2" component="com.android.launcher3" backlight="240"/>
<config aal_mode="2" component="com.rovio.angrybirds" backlight="240"/>
<config aal_mode="2" component="com.vectorunit.yellow" backlight="240"/>
<config aal_mode="2" component="nl.dotsightsoftware.pacificfighter.release" backlight="192"/>
<config aal_mode="2" component="com.tencent.mm" backlight="200"/>
<config aal_mode="2" component="com.tencent.mm/.plugin.voip.ui.VideoActivity" backlight="255"/>
</ams_aal>
3. 配置文件push命令
adb pull /vendor/etc/ams_aal_config.xml ./ adb push ams_aal_config.xml /vendor/etc/