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

Commit e04505e8 authored by Amin Shaikh's avatar Amin Shaikh
Browse files

Ensure QS does not expand when qs disabled.

Remove unnecessary QSContainerImpl measure logic to constrain the
height to QQS height when QS is disabled. This interferes with
NotificationPanelView's logic for determining QS expansion.

Change-Id: I7e6659cc12dae2fbaa16d15a63c709dd96177b97
Fixes: 72739219
Test: manual
parent f921b507
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -100,16 +100,6 @@ public class QSContainerImpl extends FrameLayout {

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (mQsDisabled) {
            // Only show the status bar contents in QQS header when QS is disabled.
            mHeader.measure(widthMeasureSpec, heightMeasureSpec);
            LayoutParams layoutParams = (LayoutParams) mHeader.getLayoutParams();
            int height = layoutParams.topMargin + layoutParams.bottomMargin
                    + mHeader.getMeasuredHeight();
            super.onMeasure(
                    widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
            return;
        }
        // Since we control our own bottom, be whatever size we want.
        // Otherwise the QSPanel ends up with 0 height when the window is only the
        // size of the status bar.
@@ -139,8 +129,7 @@ public class QSContainerImpl extends FrameLayout {
        if (disabled == mQsDisabled) return;
        mQsDisabled = disabled;
        mBackgroundGradient.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
        mQSPanel.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
        mQSFooter.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
        mBackground.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
    }

    private void updateResources() {
+10 −11
Original line number Diff line number Diff line
@@ -105,6 +105,13 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks {
            mQSCustomizer.setEditLocation(x, y);
            mQSCustomizer.restoreInstanceState(savedInstanceState);
        }
        SysUiServiceProvider.getComponent(getContext(), CommandQueue.class).addCallbacks(this);
    }

    @Override
    public void onDestroyView() {
        SysUiServiceProvider.getComponent(getContext(), CommandQueue.class).removeCallbacks(this);
        super.onDestroyView();
    }

    @Override
@@ -203,15 +210,13 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks {
                : View.INVISIBLE);
        mHeader.setExpanded((mKeyguardShowing && !mHeaderAnimating)
                || (mQsExpanded && !mStackScrollerOverscrolling));
        mFooter.setVisibility((mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
        mFooter.setVisibility(
                !mQsDisabled && (mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
                ? View.VISIBLE
                : View.INVISIBLE);
        if (mQsDisabled) {
            mFooter.setVisibility(View.GONE);
        }
        mFooter.setExpanded((mKeyguardShowing && !mHeaderAnimating)
                || (mQsExpanded && !mStackScrollerOverscrolling));
        mQSPanel.setVisibility(expandVisually ? View.VISIBLE : View.INVISIBLE);
        mQSPanel.setVisibility(!mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
    }

    public QSPanel getQsPanel() {
@@ -278,12 +283,6 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks {
        mHeader.setListening(listening);
        mFooter.setListening(listening);
        mQSPanel.setListening(mListening && mQsExpanded);
        if (listening) {
            SysUiServiceProvider.getComponent(getContext(), CommandQueue.class).addCallbacks(this);
        } else {
            SysUiServiceProvider.getComponent(getContext(), CommandQueue.class)
                    .removeCallbacks(this);
        }
    }

    @Override