ConnectivityService: Do not send broadcasts until the system is ready.

Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index ad8e8921..38bf63a 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -85,6 +85,7 @@
         HardwareService hardware = null;
         PowerManagerService power = null;
         BatteryService battery = null;
+        ConnectivityService connectivity = null;
         IPackageManager pm = null;
         Context context = null;
         WindowManagerService wm = null;
@@ -231,8 +232,8 @@
 
             try {
                 Log.i(TAG, "Starting Connectivity Service.");
-                ServiceManager.addService(Context.CONNECTIVITY_SERVICE,
-                        ConnectivityService.getInstance(context));
+                connectivity = ConnectivityService.getInstance(context);
+                ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity);
             } catch (Throwable e) {
                 Log.e(TAG, "Failure starting Connectivity Service", e);
             }
@@ -384,7 +385,8 @@
         }
 
         if (wallpaper != null) wallpaper.systemReady();
-        battery.systemReady();
+        if (battery != null) battery.systemReady();
+        if (connectivity != null) connectivity.systemReady();
         Watchdog.getInstance().start();
 
         Looper.loop();