Commit 3c413ef3 authored by xujialang's avatar xujialang

亮屏时间

parent c6fa5509
......@@ -497,14 +497,18 @@ public final class OutHelp implements KPListener {
}
}
@SuppressLint("InvalidWakeLockTag")
public void wakeOn() {
PowerManager.WakeLock mWakelock = null;
try {
PowerManager pm = (PowerManager) mContext.getSystemService(POWER_SERVICE);
@SuppressLint("InvalidWakeLockTag")
PowerManager.WakeLock mWakelock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "target");
mWakelock.acquire();
mWakelock.release();
}catch (Exception ignored){}
mWakelock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "target");
mWakelock.acquire(60 * 1000L);
} catch (Exception ignored) {
if (mWakelock != null) {
mWakelock.release();
}
}
}
public void setShowLock(boolean showLock) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment