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

Commit a24d8a3f authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix NSSL migration and falsing

Touch events were getting processed multiple times by the
FalsingManager, leading to incorrect falsing and the UI being
reset. These fixes ensure each touch gets processed once, and by the
correct owner.

Fixes: 314302258
Test: manual; observe falsing logs when swiping on shade
Flag: ACONFIG com.android.systemui.keyguard_shade_migration_nssl
DEVELOPMENT

Change-Id: I228090b917a25a7d1ac459c10f0a1d98167d435a
parent a638b238
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dump.DumpManager
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.keyguard.domain.interactor.NaturalScrollingSettingObserver
import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl
import com.android.systemui.media.controls.ui.MediaHierarchyManager
import com.android.systemui.navigationbar.gestural.Utilities.isTrackpadScroll
import com.android.systemui.plugins.ActivityStarter
@@ -888,6 +889,9 @@ class DragDownHelper(
                    isDraggingDown = false
                    isTrackpadReverseScroll = false
                    shadeRepository.setLegacyLockscreenShadeTracking(false)
                    if (KeyguardShadeMigrationNssl.isEnabled) {
                        return true
                    }
                } else {
                    stopDragging()
                    return false
+28 −11
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FeatureFlagsClassic;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository;
import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl;
import com.android.systemui.keyguard.shared.model.KeyguardState;
import com.android.systemui.keyguard.shared.model.TransitionStep;
import com.android.systemui.media.controls.ui.KeyguardMediaController;
@@ -1957,12 +1958,27 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                    mView.dispatchDownEventToScroller(ev);
                }
            }
            boolean horizontalSwipeWantsIt = false;
            boolean scrollerWantsIt = false;
            if (KeyguardShadeMigrationNssl.isEnabled()) {
                // Reverse the order relative to the else statement. onScrollTouch will reset on an
                // UP event, causing horizontalSwipeWantsIt to be set to true on vertical swipes.
                if (mLongPressedView == null && !mView.isBeingDragged()
                        && !expandingNotification
                        && !mView.getExpandedInThisMotion()
                        && !onlyScrollingInThisMotion
                        && !mView.getDisallowDismissInThisMotion()) {
                    horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev);
                }
                if (mLongPressedView == null && mView.isExpanded() && !mSwipeHelper.isSwiping()
                        && !expandingNotification && !mView.getDisallowScrollingInThisMotion()) {
                    scrollerWantsIt = mView.onScrollTouch(ev);
                }
            } else {
                if (mLongPressedView == null && mView.isExpanded() && !mSwipeHelper.isSwiping()
                        && !expandingNotification && !mView.getDisallowScrollingInThisMotion()) {
                    scrollerWantsIt = mView.onScrollTouch(ev);
                }
            boolean horizontalSwipeWantsIt = false;
                if (mLongPressedView == null && !mView.isBeingDragged()
                        && !expandingNotification
                        && !mView.getExpandedInThisMotion()
@@ -1970,6 +1986,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                        && !mView.getDisallowDismissInThisMotion()) {
                    horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev);
                }
            }

            // Check if we need to clear any snooze leavebehinds
            if (guts != null && !NotificationSwipeHelper.isTouchInView(ev, guts)