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

Commit f0024860 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[SB] Remove launched flag status_bar_swipe_over_chip." into main

parents 875d5aee 0c41c185
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -390,16 +390,6 @@ flag {
  bug: "406922954"
}

flag {
    name: "status_bar_swipe_over_chip"
    namespace: "systemui"
    description: "Allow users to swipe over the status bar chip to open the shade"
    bug: "185897191"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "status_bar_always_check_underlying_networks"
    namespace: "systemui"
+1 −8
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import androidx.annotation.NonNull;

import com.android.internal.policy.SystemBarUtils;
import com.android.systemui.Dependency;
import com.android.systemui.Flags;
import com.android.systemui.Gefingerpoken;
import com.android.systemui.res.R;
import com.android.systemui.shade.ShadeExpandsOnStatusBarLongPress;
@@ -260,14 +259,8 @@ public class PhoneStatusBarView extends FrameLayout {

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (Flags.statusBarSwipeOverChip()) {
        return mTouchEventHandler.onInterceptTouchEvent(event);
        } else {
            mTouchEventHandler.onInterceptTouchEvent(event);
            return super.onInterceptTouchEvent(event);
        }
    }

    public void updateResources() {
        mCutoutSideNudge = getResources().getDimensionPixelSize(
                R.dimen.display_cutout_margin_consumption);
+0 −6
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
import androidx.annotation.VisibleForTesting
import com.android.systemui.Flags
import com.android.systemui.Gefingerpoken
import com.android.systemui.battery.BatteryMeterView
import com.android.systemui.dagger.qualifiers.DisplaySpecific
@@ -268,11 +267,6 @@ private constructor(
                dispatchEventToShadeDisplayPolicy(event)
            }

            if (!Flags.statusBarSwipeOverChip()) {
                onTouch(event)
                return false
            }

            // Let ShadeViewController intercept touch events when flexiglass is disabled.
            if (!SceneContainerFlag.isEnabled) {
                return shadeViewController.handleExternalInterceptTouch(event)
+2 −28
Original line number Diff line number Diff line
@@ -387,8 +387,7 @@ class PhoneStatusBarViewControllerTest(flags: FlagsParameterization) : SysuiTest

    @Test
    @DisableSceneContainer
    @DisableFlags(com.android.systemui.Flags.FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun handleInterceptTouchEventFromStatusBar_shadeReturnsFalse_flagOff_viewReturnsFalse() {
    fun handleInterceptTouchEventFromStatusBar_shadeReturnsFalse_viewReturnsFalse() {
        whenever(shadeViewController.handleExternalInterceptTouch(any())).thenReturn(false)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0)

@@ -399,32 +398,7 @@ class PhoneStatusBarViewControllerTest(flags: FlagsParameterization) : SysuiTest

    @Test
    @DisableSceneContainer
    @EnableFlags(com.android.systemui.Flags.FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun handleInterceptTouchEventFromStatusBar_shadeReturnsFalse_flagOn_viewReturnsFalse() {
        whenever(shadeViewController.handleExternalInterceptTouch(any())).thenReturn(false)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0)

        val returnVal = view.onInterceptTouchEvent(event)

        assertThat(returnVal).isFalse()
    }

    @Test
    @DisableSceneContainer
    @DisableFlags(com.android.systemui.Flags.FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun handleInterceptTouchEventFromStatusBar_shadeReturnsTrue_flagOff_viewReturnsFalse() {
        whenever(shadeViewController.handleExternalInterceptTouch(any())).thenReturn(true)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0)

        val returnVal = view.onInterceptTouchEvent(event)

        assertThat(returnVal).isFalse()
    }

    @Test
    @DisableSceneContainer
    @EnableFlags(com.android.systemui.Flags.FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun handleInterceptTouchEventFromStatusBar_shadeReturnsTrue_flagOn_viewReturnsTrue() {
    fun handleInterceptTouchEventFromStatusBar_shadeReturnsTrue_viewReturnsTrue() {
        whenever(shadeViewController.handleExternalInterceptTouch(any())).thenReturn(true)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0)

+3 −43
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import android.view.View
import android.view.WindowInsets
import android.widget.FrameLayout
import androidx.test.filters.SmallTest
import com.android.systemui.Flags.FLAG_STATUS_BAR_SWIPE_OVER_CHIP
import com.android.systemui.Gefingerpoken
import com.android.systemui.SysuiTestCase
import com.android.systemui.SysuiTestableContext
@@ -189,8 +188,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() {
    }

    @Test
    @DisableFlags(FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun onInterceptTouchEvent_flagOff_listenerNotified() {
    fun onInterceptTouchEvent_listenerNotified() {
        val handler = TestTouchEventHandler()
        view.setTouchEventHandler(handler)

@@ -201,32 +199,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun onInterceptTouchEvent_flagOn_listenerNotified() {
        val handler = TestTouchEventHandler()
        view.setTouchEventHandler(handler)

        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
        view.onInterceptTouchEvent(event)

        assertThat(handler.lastInterceptEvent).isEqualTo(event)
    }

    @Test
    @DisableFlags(FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun onInterceptTouchEvent_listenerReturnsFalse_flagOff_viewReturnsFalse() {
        val handler = TestTouchEventHandler()
        view.setTouchEventHandler(handler)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)

        handler.handleTouchReturnValue = false

        assertThat(view.onInterceptTouchEvent(event)).isFalse()
    }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun onInterceptTouchEvent_listenerReturnsFalse_flagOn_viewReturnsFalse() {
    fun onInterceptTouchEvent_listenerReturnsFalse_viewReturnsFalse() {
        val handler = TestTouchEventHandler()
        view.setTouchEventHandler(handler)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
@@ -237,20 +210,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() {
    }

    @Test
    @DisableFlags(FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun onInterceptTouchEvent_listenerReturnsTrue_flagOff_viewReturnsFalse() {
        val handler = TestTouchEventHandler()
        view.setTouchEventHandler(handler)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)

        handler.handleTouchReturnValue = true

        assertThat(view.onInterceptTouchEvent(event)).isFalse()
    }

    @Test
    @EnableFlags(FLAG_STATUS_BAR_SWIPE_OVER_CHIP)
    fun onInterceptTouchEvent_listenerReturnsTrue_flagOn_viewReturnsTrue() {
    fun onInterceptTouchEvent_listenerReturnsTrue_viewReturnsTrue() {
        val handler = TestTouchEventHandler()
        view.setTouchEventHandler(handler)
        val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)