Brightness Screen Filter

后端 未结 4 1627
暖寄归人
暖寄归人 2020-12-07 15:54

Does anyone have an idea how to implement an Brightness Screen Filter like the one here:

http://www.appbrain.com/app/screen-filter/com.haxor

I need a startin

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 16:29

    Of course you can't use this is production code, but if you are playing around .. try this Undocumented hack

    It uses :

    private void setBrightness(int brightness) {
    try {
      IHardwareService hardware = IHardwareService.Stub.asInterface(
       ServiceManager.getService("hardware"));
      if (hardware != null) {
        hardware.setScreenBacklight(brightness);
      }
     } catch (RemoteException doe) {          
      }        
     }
    

    Remember that it uses this permission :

     
    

提交回复
热议问题