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

Commit 222cbd17 authored by Justin Weir's avatar Justin Weir Committed by Android (Google) Code Review
Browse files

Merge "Decouple CentralSurfaces and NPVC" into tm-qpr-dev

parents c3de1864 f6110df7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
    }

    /**
+0 −2
Original line number Diff line number Diff line
@@ -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 " +
+11 −8
Original line number Diff line number Diff line
@@ -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);
        }
+0 −11
Original line number Diff line number Diff line
@@ -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);
+1 −26
Original line number Diff line number Diff line
@@ -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;
    }
Loading