diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java index b69afeb373716..0c14ed5c21641 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java @@ -133,9 +133,9 @@ public class DozeLog implements Dumpable { /** * Appends fling event to the logs */ - public void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded, + public void traceFling(boolean expand, boolean aboveThreshold, boolean screenOnFromTouch) { - mLogger.logFling(expand, aboveThreshold, thresholdNeeded, screenOnFromTouch); + mLogger.logFling(expand, aboveThreshold, screenOnFromTouch); } /** diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt b/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt index 18c8e01cbf761..b5dbe21a2cf7f 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt @@ -96,13 +96,11 @@ class DozeLogger @Inject constructor( fun logFling( expand: Boolean, aboveThreshold: Boolean, - thresholdNeeded: Boolean, screenOnFromTouch: Boolean ) { buffer.log(TAG, DEBUG, { bool1 = expand bool2 = aboveThreshold - bool3 = thresholdNeeded bool4 = screenOnFromTouch }, { "Fling expand=$bool1 aboveThreshold=$bool2 thresholdNeeded=$bool3 " + diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 41e7c79e4cbd4..92dc459184524 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -177,6 +177,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ActivatableNotificationView; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; +import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.stack.AmbientState; import com.android.systemui.statusbar.notification.stack.AnimationProperties; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; @@ -253,6 +254,8 @@ public final class NotificationPanelViewController implements Dumpable { private static final int FLING_COLLAPSE = 1; /** Fling until QS is completely hidden. */ private static final int FLING_HIDE = 2; + /** The delay to reset the hint text when the hint animation is finished running. */ + private static final int HINT_RESET_DELAY_MS = 1200; private static final long ANIMATION_DELAY_ICON_FADE_IN = ActivityLaunchAnimator.TIMINGS.getTotalDuration() - CollapsedStatusBarFragment.FADE_IN_DURATION @@ -343,6 +346,7 @@ public final class NotificationPanelViewController implements Dumpable { private final FalsingTapListener mFalsingTapListener = this::falsingAdditionalTapRequired; private final FragmentListener mQsFragmentListener = new QsFragmentListener(); private final AccessibilityDelegate mAccessibilityDelegate = new ShadeAccessibilityDelegate(); + private final NotificationGutsManager mGutsManager; private long mDownTime; private boolean mTouchSlopExceededBeforeDown; @@ -701,6 +705,7 @@ public final class NotificationPanelViewController implements Dumpable { ConversationNotificationManager conversationNotificationManager, MediaHierarchyManager mediaHierarchyManager, StatusBarKeyguardViewManager statusBarKeyguardViewManager, + NotificationGutsManager gutsManager, NotificationsQSContainerController notificationsQSContainerController, NotificationStackScrollLayoutController notificationStackScrollLayoutController, KeyguardStatusViewComponent.Factory keyguardStatusViewComponentFactory, @@ -754,6 +759,7 @@ public final class NotificationPanelViewController implements Dumpable { mLockscreenGestureLogger = lockscreenGestureLogger; mShadeExpansionStateManager = shadeExpansionStateManager; mShadeLog = shadeLogger; + mGutsManager = gutsManager; mView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View v) { @@ -1766,7 +1772,7 @@ public final class NotificationPanelViewController implements Dumpable { } public void resetViews(boolean animate) { - mCentralSurfaces.getGutsManager().closeAndSaveGuts(true /* leavebehind */, true /* force */, + mGutsManager.closeAndSaveGuts(true /* leavebehind */, true /* force */, true /* controls */, -1 /* x */, -1 /* y */, true /* resetMenu */); if (animate && !isFullyCollapsed()) { animateCloseQs(true /* animateAway */); @@ -3711,7 +3717,6 @@ public final class NotificationPanelViewController implements Dumpable { private void onTrackingStopped(boolean expand) { mFalsingCollector.onTrackingStopped(); mTracking = false; - mCentralSurfaces.onTrackingStopped(expand); updatePanelExpansionAndVisibility(); if (expand) { mNotificationStackScrollLayoutController.setOverScrollAmount(0.0f, true /* onTop */, @@ -3754,14 +3759,16 @@ public final class NotificationPanelViewController implements Dumpable { @VisibleForTesting void onUnlockHintFinished() { - mCentralSurfaces.onHintFinished(); + // Delay the reset a bit so the user can read the text. + mKeyguardIndicationController.hideTransientIndicationDelayed(HINT_RESET_DELAY_MS); mScrimController.setExpansionAffectsAlpha(true); mNotificationStackScrollLayoutController.setUnlockHintRunning(false); } @VisibleForTesting void onUnlockHintStarted() { - mCentralSurfaces.onUnlockHintStarted(); + mFalsingCollector.onUnlockHintStarted(); + mKeyguardIndicationController.showActionToUnlock(); mScrimController.setExpansionAffectsAlpha(false); mNotificationStackScrollLayoutController.setUnlockHintRunning(true); } @@ -4787,7 +4794,6 @@ public final class NotificationPanelViewController implements Dumpable { } mDozeLog.traceFling(expand, mTouchAboveFalsingThreshold, - mCentralSurfaces.isFalsingThresholdNeeded(), mCentralSurfaces.isWakeUpComingFromTouch()); // Log collapse gesture if on lock screen. if (!expand && onKeyguard) { @@ -4836,9 +4842,6 @@ public final class NotificationPanelViewController implements Dumpable { */ private boolean isFalseTouch(float x, float y, @Classifier.InteractionType int interactionType) { - if (!mCentralSurfaces.isFalsingThresholdNeeded()) { - return false; - } if (mFalsingManager.isClassifierEnabled()) { return mFalsingManager.isFalseTouch(interactionType); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index bd0678fb59887..3557b4ab34f53 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -54,7 +54,6 @@ import com.android.systemui.shade.NotificationShadeWindowViewController; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.LightRevealScrim; import com.android.systemui.statusbar.NotificationPresenter; -import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import java.io.PrintWriter; @@ -254,8 +253,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn boolean isWakeUpComingFromTouch(); - boolean isFalsingThresholdNeeded(); - void onKeyguardViewManagerStatesUpdated(); ViewGroup getNotificationScrollLayout(); @@ -413,12 +410,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn void onClosingFinished(); - void onUnlockHintStarted(); - - void onHintFinished(); - - void onTrackingStopped(boolean expand); - // TODO: Figure out way to remove these. NavigationBarView getNavigationBarView(); @@ -500,8 +491,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn boolean isKeyguardSecure(); - NotificationGutsManager getGutsManager(); - void updateNotificationPanelTouchState(); void makeExpandedVisible(boolean force); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 46199613d58d9..a592da47a0d52 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -281,6 +281,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { // 1020-1040 reserved for BaseStatusBar /** + * TODO(b/249277686) delete this * The delay to reset the hint text when the hint animation is finished running. */ private static final int HINT_RESET_DELAY_MS = 1200; @@ -1802,11 +1803,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return mWakeUpComingFromTouch; } - @Override - public boolean isFalsingThresholdNeeded() { - return true; - } - /** * To be called when there's a state change in StatusBarKeyguardViewManager. */ @@ -3411,22 +3407,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } } - @Override - public void onUnlockHintStarted() { - mFalsingCollector.onUnlockHintStarted(); - mKeyguardIndicationController.showActionToUnlock(); - } - - @Override - public void onHintFinished() { - // Delay the reset a bit so the user can read the text. - mKeyguardIndicationController.hideTransientIndicationDelayed(HINT_RESET_DELAY_MS); - } - - @Override - public void onTrackingStopped(boolean expand) { - } - // TODO: Figure out way to remove these. @Override public NavigationBarView getNavigationBarView() { @@ -4157,11 +4137,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { // End Extra BaseStatusBarMethods. - @Override - public NotificationGutsManager getGutsManager() { - return mGutsManager; - } - boolean isTransientShown() { return mTransientShown; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java index aa284e09e747e..69a45599668bd 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -133,6 +133,7 @@ import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.row.ExpandableView.OnHeightChangedListener; +import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.stack.AmbientState; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationRoundnessManager; @@ -198,6 +199,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { @Mock private KeyguardBottomAreaView mQsFrame; @Mock private HeadsUpManagerPhone mHeadsUpManager; @Mock private NotificationShelfController mNotificationShelfController; + @Mock private NotificationGutsManager mGutsManager; @Mock private KeyguardStatusBarView mKeyguardStatusBar; @Mock private KeyguardUserSwitcherView mUserSwitcherView; @Mock private ViewStub mUserSwitcherStubView; @@ -453,6 +455,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, mStatusBarKeyguardViewManager, + mGutsManager, mNotificationsQSContainerController, mNotificationStackScrollLayoutController, mKeyguardStatusViewComponentFactory, @@ -754,6 +757,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { @Test public void testOnTouchEvent_expansionResumesAfterBriefTouch() { + mFalsingManager.setIsClassifierEnabled(true); + mFalsingManager.setIsFalseTouch(false); // Start shade collapse with swipe up onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */,