某些项目中需要系统不进入休眠。
修改如下:
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java index cd20a9bc..a3b48cda 100644 --- a/services/java/com/android/server/power/PowerManagerService.java +++ b/services/java/com/android/server/power/PowerManagerService.java @@ -1065,11 +1065,13 @@ public final class PowerManagerService extends IPowerManager.Stub } private void wakeUpInternal(long eventTime) { + /* synchronized (mLock) { if (wakeUpNoUpdateLocked(eventTime)) { updatePowerStateLocked(); } } + */ } private boolean wakeUpNoUpdateLocked(long eventTime) { @@ -1135,11 +1137,13 @@ public final class PowerManagerService extends IPowerManager.Stub } private void goToSleepInternal(long eventTime, int reason) { + /* synchronized (mLock) { if (goToSleepNoUpdateLocked(eventTime, reason)) { updatePowerStateLocked(); } } + */ } @SuppressWarnings("deprecation") @@ -1949,15 +1953,15 @@ public final class PowerManagerService extends IPowerManager.Stub //SPRD:added by debug begin Slog.d(TAG, "updateSuspendBlockerLocked goto release:" + mWakeLockSuspendBlocker); //SPRD:added by debug end - mWakeLockSuspendBlocker.release(); - mHoldingWakeLockSuspendBlocker = false; + // mWakeLockSuspendBlocker.release(); + // mHoldingWakeLockSuspendBlocker = false; } if (!needDisplaySuspendBlocker && mHoldingDisplaySuspendBlocker) { //SPRD:added by debug begin Slog.d(TAG, "updateSuspendBlockerLocked goto release:" + mDisplaySuspendBlocker); //SPRD:added by debug end - mDisplaySuspendBlocker.release(); - mHoldingDisplaySuspendBlocker = false; + // mDisplaySuspendBlocker.release(); + // mHoldingDisplaySuspendBlocker = false; } }