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

Commit c2436b23 authored by Joe Onorato's avatar Joe Onorato Committed by Android Git Automerger
Browse files

am 94c98c0e: PhoneStatusBarService

parents 47e4aa80 94c98c0e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
            </intent-filter>
        </receiver>
        <service
            android:name="StatusBarService"
            android:name="PhoneStatusBarService"
            android:exported="false"
            />
    </application>
+58 −0
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.policy.statusbar.phone;

import android.app.Service;
import android.app.IStatusBar;
import android.app.IStatusBarService;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;

public class PhoneStatusBarService extends StatusBarService {

    @Override
    protected void addStatusBarView() {
        final View view = new View(this);

        // TODO final StatusBarView view = mStatusBarView;
        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                view.getContext().getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.status_bar_height),
                WindowManager.LayoutParams.TYPE_STATUS_BAR,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|
                WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING,
                PixelFormat.RGB_888);
        lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
        lp.setTitle("StatusBar");
        // TODO lp.windowAnimations = R.style.Animation_StatusBar;

        WindowManagerImpl.getDefault().addView(view, lp);
    }
}
+5 −22
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;

public class StatusBarService extends Service {
public abstract class StatusBarService extends Service {
    private static final String TAG = "StatusBarService";

    Bar mBar = new Bar();
@@ -71,26 +71,9 @@ public class StatusBarService extends Service {
    class Bar extends IStatusBar.Stub {
    }

    // ================================================================================
    // Constructing the view
    // ================================================================================
    private void addStatusBarView() {
        final View view = new View(this);

        // TODO final StatusBarView view = mStatusBarView;
        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                view.getContext().getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.status_bar_height),
                WindowManager.LayoutParams.TYPE_STATUS_BAR,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|
                WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING,
                PixelFormat.RGB_888);
        lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
        lp.setTitle("StatusBar");
        // TODO lp.windowAnimations = R.style.Animation_StatusBar;

        WindowManagerImpl.getDefault().addView(view, lp);
    }
    /**
     * Implement this to add the main status bar view.
     */
    protected abstract void addStatusBarView();
}