Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何通过我的应用程序到 android 设备实现自适应亮度设置。我可以在手动模式下更改亮度级别。在自动模式的情况下,我使用传感器管理器来检测环境光传感器,并根据光照条件设置亮度,并且搜索栏也应该更新。
谢谢
如果要在自动模式下更改亮度级别,则必须screen_auto_brightness_adj像这样使用未记录的常量:
screen_auto_brightness_adj
Settings.System.putFloat(contentResolver, "screen_auto_brightness_adj", value);
value是一个浮点数,必须介于 -1 和 1 之间。这将在自适应亮度模式下或多或少地调整亮度强度。
value
但请注意,由于它是一个未记录且非公开的常量,Google 将来可能会更改此值,因此它可能会导致您的代码崩溃或无法按预期工作。