BatteryService: Fix problems shutting down when the battery is dead:

Wait until system is booted before attempting to display the shutdown dialog.
Use ShutdownActivity rather than attempting to run ShutdownThread in the battery service.
Fix logic error (check !isPowered() instead of isPowered())

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2009-08-12 09:56:44 -04:00
parent 2ec8458c5f
commit 07a500f0de
2 changed files with 21 additions and 8 deletions

View File

@@ -84,6 +84,7 @@ class ServerThread extends Thread {
HardwareService hardware = null;
PowerManagerService power = null;
BatteryService battery = null;
IPackageManager pm = null;
Context context = null;
WindowManagerService wm = null;
@@ -132,7 +133,7 @@ class ServerThread extends Thread {
ActivityManagerService.installSystemProviders();
Log.i(TAG, "Starting Battery Service.");
BatteryService battery = new BatteryService(context);
battery = new BatteryService(context);
ServiceManager.addService("battery", battery);
Log.i(TAG, "Starting Hardware Service.");
@@ -380,6 +381,7 @@ class ServerThread extends Thread {
} catch (RemoteException e) {
}
battery.systemReady();
Watchdog.getInstance().start();
Looper.loop();