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
This commit is contained in:
Joe Onorato
2010-10-21 11:09:02 -04:00
parent 10e370c689
commit f3c3c4fd14
14 changed files with 280 additions and 143 deletions

View File

@@ -27,9 +27,11 @@ import dalvik.system.Zygote;
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 @@ class ServerThread extends Thread {
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 @@ class ServerThread extends Thread {
}
// 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 @@ class ServerThread extends Thread {
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 @@ class ServerThread extends Thread {
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 {