点亮屏幕

来源:互联网 发布:费正清 剑桥中国史知乎 编辑:程序博客网 时间:2024/04/29 23:45
    private static void lightUpTheScreen(Context context){
        if(wl ==null){
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
                 wl = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP|PowerManager.SCREEN_BRIGHT_WAKE_LOCK,
                                            "MMS PushReceiver");
   wl.setReferenceCounted(true);
            wl.acquire(15000l);
   }else{
       wl.setReferenceCounted(true);
                wl.acquire(15000l);
   }
    }
0 0
原创粉丝点击