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

Commit 6f6cf3c5 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Reimplement StatusBarManager.disable(DISABLE_SYSTEM_INFO).

Bug: 3284968
Change-Id: I7171b7770c2972bb56672a771c7ed5ca10fb4dda
parent 6a4d0a6a
Loading
Loading
Loading
Loading
+5 −20
Original line number Diff line number Diff line
@@ -393,7 +393,6 @@ public class TabletStatusBar extends StatusBar {

        // set the initial view visibility
        setAreThereNotifications();
        refreshNotificationTrigger();

        // Add the windows
        addPanelWindows();
@@ -505,23 +504,6 @@ public class TabletStatusBar extends StatusBar {
        }
    }

    public void refreshNotificationTrigger() {
        /*
        if (mNotificationTrigger == null) return;

        int resId;
        boolean panel = (mNotificationPanel != null && mNotificationPanel.isShowing();
        if (!mNotificationsOn) {
            resId = R.drawable.ic_sysbar_noti_dnd;
        } else if (mNotns.size() > 0) {
            resId = panel ? R.drawable.ic_sysbar_noti_avail_open : R.drawable.ic_sysbar_noti_avail;
        } else {
            resId = panel ? R.drawable.ic_sysbar_noti_none_open : R.drawable.ic_sysbar_noti_none;
        }
        //mNotificationTrigger.setImageResource(resId);
        */
    }

    public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) {
        if (DEBUG) Slog.d(TAG, "addIcon(" + slot + ") -> " + icon);
    }
@@ -669,6 +651,11 @@ public class TabletStatusBar extends StatusBar {
            Slog.d(TAG, "DISABLE_CLOCK: " + (show ? "no" : "yes"));
            showClock(show);
        }
        if ((diff & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) {
            boolean show = (state & StatusBarManager.DISABLE_SYSTEM_INFO) == 0;
            Slog.d(TAG, "DISABLE_SYSTEM_INFO: " + (show ? "no" : "yes"));
            mNotificationTrigger.setVisibility(show ? View.VISIBLE : View.GONE);
        }
        if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
            if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
                Slog.d(TAG, "DISABLE_EXPAND: yes");
@@ -820,7 +807,6 @@ public class TabletStatusBar extends StatusBar {
            if (!mNotificationsOn) {
                mNotificationsOn = true;
                mIconLayout.setVisibility(View.VISIBLE); // TODO: animation
                refreshNotificationTrigger();
            } else {
                int msg = !mNotificationPanel.isShowing()
                    ? MSG_OPEN_NOTIFICATION_PANEL
@@ -1068,7 +1054,6 @@ public class TabletStatusBar extends StatusBar {
        }

        loadNotificationPanel();
        refreshNotificationTrigger();
    }

    private void loadNotificationPanel() {
+5 −0
Original line number Diff line number Diff line
@@ -178,6 +178,11 @@ public class StatusBarTest extends TestActivity
                mStatusBarManager.disable(StatusBarManager.DISABLE_CLOCK);
            }
        },
        new Test("Disable System Info") {
            public void run() {
                mStatusBarManager.disable(StatusBarManager.DISABLE_SYSTEM_INFO);
            }
        },
        new Test("Disable everything in 3 sec") {
            public void run() {
                mHandler.postDelayed(new Runnable() {