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

Commit a13eaee8 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

SystemUI: Move statusbar container object

The original ICS themeing code had the statusbar container (to rebuild
the views when switching themes) in the SystemUI service itself, since
it was the only common point between the phone and tablet bars.

JB introduced a BaseStatusBar class from which both layout types
derive, so move the container (and its initialization) there.

Additionally, explicitly make the phone statusbar view grab the input
focus when the window is expanded, to avoid missing the BACK keyevent
that makes it collapse.

Change-Id: I949bbf2087620406b1a2c91cf2ef8e91cf97bf32
parent 6bb40c7c
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -19,8 +19,6 @@ package com.android.systemui;
import java.io.FileDescriptor;
import java.io.PrintWriter;

import android.widget.FrameLayout;

import android.content.Context;
import android.content.res.Configuration;

@@ -29,8 +27,6 @@ public abstract class SystemUI {

    public abstract void start();

    public FrameLayout mStatusBarContainer;
    
    protected void onConfigurationChanged(Configuration newConfig) {
    }

+0 −3
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@ import android.os.ServiceManager;
import android.util.Slog;
import android.view.IWindowManager;

import android.widget.FrameLayout;

public class SystemUIService extends Service {
    static final String TAG = "SystemUIService";

@@ -92,7 +90,6 @@ public class SystemUIService extends Service {
                throw new RuntimeException(ex);
            }
            mServices[i].mContext = this;
            mServices[i].mStatusBarContainer = new FrameLayout(this);
            Slog.d(TAG, "running: " + mServices[i]);

            mServices[i].start();
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RemoteViews;
@@ -115,6 +116,8 @@ public abstract class BaseStatusBar extends SystemUI implements

    protected PopupMenu mNotificationBlamePopup;

    protected FrameLayout mStatusBarContainer;

    // UI-specific methods

    /**
@@ -201,6 +204,8 @@ public abstract class BaseStatusBar extends SystemUI implements
        mBarService = IStatusBarService.Stub.asInterface(
                ServiceManager.getService(Context.STATUS_BAR_SERVICE));

        mStatusBarContainer = new FrameLayout(mContext);

        mShowNotificationCounts = Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1;

+6 −0
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@ public class StatusBarWindowView extends FrameLayout
        mExpandHelper.setEventSource(this);
    }

    @Override
    public void dispatchWindowFocusChanged(boolean hasFocus) {
        this.setFocusableInTouchMode(hasFocus);
        this.requestFocus();
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        boolean down = event.getAction() == KeyEvent.ACTION_DOWN;