Commit 3c413ef3 authored by xujialang's avatar xujialang

亮屏时间

parent c6fa5509
...@@ -497,14 +497,18 @@ public final class OutHelp implements KPListener { ...@@ -497,14 +497,18 @@ public final class OutHelp implements KPListener {
} }
} }
@SuppressLint("InvalidWakeLockTag")
public void wakeOn() { public void wakeOn() {
PowerManager.WakeLock mWakelock = null;
try { try {
PowerManager pm = (PowerManager) mContext.getSystemService(POWER_SERVICE); PowerManager pm = (PowerManager) mContext.getSystemService(POWER_SERVICE);
@SuppressLint("InvalidWakeLockTag") mWakelock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "target");
PowerManager.WakeLock mWakelock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "target"); mWakelock.acquire(60 * 1000L);
mWakelock.acquire(); } catch (Exception ignored) {
if (mWakelock != null) {
mWakelock.release(); mWakelock.release();
}catch (Exception ignored){} }
}
} }
public void setShowLock(boolean showLock) { 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