Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e875fcb authored by Joe Onorato's avatar Joe Onorato
Browse files

Start the status bar service based on a configuration option, instead of trampolining through

a braodcast receiver.

Change-Id: I6ae0740fea07350b80c35c0ee2d938e0364d773e
parent 8bc6c514
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+0 −7
Original line number Diff line number Diff line
@@ -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"
+0 −38
Original line number Diff line number Diff line
/*
 * 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));
    }
}

+7 −6
Original line number Diff line number Diff line
@@ -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);
    }

    // ================================================================================