Refactor SystemUI so the status bar isn't a Service of its own.
There is now one SystemUIService, which starts the status bar service.
Pretty soon there will be other things running in here too. This way
we don't need to have each of them started by something individually.
This also moves the choice between tablet and phone status bar into
SystemUI.apk, which seems like a much better place for it.
Change-Id: Ib69ef2f43d648764f8dbb52008f5d036a1ee07d9
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index ec12e80..46797c5 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -27,9 +27,11 @@
import android.accounts.AccountManagerService;
import android.app.ActivityManagerNative;
import android.bluetooth.BluetoothAdapter;
+import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentService;
import android.content.Context;
+import android.content.Intent;
import android.content.pm.IPackageManager;
import android.content.res.Configuration;
import android.database.ContentObserver;
@@ -502,9 +504,6 @@
notification.systemReady();
}
- if (statusBar != null) {
- statusBar.systemReady();
- }
wm.systemReady();
// Update the configuration for this context by hand, because we're going
@@ -523,7 +522,7 @@
}
// These are needed to propagate to the runnable below.
- final StatusBarManagerService statusBarF = statusBar;
+ final Context contextF = context;
final BatteryService batteryF = battery;
final ConnectivityService connectivityF = connectivity;
final DockObserver dockF = dock;
@@ -548,7 +547,7 @@
public void run() {
Slog.i(TAG, "Making services ready");
- if (statusBarF != null) statusBarF.systemReady2();
+ startSystemUi(contextF);
if (batteryF != null) batteryF.systemReady();
if (connectivityF != null) connectivityF.systemReady();
if (dockF != null) dockF.systemReady();
@@ -578,6 +577,14 @@
Looper.loop();
Slog.d(TAG, "System ServerThread is exiting!");
}
+
+ static final void startSystemUi(Context context) {
+ Intent intent = new Intent();
+ intent.setComponent(new ComponentName("com.android.systemui",
+ "com.android.systemui.SystemUIService"));
+ Slog.d(TAG, "Starting service: " + intent);
+ context.startService(intent);
+ }
}
public class SystemServer {