Loading services/java/com/android/server/PowerManagerService.java +20 −2 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ class PowerManagerService extends IPowerManager.Stub private final int MY_UID; private boolean mDoneBooting = false; private boolean mBootCompleted = false; private int mStayOnConditions = 0; private int[] mBroadcastQueue = new int[] { -1, -1, -1 }; private int[] mBroadcastWhy = new int[3]; Loading Loading @@ -351,6 +352,13 @@ class PowerManagerService extends IPowerManager.Stub } } private final class BootCompletedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { bootCompleted(); } } /** * Set the setting that determines whether the device stays on when plugged in. * The argument is a bit string, with each bit specifying a power source that, Loading Loading @@ -498,6 +506,9 @@ class PowerManagerService extends IPowerManager.Stub IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_BATTERY_CHANGED); mContext.registerReceiver(new BatteryReceiver(), filter); filter = new IntentFilter(); filter.addAction(Intent.ACTION_BOOT_COMPLETED); mContext.registerReceiver(new BootCompletedReceiver(), filter); // Listen for Gservices changes IntentFilter gservicesChangedFilter = Loading Loading @@ -970,7 +981,7 @@ class PowerManagerService extends IPowerManager.Stub private void setTimeoutLocked(long now, int nextState) { if (mDoneBooting) { if (mBootCompleted) { mHandler.removeCallbacks(mTimeoutTask); mTimeoutTask.nextState = nextState; long when = now; Loading Loading @@ -1385,7 +1396,7 @@ class PowerManagerService extends IPowerManager.Stub return; } if (!mDoneBooting && !mUseSoftwareAutoBrightness) { if (!mBootCompleted && !mUseSoftwareAutoBrightness) { newState |= ALL_BRIGHT; } Loading Loading @@ -2343,6 +2354,13 @@ class PowerManagerService extends IPowerManager.Stub } finally { Binder.restoreCallingIdentity(identity); } } } void bootCompleted() { Log.d(TAG, "bootCompleted"); synchronized (mLocks) { mBootCompleted = true; userActivity(SystemClock.uptimeMillis(), false, BUTTON_EVENT, true); updateWakeLockLocked(); mLocks.notifyAll(); Loading Loading
services/java/com/android/server/PowerManagerService.java +20 −2 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ class PowerManagerService extends IPowerManager.Stub private final int MY_UID; private boolean mDoneBooting = false; private boolean mBootCompleted = false; private int mStayOnConditions = 0; private int[] mBroadcastQueue = new int[] { -1, -1, -1 }; private int[] mBroadcastWhy = new int[3]; Loading Loading @@ -351,6 +352,13 @@ class PowerManagerService extends IPowerManager.Stub } } private final class BootCompletedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { bootCompleted(); } } /** * Set the setting that determines whether the device stays on when plugged in. * The argument is a bit string, with each bit specifying a power source that, Loading Loading @@ -498,6 +506,9 @@ class PowerManagerService extends IPowerManager.Stub IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_BATTERY_CHANGED); mContext.registerReceiver(new BatteryReceiver(), filter); filter = new IntentFilter(); filter.addAction(Intent.ACTION_BOOT_COMPLETED); mContext.registerReceiver(new BootCompletedReceiver(), filter); // Listen for Gservices changes IntentFilter gservicesChangedFilter = Loading Loading @@ -970,7 +981,7 @@ class PowerManagerService extends IPowerManager.Stub private void setTimeoutLocked(long now, int nextState) { if (mDoneBooting) { if (mBootCompleted) { mHandler.removeCallbacks(mTimeoutTask); mTimeoutTask.nextState = nextState; long when = now; Loading Loading @@ -1385,7 +1396,7 @@ class PowerManagerService extends IPowerManager.Stub return; } if (!mDoneBooting && !mUseSoftwareAutoBrightness) { if (!mBootCompleted && !mUseSoftwareAutoBrightness) { newState |= ALL_BRIGHT; } Loading Loading @@ -2343,6 +2354,13 @@ class PowerManagerService extends IPowerManager.Stub } finally { Binder.restoreCallingIdentity(identity); } } } void bootCompleted() { Log.d(TAG, "bootCompleted"); synchronized (mLocks) { mBootCompleted = true; userActivity(SystemClock.uptimeMillis(), false, BUTTON_EVENT, true); updateWakeLockLocked(); mLocks.notifyAll(); Loading