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

Commit 35bbd3b2 authored by amehfooz's avatar amehfooz Committed by Ahmed Mehfooz
Browse files

Rename StatusBarTouchableRegionManager

Renaming to ShadeTouchableRegionManager to bring
it inline with its actual function.
The class manages the touchable region for the
shade.
FLAG: EXEMPT renaming file
Bug: b/380134385
Change-Id: Ibd3ecb4bfe5099f7f1012fcab754be59caa9c37d
parent a1b451e3
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -178,7 +178,7 @@ import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.phone.ShadeTouchableRegionManager;
import com.android.systemui.statusbar.phone.TapAgainViewController;
import com.android.systemui.statusbar.phone.TapAgainViewController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.CastController;
@@ -245,7 +245,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected NotificationPanelView mView;
    @Mock protected NotificationPanelView mView;
    @Mock protected LayoutInflater mLayoutInflater;
    @Mock protected LayoutInflater mLayoutInflater;
    @Mock protected DynamicPrivacyController mDynamicPrivacyController;
    @Mock protected DynamicPrivacyController mDynamicPrivacyController;
    @Mock protected StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    @Mock protected ShadeTouchableRegionManager mShadeTouchableRegionManager;
    @Mock protected KeyguardStateController mKeyguardStateController;
    @Mock protected KeyguardStateController mKeyguardStateController;
    @Mock protected DozeLog mDozeLog;
    @Mock protected DozeLog mDozeLog;
    private final ShadeLogger mShadeLog = new ShadeLogger(logcatLogBuffer());
    private final ShadeLogger mShadeLog = new ShadeLogger(logcatLogBuffer());
@@ -703,7 +703,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                mMetricsLogger,
                mMetricsLogger,
                mShadeLog,
                mShadeLog,
                mConfigurationController,
                mConfigurationController,
                () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager,
                () -> flingAnimationUtilsBuilder, mShadeTouchableRegionManager,
                mConversationNotificationManager, mMediaHierarchyManager,
                mConversationNotificationManager, mMediaHierarchyManager,
                mStatusBarKeyguardViewManager,
                mStatusBarKeyguardViewManager,
                mGutsManager,
                mGutsManager,
@@ -819,7 +819,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                mLockscreenShadeTransitionController,
                mLockscreenShadeTransitionController,
                mNotificationShadeDepthController,
                mNotificationShadeDepthController,
                mShadeHeaderController,
                mShadeHeaderController,
                mStatusBarTouchableRegionManager,
                mShadeTouchableRegionManager,
                () -> mStatusBarLongPressGestureDetector,
                () -> mStatusBarLongPressGestureDetector,
                mKeyguardStateController,
                mKeyguardStateController,
                mKeyguardBypassController,
                mKeyguardBypassController,
+3 −3
Original line number Original line Diff line number Diff line
@@ -71,8 +71,8 @@ import com.android.systemui.statusbar.phone.KeyguardStatusBarView;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ShadeTouchableRegionManager;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
@@ -125,7 +125,7 @@ public class QuickSettingsControllerImplBaseTest extends SysuiTestCase {
    @Mock protected LockscreenShadeTransitionController mLockscreenShadeTransitionController;
    @Mock protected LockscreenShadeTransitionController mLockscreenShadeTransitionController;
    @Mock protected NotificationShadeDepthController mNotificationShadeDepthController;
    @Mock protected NotificationShadeDepthController mNotificationShadeDepthController;
    @Mock protected ShadeHeaderController mShadeHeaderController;
    @Mock protected ShadeHeaderController mShadeHeaderController;
    @Mock protected StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    @Mock protected ShadeTouchableRegionManager mShadeTouchableRegionManager;
    @Mock protected StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector;
    @Mock protected StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector;
    @Mock protected DozeParameters mDozeParameters;
    @Mock protected DozeParameters mDozeParameters;
    @Mock protected KeyguardStateController mKeyguardStateController;
    @Mock protected KeyguardStateController mKeyguardStateController;
@@ -250,7 +250,7 @@ public class QuickSettingsControllerImplBaseTest extends SysuiTestCase {
                mLockscreenShadeTransitionController,
                mLockscreenShadeTransitionController,
                mNotificationShadeDepthController,
                mNotificationShadeDepthController,
                mShadeHeaderController,
                mShadeHeaderController,
                mStatusBarTouchableRegionManager,
                mShadeTouchableRegionManager,
                () -> mStatusBarLongPressGestureDetector,
                () -> mStatusBarLongPressGestureDetector,
                mKeyguardStateController,
                mKeyguardStateController,
                mKeyguardBypassController,
                mKeyguardBypassController,
+2 −2
Original line number Original line Diff line number Diff line
@@ -41,12 +41,12 @@ import org.junit.runner.RunWith
@SmallTest
@SmallTest
@RunWith(AndroidJUnit4::class)
@RunWith(AndroidJUnit4::class)
@OptIn(ExperimentalCoroutinesApi::class)
@OptIn(ExperimentalCoroutinesApi::class)
class StatusBarTouchableRegionManagerTest : SysuiTestCase() {
class ShadeTouchableRegionManagerTest : SysuiTestCase() {
    private val kosmos = testKosmos()
    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
    private val testScope = kosmos.testScope
    private val sceneRepository = kosmos.sceneContainerRepository
    private val sceneRepository = kosmos.sceneContainerRepository


    private val underTest by Lazy { kosmos.statusBarTouchableRegionManager }
    private val underTest by Lazy { kosmos.shadeTouchableRegionManager }


    @Test
    @Test
    @EnableSceneContainer
    @EnableSceneContainer
+5 −5
Original line number Original line Diff line number Diff line
@@ -219,8 +219,8 @@ import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ShadeTouchableRegionManager;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.phone.TapAgainViewController;
import com.android.systemui.statusbar.phone.TapAgainViewController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController;
@@ -298,7 +298,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
     * The minimum scale to "squish" the Shade and associated elements down to, for Back gesture
     * The minimum scale to "squish" the Shade and associated elements down to, for Back gesture
     */
     */
    public static final float SHADE_BACK_ANIM_MIN_SCALE = 0.9f;
    public static final float SHADE_BACK_ANIM_MIN_SCALE = 0.9f;
    private final StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    private final ShadeTouchableRegionManager mShadeTouchableRegionManager;
    private final Resources mResources;
    private final Resources mResources;
    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardStateController mKeyguardStateController;
    private final SysuiStatusBarStateController mStatusBarStateController;
    private final SysuiStatusBarStateController mStatusBarStateController;
@@ -695,7 +695,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            ShadeLogger shadeLogger,
            ShadeLogger shadeLogger,
            @ShadeDisplayAware ConfigurationController configurationController,
            @ShadeDisplayAware ConfigurationController configurationController,
            Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder,
            Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder,
            StatusBarTouchableRegionManager statusBarTouchableRegionManager,
            ShadeTouchableRegionManager shadeTouchableRegionManager,
            ConversationNotificationManager conversationNotificationManager,
            ConversationNotificationManager conversationNotificationManager,
            MediaHierarchyManager mediaHierarchyManager,
            MediaHierarchyManager mediaHierarchyManager,
            StatusBarKeyguardViewManager statusBarKeyguardViewManager,
            StatusBarKeyguardViewManager statusBarKeyguardViewManager,
@@ -840,7 +840,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mVibratorHelper = vibratorHelper;
        mVibratorHelper = vibratorHelper;
        mMSDLPlayer = msdlPlayer;
        mMSDLPlayer = msdlPlayer;
        mVibrateOnOpening = mResources.getBoolean(R.bool.config_vibrateOnIconAnimation);
        mVibrateOnOpening = mResources.getBoolean(R.bool.config_vibrateOnIconAnimation);
        mStatusBarTouchableRegionManager = statusBarTouchableRegionManager;
        mShadeTouchableRegionManager = shadeTouchableRegionManager;
        mSystemClock = systemClock;
        mSystemClock = systemClock;
        mKeyguardMediaController = keyguardMediaController;
        mKeyguardMediaController = keyguardMediaController;
        mMetricsLogger = metricsLogger;
        mMetricsLogger = metricsLogger;
@@ -1551,7 +1551,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump


    private Rect calculateGestureExclusionRect() {
    private Rect calculateGestureExclusionRect() {
        Rect exclusionRect = null;
        Rect exclusionRect = null;
        Region touchableRegion = mStatusBarTouchableRegionManager.calculateTouchableRegion();
        Region touchableRegion = mShadeTouchableRegionManager.calculateTouchableRegion();
        if (isFullyCollapsed() && touchableRegion != null) {
        if (isFullyCollapsed() && touchableRegion != null) {
            // Note: The manager also calculates the non-pinned touchable region
            // Note: The manager also calculates the non-pinned touchable region
            exclusionRect = touchableRegion.getBounds();
            exclusionRect = touchableRegion.getBounds();
+5 −5
Original line number Original line Diff line number Diff line
@@ -98,7 +98,7 @@ import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.phone.ShadeTouchableRegionManager;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.statusbar.policy.SplitShadeStateController;
@@ -141,7 +141,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
    private final LockscreenShadeTransitionController mLockscreenShadeTransitionController;
    private final LockscreenShadeTransitionController mLockscreenShadeTransitionController;
    private final NotificationShadeDepthController mDepthController;
    private final NotificationShadeDepthController mDepthController;
    private final ShadeHeaderController mShadeHeaderController;
    private final ShadeHeaderController mShadeHeaderController;
    private final StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    private final ShadeTouchableRegionManager mShadeTouchableRegionManager;
    private final Provider<StatusBarLongPressGestureDetector> mStatusBarLongPressGestureDetector;
    private final Provider<StatusBarLongPressGestureDetector> mStatusBarLongPressGestureDetector;
    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardBypassController mKeyguardBypassController;
    private final KeyguardBypassController mKeyguardBypassController;
@@ -317,7 +317,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
            LockscreenShadeTransitionController lockscreenShadeTransitionController,
            LockscreenShadeTransitionController lockscreenShadeTransitionController,
            NotificationShadeDepthController notificationShadeDepthController,
            NotificationShadeDepthController notificationShadeDepthController,
            ShadeHeaderController shadeHeaderController,
            ShadeHeaderController shadeHeaderController,
            StatusBarTouchableRegionManager statusBarTouchableRegionManager,
            ShadeTouchableRegionManager shadeTouchableRegionManager,
            Provider<StatusBarLongPressGestureDetector> statusBarLongPressGestureDetector,
            Provider<StatusBarLongPressGestureDetector> statusBarLongPressGestureDetector,
            KeyguardStateController keyguardStateController,
            KeyguardStateController keyguardStateController,
            KeyguardBypassController keyguardBypassController,
            KeyguardBypassController keyguardBypassController,
@@ -366,7 +366,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
        mLockscreenShadeTransitionController = lockscreenShadeTransitionController;
        mLockscreenShadeTransitionController = lockscreenShadeTransitionController;
        mDepthController = notificationShadeDepthController;
        mDepthController = notificationShadeDepthController;
        mShadeHeaderController = shadeHeaderController;
        mShadeHeaderController = shadeHeaderController;
        mStatusBarTouchableRegionManager = statusBarTouchableRegionManager;
        mShadeTouchableRegionManager = shadeTouchableRegionManager;
        mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector;
        mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector;
        mKeyguardStateController = keyguardStateController;
        mKeyguardStateController = keyguardStateController;
        mKeyguardBypassController = keyguardBypassController;
        mKeyguardBypassController = keyguardBypassController;
@@ -695,7 +695,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
                /* right= */ (int) mQsFrame.getX() + mQsFrame.getWidth(),
                /* right= */ (int) mQsFrame.getX() + mQsFrame.getWidth(),
                /* bottom= */ headerBottom + frameTop);
                /* bottom= */ headerBottom + frameTop);
        // Also allow QS to intercept if the touch is near the notch.
        // Also allow QS to intercept if the touch is near the notch.
        mStatusBarTouchableRegionManager.updateRegionForNotch(mInterceptRegion);
        mShadeTouchableRegionManager.updateRegionForNotch(mInterceptRegion);
        final boolean onHeader = mInterceptRegion.contains((int) x, (int) y);
        final boolean onHeader = mInterceptRegion.contains((int) x, (int) y);


        if (getExpanded()) {
        if (getExpanded()) {
Loading