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

Commit e4c7b3f2 authored by Joe Onorato's avatar Joe Onorato
Browse files

Status bar: Forward the disabled state to the status bar process when it comes up.

Bug: 3108996
Change-Id: I92c2ff645dc64ca2610e3de814e0cfef6cde88c3
parent a9ad6b81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ interface IStatusBarService
    // You need the STATUS_BAR_SERVICE permission
    void registerStatusBar(IStatusBar callbacks, out StatusBarIconList iconList,
            out List<IBinder> notificationKeys, out List<StatusBarNotification> notifications,
            out boolean[] switches);
            out int[] switches);
    void onPanelRevealed();
    void onNotificationClick(String pkg, String tag, int id);
    void onNotificationError(String pkg, String tag, int id,
+9 −7
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public abstract class StatusBarService extends SystemUI implements CommandQueue.
        mCommandQueue = new CommandQueue(this, iconList);
        mBarService = IStatusBarService.Stub.asInterface(
                ServiceManager.getService(Context.STATUS_BAR_SERVICE));
        boolean[] switches = new boolean[3];
        int[] switches = new int[4];
        try {
            mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications,
                    switches);
@@ -73,9 +73,10 @@ public abstract class StatusBarService extends SystemUI implements CommandQueue.
            // If the system process isn't there we're doomed anyway.
        }

        setLightsOn(switches[0]);
        setMenuKeyVisible(switches[1]);
        setIMEButtonVisible(switches[2]);
        disable(switches[0]);
        setLightsOn(switches[1] != 0);
        setMenuKeyVisible(switches[2] != 0);
        setIMEButtonVisible(switches[3] != 0);

        // Set up the initial icon state
        int N = iconList.size();
@@ -118,9 +119,10 @@ public abstract class StatusBarService extends SystemUI implements CommandQueue.
        if (SPEW) {
            Slog.d(TAG, "Added status bar view: gravity=0x" + Integer.toHexString(lp.gravity) 
                   + " icons=" + iconList.size()
                   + " lights=" + (switches[0]?"on":"off")
                   + " menu=" + (switches[1]?"visible":"invisible")
                   + " imeButton=" + (switches[2]?"visible":"invisible")
                   + " disabled=0x" + Integer.toHexString(switches[0])
                   + " lights=" + switches[1]
                   + " menu=" + switches[2]
                   + " imeButton=" + switches[3]
                   );
        }
    }
+5 −6
Original line number Diff line number Diff line
@@ -71,9 +71,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
    Object mLock = new Object();
    // We usually call it lights out mode, but double negatives are annoying
    boolean mLightsOn = true;

    boolean mMenuVisible = false;

    boolean mIMEButtonVisible = false;

    private class DisableRecord implements IBinder.DeathRecipient {
@@ -352,7 +350,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
    // ================================================================================
    public void registerStatusBar(IStatusBar bar, StatusBarIconList iconList,
            List<IBinder> notificationKeys, List<StatusBarNotification> notifications,
            boolean switches[]) {
            int switches[]) {
        enforceStatusBarService();

        Slog.i(TAG, "registerStatusBar bar=" + bar);
@@ -367,9 +365,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub
            }
        }
        synchronized (mLock) {
            switches[0] = mLightsOn;
            switches[1] = mMenuVisible;
            switches[2] = mIMEButtonVisible;
            switches[0] = gatherDisableActionsLocked();
            switches[1] = mLightsOn ? 1 : 0;
            switches[2] = mMenuVisible ? 1 : 0;
            switches[3] = mIMEButtonVisible ? 1 : 0;
        }
    }