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

Commit 14586324 authored by nebkat's avatar nebkat
Browse files

Revert "SystemUI: Open Quick Settings panel if there are no active notifications"

This reverts commit 0031e6c3.

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Change-Id: I6981416a8aa769663f471f2a536196af7ee7e70d
parent d8ba12c5
Loading
Loading
Loading
Loading
+6 −19
Original line number Diff line number Diff line
@@ -16,12 +16,10 @@

package com.android.systemui.statusbar.phone;

import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Slog;
import android.view.MotionEvent;
@@ -94,17 +92,9 @@ public class NotificationPanelView extends PanelView {
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (PhoneStatusBar.SETTINGS_DRAG_SHORTCUT && mStatusBar.mHasFlipSettings) {
            boolean shouldFlip = false;
            ContentResolver cr = mContext.getContentResolver();

            switch (event.getActionMasked()) {
                case MotionEvent.ACTION_DOWN:
                    mOkToFlip = getExpandedHeight() == 0;
                    // If we have no notifications and the Power Widget is disabled, flip to the settings panel
                    if(mStatusBar.skipToSettingsPanel()
                            && Settings.System.getInt(cr, Settings.System.EXPANDED_VIEW_WIDGET, 0) == 0) {
                        shouldFlip = true;
                    }
                    break;
                case MotionEvent.ACTION_POINTER_DOWN:
                    if (mOkToFlip) {
@@ -116,12 +106,6 @@ public class NotificationPanelView extends PanelView {
                            if (y > maxy) maxy = y;
                        }
                        if (maxy - miny < mHandleBarHeight) {
                            shouldFlip = true;
                        }
                    }
                    break;
            }
            if(mOkToFlip && shouldFlip) {
                            if (getMeasuredHeight() < mHandleBarHeight) {
                                mStatusBar.switchToSettings();
                            } else {
@@ -130,6 +114,9 @@ public class NotificationPanelView extends PanelView {
                            mOkToFlip = false;
                        }
                    }
                    break;
            }
        }
        return mHandleView.dispatchTouchEvent(event);
    }
}
+0 −24
Original line number Diff line number Diff line
@@ -2617,30 +2617,6 @@ public class PhoneStatusBar extends BaseStatusBar {
                || (mDisabled & StatusBarManager.DISABLE_SEARCH) != 0;
    }

    public boolean skipToSettingsPanel() {
        if (mPile == null || mNotificationData == null) {
            return false;
        }

        int N = mNotificationData.size();
        for (int i = 0; i < N; i++) {
            Entry ent = mNotificationData.get(N-i-1);
            if(ent != null
                    && ent.notification != null
                    && notificationIsForCurrentUser(ent.notification)) {
                switch(ent.notification.id) {
                    // ignore adb icon
                    case com.android.internal.R.drawable.stat_sys_adb:
                        continue;
                }
                // We have at least one notification, we cannot skip
                return false;
            }
        }
        // No notifications for current user, lets skip to Settings panel
        return true;
    }

    private static class FastColorDrawable extends Drawable {
        private final int mColor;