Decouple CentralSurfaces and NPVC
Continuing effort started in ag/20327965, this time focusing on references to CentralSurfaces in NPVC. Removes 5 more methods from the CentralSurfaces API. Bug: 249277686 Test: manual and atest Change-Id: Ib8180339413c7209e5380eebf38f430dbd9f34a1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 " +
|
||||
|
||||
@@ -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) {
|
||||
@@ -1758,7 +1764,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 */);
|
||||
@@ -3703,7 +3709,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 */,
|
||||
@@ -3746,14 +3751,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);
|
||||
}
|
||||
@@ -4779,7 +4786,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) {
|
||||
@@ -4828,9 +4834,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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 */,
|
||||
|
||||
Reference in New Issue
Block a user