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

Commit ca7fbaac authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "Revert "[CS] Make NPVC and QuickSettingsController singletons."" into udc-qpr-dev

parents 4d27c8d1 d5fb4ee3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ constructor(
        // At startup, 2 views with the ID `R.id.keyguard_indication_area` will be available.
        // Disable one of them
        if (featureFlags.isEnabled(Flags.MIGRATE_INDICATION_AREA)) {
            legacyParent.findViewById<View>(R.id.keyguard_indication_area)?.let {
            legacyParent.requireViewById<View>(R.id.keyguard_indication_area).let {
                legacyParent.removeView(it)
            }
        } else {
+23 −14
Original line number Diff line number Diff line
@@ -117,7 +117,6 @@ import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants;
import com.android.systemui.classifier.Classifier;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.doze.DozeLog;
@@ -209,6 +208,7 @@ 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.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController;
@@ -238,7 +238,7 @@ import kotlin.Unit;

import kotlinx.coroutines.CoroutineDispatcher;

@SysUISingleton
@CentralSurfacesComponent.CentralSurfacesScope
public final class NotificationPanelViewController implements ShadeSurface, Dumpable {

    public static final String TAG = NotificationPanelView.class.getSimpleName();
@@ -1407,13 +1407,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mKeyguardBottomArea = keyguardBottomArea;
    }

    @Override
    public void setOpenCloseListener(OpenCloseListener openCloseListener) {
    void setOpenCloseListener(OpenCloseListener openCloseListener) {
        mOpenCloseListener = openCloseListener;
    }

    @Override
    public void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) {
    void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) {
        mTrackingStartedListener = trackingStartedListener;
    }

@@ -3380,13 +3378,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        ViewGroupFadeHelper.reset(mView);
    }

    @Override
    public void addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
    void addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
        mView.getViewTreeObserver().addOnGlobalLayoutListener(listener);
    }

    @Override
    public void removeOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
    void removeOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
        mView.getViewTreeObserver().removeOnGlobalLayoutListener(listener);
    }

@@ -3856,8 +3852,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        return !isFullyCollapsed() && !mTracking && !mClosing;
    }

    @Override
    public void instantCollapse() {
    /** Collapses the shade instantly without animation. */
    void instantCollapse() {
        abortAnimations();
        setExpandedFraction(0f);
        if (mExpanding) {
@@ -4030,8 +4026,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mFixedDuration = NO_FIXED_DURATION;
    }

    @Override
    public boolean postToView(Runnable action) {
    /** */
    boolean postToView(Runnable action) {
        return mView.post(action);
    }

@@ -5126,5 +5122,18 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            return super.performAccessibilityAction(host, action, args);
        }
    }

    /** Listens for when touch tracking begins. */
    interface TrackingStartedListener {
        void onTrackingStarted();
    }

    /** Listens for when shade begins opening of finishes closing. */
    interface OpenCloseListener {
        /** Called when the shade finishes closing. */
        void onClosingFinished();
        /** Called when the shade starts opening. */
        void onOpenStarted();
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@ import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.classifier.Classifier;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.fragments.FragmentHostManager;
@@ -99,6 +98,7 @@ import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.LargeScreenUtils;
@@ -113,7 +113,7 @@ import javax.inject.Inject;
/** Handles QuickSettings touch handling, expansion and animation state
 * TODO (b/264460656) make this dumpable
 */
@SysUISingleton
@CentralSurfacesComponent.CentralSurfacesScope
public class QuickSettingsController implements Dumpable {
    public static final String TAG = "QuickSettingsController";

+2 −1
Original line number Diff line number Diff line
@@ -165,7 +165,8 @@ public interface ShadeController {
            NotificationShadeWindowViewController notificationShadeWindowViewController);

    /** */
    void setShadeViewController(ShadeViewController shadeViewController);
    void setNotificationPanelViewController(
            NotificationPanelViewController notificationPanelViewController);

    /** Listens for shade visibility changes. */
    interface ShadeVisibilityListener {
+5 −5
Original line number Diff line number Diff line
@@ -70,8 +70,7 @@ public final class ShadeControllerImpl implements ShadeController {

    private boolean mExpandedVisible;

    // TODO(b/237661616): Rename this variable to mShadeViewController.
    private ShadeViewController mNotificationPanelViewController;
    private NotificationPanelViewController mNotificationPanelViewController;
    private NotificationPresenter mPresenter;
    private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
    private ShadeVisibilityListener mShadeVisibilityListener;
@@ -427,11 +426,12 @@ public final class ShadeControllerImpl implements ShadeController {
    }

    @Override
    public void setShadeViewController(ShadeViewController shadeViewController) {
        mNotificationPanelViewController = shadeViewController;
    public void setNotificationPanelViewController(
            NotificationPanelViewController notificationPanelViewController) {
        mNotificationPanelViewController = notificationPanelViewController;
        mNotificationPanelViewController.setTrackingStartedListener(this::runPostCollapseRunnables);
        mNotificationPanelViewController.setOpenCloseListener(
                new OpenCloseListener() {
                new NotificationPanelViewController.OpenCloseListener() {
                    @Override
                    public void onClosingFinished() {
                        ShadeControllerImpl.this.onClosingFinished();
Loading