如何调暗屏幕为零而不F​​LAG_KEEP_SCREEN_ON发生冲突 [英] How to dim screen to zero without conflicting with FLAG_KEEP_SCREEN_ON

查看:283
本文介绍了如何调暗屏幕为零而不F​​LAG_KEEP_SCREEN_ON发生冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了几个方法来调暗屏幕,但我不确定他们在演唱会上如何与<一个href="http://stackoverflow.com/questions/2131948/force-screen-on/2134602#2134602">FLAG_KEEP_SCREEN_ON:

I found several methods to dim the screen but I am unsure how they work in concert with FLAG_KEEP_SCREEN_ON:

  • <一个href="http://stackoverflow.com/questions/3496806/what-is-the-proper-way-to-dim-the-screen">Settings.System.SCREEN_BRIGHTNESS
  • <一个href="http://stackoverflow.com/questions/3496806/what-is-the-proper-way-to-dim-the-screen">IHardwareService.setScreenBacklight()
  • <一个href="http://stackoverflow.com/questions/3496806/what-is-the-proper-way-to-dim-the-screen/5287368#5287368">WindowManager.LayoutParams.screenBrightness
  • Settings.System.SCREEN_BRIGHTNESS
  • IHardwareService.setScreenBacklight()
  • WindowManager.LayoutParams.screenBrightness

这上面的方法将保持在屏幕上,即使我将亮度设置为 0.0

Which of the above methods will keep the screen on, even if I set brightness to 0.0?

推荐答案

没有什么会可靠地工作。如果亮度设为0某些设备上,将关闭屏幕(但该设备将处于一个有趣的状态约5秒左右才真正意识到它的关闭,充当这样的)。一些设备将是上,但黑色

Nothing will work reliably. If you set the brightness to 0 on some devices it will turn off the screen (but the device will be in a funny state for about 5 seconds or so before really realizing it's off and acting as such). Some devices it will be on but black.

IIRC LayoutParams.screenBrightness其值小于30是不可靠的,因为它可能会关闭显示屏。

IIRC LayoutParams.screenBrightness with a value less than 30 is unreliable in that it might turn off the display.

在一个AMOLED器件的全屏幕的全黑将没有背光。但SLCD一定会的。同时在Android 3.0,你不能有一个全屏幕的系统栏始终可见。

On an AMOLED device a full screen that's all black will not have backlight. But SLCD definitely will. Also on Android 3.0 you can't have a full screen as the system bar is always visible.

这篇关于如何调暗屏幕为零而不F​​LAG_KEEP_SCREEN_ON发生冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆