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

Commit 6b311488 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Fix privacy indicators in QQS with new headers" into tm-qpr-dev

parents a7a56842 68f0db18
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Pair;
import android.view.DisplayCutout;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowInsets;
@@ -231,6 +232,16 @@ public class QuickStatusBarHeader extends FrameLayout {
        }
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // If using combined headers, only react to touches inside QuickQSPanel
        if (!mUseCombinedQSHeader || event.getY() > mHeaderQsPanel.getTop()) {
            return super.onTouchEvent(event);
        } else {
            return false;
        }
    }

    void updateResources() {
        Resources resources = mContext.getResources();
        boolean largeScreenHeaderActive =
+3 −0
Original line number Diff line number Diff line
@@ -280,6 +280,9 @@ class LargeScreenShadeHeaderController @Inject constructor(
                    context.getString(com.android.internal.R.string.status_bar_alarm_clock)
            )
        }
        if (combinedHeaders) {
            privacyIconsController.onParentVisible()
        }
    }

    override fun onViewAttached() {
+14 −0
Original line number Diff line number Diff line
@@ -645,6 +645,20 @@ class LargeScreenShadeHeaderControllerCombinedTest : SysuiTestCase() {
        verify(animator).start()
    }

    @Test
    fun privacyChipParentVisibleFromStart() {
        verify(privacyIconsController).onParentVisible()
    }

    @Test
    fun privacyChipParentVisibleAlways() {
        controller.largeScreenActive = true
        controller.largeScreenActive = false
        controller.largeScreenActive = true

        verify(privacyIconsController, never()).onParentInvisible()
    }

    private fun createWindowInsets(
        topCutout: Rect? = Rect()
    ): WindowInsets {