diff options
author | Joe Onorato <joeo@android.com> | 2010-06-07 11:12:11 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-06-09 14:33:29 -0700 |
commit | 9e875fcb55dad6795e823207693c5ca877941d3e (patch) | |
tree | f5044c92c2660ac12b276a9c6937d9b727c86e91 | |
parent | 8bc6c5141974dbc36a6fe416853f558921be9f24 (diff) | |
download | frameworks_base-9e875fcb55dad6795e823207693c5ca877941d3e.zip frameworks_base-9e875fcb55dad6795e823207693c5ca877941d3e.tar.gz frameworks_base-9e875fcb55dad6795e823207693c5ca877941d3e.tar.bz2 |
Start the status bar service based on a configuration option, instead of trampolining through
a braodcast receiver.
Change-Id: I6ae0740fea07350b80c35c0ee2d938e0364d773e
4 files changed, 11 insertions, 51 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 1946388..a50a3b1 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -20,6 +20,10 @@ <!-- These resources are around just to allow their values to be customized for different hardware and product builds. --> <resources> + <!-- Component to be used as the status bar service. Must implement the IStatusBar + interface. This name is in the ComponentName flattened format (package/class) --> + <string name="config_statusBarComponent">com.android.systemui/com.android.systemui.statusbar.PhoneStatusBarService</string> + <!-- Flag indicating whether the surface flinger has limited alpha compositing functionality in hardware. If set, the window manager will disable alpha trasformation in animations where not diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index d8e05bb..74d87ba 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -9,13 +9,6 @@ android:label="@string/app_label" android:icon="@drawable/ic_launcher_settings"> - <receiver - android:name=".statusbar.StatusBarStarter" - > - <intent-filter> - <action android:name="com.android.internal.policy.statusbar.START" /> - </intent-filter> - </receiver> <service android:name=".statusbar.PhoneStatusBarService" android:exported="false" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStarter.java deleted file mode 100644 index 2b9dfb0..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStarter.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar; - -import android.content.Context; -import android.content.Intent; -import android.content.BroadcastReceiver; -import android.util.Log; - -/** - * Receive a broadcast from the StatusBarManagerService at boot time, and - * kick off the StatusBarService. - */ -public class StatusBarStarter extends BroadcastReceiver { - private static final String TAG = "StatusBarStarter"; - - @Override - public void onReceive(Context context, Intent intent) { - Log.d(TAG, "StatusBarStarter onReceive intent=" + intent); - context.startService(new Intent(context, PhoneStatusBarService.class)); - } -} - - diff --git a/services/java/com/android/server/status/StatusBarManagerService.java b/services/java/com/android/server/status/StatusBarManagerService.java index 198e363..1021902 100644 --- a/services/java/com/android/server/status/StatusBarManagerService.java +++ b/services/java/com/android/server/status/StatusBarManagerService.java @@ -19,6 +19,7 @@ package com.android.server.status; import android.app.PendingIntent; import android.app.StatusBarManager; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -55,9 +56,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub static final String TAG = "StatusBarManagerService"; static final boolean SPEW = true; - public static final String ACTION_STATUSBAR_START - = "com.android.internal.policy.statusbar.START"; - final Context mContext; Handler mHandler = new Handler(); NotificationCallbacks mNotificationCallbacks; @@ -112,9 +110,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub } public void systemReady2() { - // Start the status bar app - Intent intent = new Intent(ACTION_STATUSBAR_START); - mContext.sendBroadcast(intent /** permission **/); + ComponentName cn = ComponentName.unflattenFromString( + mContext.getString(com.android.internal.R.string.config_statusBarComponent)); + Intent intent = new Intent(); + intent.setComponent(cn); + Slog.i(TAG, "Starting service: " + cn); + mContext.startService(intent); } // ================================================================================ |