Android:设置自动亮度适应速度

如果在Android设置中启用了自动亮度,我想修改Android更改屏幕亮度的速度.

问题是如果屏幕亮度快速变化则非常烦人,因为如果用户的手意外地覆盖了光传感器.

禁用自动亮度不是一个选项.

我发现了这个:Change brightness according to surrounding light in android
但我宁愿不手动破解它……

有更好的选择吗?

最佳答案
您可能想看看这些常量

 private static final int BRIGHTNESS_RAMP_RATE_FAST = 200;
 private static final int BRIGHTNESS_RAMP_RATE_SLOW = 40;

以及它们如何在DisplayPowerController级使用

 Controls the power state of the display. Handles the proximity sensor, light sensor,
 and animations between states including the screen off animation. 

您可能还想查看公共布尔寄存器Listener(SensorListener侦听器,int传感器,int速率)的rate参数,如here所述

 The rate sensor events are delivered at. This is only a hint to the system. 
 Events may be received faster or slower than the specified rate. 
 Usually events are received faster. The value must be one of SENSOR_DELAY_NORMAL,
 SENSOR_DELAY_UI, SENSOR_DELAY_GAME, or SENSOR_DELAY_FASTEST or, the desired delay
 between events in microseconds. 
 Specifying the delay in microseconds only works from
 Android 2.3 (API level 9) onwards. For earlier releases, you must use one of the 
 SENSOR_DELAY_* constants.

转载注明原文:Android:设置自动亮度适应速度 - 代码日志