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

Commit 8bc6c514 authored by Joe Onorato's avatar Joe Onorato
Browse files

Require the STATUS_BAR_SERVICE permission for something to be the status bar.

Change-Id: I57b2d296e0d0cef0d256ae6697fffc47188d14df
parent 005847b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ interface IStatusBarService
    void removeIcon(String slot);

    // ---- Methods below are for use by the status bar policy services ----
    // You need the STATUS_BAR_SERVICE permission
    void registerStatusBar(IStatusBar callbacks, out StatusBarIconList iconList,
            out List<IBinder> notificationKeys, out List<StatusBarNotification> notifications);
    void visibilityChanged(boolean visible);
+7 −0
Original line number Diff line number Diff line
@@ -908,6 +908,13 @@
        android:description="@string/permdesc_statusBar"
        android:protectionLevel="signatureOrSystem" />

    <!-- Allows an application to be the status bar.  Currently used only by SystemUI.apk
    @hide -->
    <permission android:name="android.permission.STATUS_BAR_SERVICE"
        android:label="@string/permlab_statusBarService"
        android:description="@string/permdesc_statusBarService"
        android:protectionLevel="signature" />

    <!-- Allows an application to force a BACK operation on whatever is the
         top activity. -->
    <permission android:name="android.permission.FORCE_BACK"
+5 −0
Original line number Diff line number Diff line
@@ -392,6 +392,11 @@
    <string name="permdesc_statusBar">Allows application to disable
        the status bar or add and remove system icons.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_statusBarService">status bar</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_statusBarService">Allows the application to be the status bar.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_expandStatusBar">expand/collapse status bar</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
        package="com.android.systemui"
        android:sharedUserId="android.uid.system">

    <uses-permission android:name="android.permission.STATUS_BAR_SERVICE" />

    <application
        android:allowClearUserData="false"
        android:label="@string/app_label"
+8 −0
Original line number Diff line number Diff line
@@ -957,12 +957,20 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    public int prepareAddWindowLw(WindowState win, WindowManager.LayoutParams attrs) {
        switch (attrs.type) {
            case TYPE_STATUS_BAR:
                mContext.enforceCallingOrSelfPermission(
                        android.Manifest.permission.STATUS_BAR_SERVICE,
                        "PhoneWindowManager");
                // TODO: Need to handle the race condition of the status bar proc
                // dying and coming back before the removeWindowLw cleanup has happened.
                if (mStatusBar != null) {
                    return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
                }
                mStatusBar = win;
                break;
            case TYPE_STATUS_BAR_PANEL:
                mContext.enforceCallingOrSelfPermission(
                        android.Manifest.permission.STATUS_BAR_SERVICE,
                        "PhoneWindowManager");
                mStatusBarPanels.add(win);
                break;
            case TYPE_KEYGUARD:
Loading