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

Commit 2904a182 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "b249277686_shadeCs" into udc-qpr-dev

* changes:
  Move shade code out of CentralSurfaces
  Move shade code out of CentralSurfaces
parents f502b113 e289025c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -133,6 +133,9 @@ public interface ActivityStarter {
            boolean willAnimateOnKeyguard,
            @Nullable String customMessage);

    /** Whether we should animate an activity launch. */
    boolean shouldAnimateLaunch(boolean isActivityIntent);

    interface Callback {
        void onActivityStarted(int resultCode);
    }
+2 −4
Original line number Diff line number Diff line
@@ -485,13 +485,11 @@ public class SystemActions implements CoreStartable {
    }

    private void handleNotifications() {
        mCentralSurfacesOptionalLazy.get().ifPresent(
                CentralSurfaces::animateExpandNotificationsPanel);
        mShadeController.animateExpandShade();
    }

    private void handleQuickSettings() {
        mCentralSurfacesOptionalLazy.get().ifPresent(
                centralSurfaces -> centralSurfaces.animateExpandSettingsPanel(null));
        mShadeController.animateExpandQs();
    }

    private void handlePowerDialog() {
+12 −5
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ import com.android.systemui.plugins.GlobalActions.GlobalActionsManager;
import com.android.systemui.plugins.GlobalActionsPanelPlugin;
import com.android.systemui.scrim.ScrimDrawable;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.VibratorHelper;
import com.android.systemui.statusbar.phone.CentralSurfaces;
@@ -250,6 +251,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
    protected Handler mMainHandler;
    private int mSmallestScreenWidthDp;
    private final Optional<CentralSurfaces> mCentralSurfacesOptional;
    private final ShadeController mShadeController;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final DialogLaunchAnimator mDialogLaunchAnimator;

@@ -360,6 +362,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
            @Main Handler handler,
            PackageManager packageManager,
            Optional<CentralSurfaces> centralSurfacesOptional,
            ShadeController shadeController,
            KeyguardUpdateMonitor keyguardUpdateMonitor,
            DialogLaunchAnimator dialogLaunchAnimator) {
        mContext = context;
@@ -392,6 +395,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
        mMainHandler = handler;
        mSmallestScreenWidthDp = resources.getConfiguration().smallestScreenWidthDp;
        mCentralSurfacesOptional = centralSurfacesOptional;
        mShadeController = shadeController;
        mKeyguardUpdateMonitor = keyguardUpdateMonitor;
        mDialogLaunchAnimator = dialogLaunchAnimator;

@@ -700,7 +704,9 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                mAdapter, mOverflowAdapter, mSysuiColorExtractor, mStatusBarService,
                mLightBarController,
                mNotificationShadeWindowController, this::onRefresh, mKeyguardShowing,
                mPowerAdapter, mUiEventLogger, mCentralSurfacesOptional, mKeyguardUpdateMonitor,
                mPowerAdapter, mUiEventLogger, mCentralSurfacesOptional,
                mShadeController,
                mKeyguardUpdateMonitor,
                mLockPatternUtils);

        dialog.setOnDismissListener(this);
@@ -2205,6 +2211,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
        private UiEventLogger mUiEventLogger;
        private GestureDetector mGestureDetector;
        private Optional<CentralSurfaces> mCentralSurfacesOptional;
        private final ShadeController mShadeController;
        private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
        private LockPatternUtils mLockPatternUtils;
        private float mWindowDimAmount;
@@ -2278,6 +2285,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                Runnable onRefreshCallback, boolean keyguardShowing,
                MyPowerOptionsAdapter powerAdapter, UiEventLogger uiEventLogger,
                Optional<CentralSurfaces> centralSurfacesOptional,
                ShadeController shadeController,
                KeyguardUpdateMonitor keyguardUpdateMonitor,
                LockPatternUtils lockPatternUtils) {
            // We set dismissOnDeviceLock to false because we have a custom broadcast receiver to
@@ -2295,6 +2303,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
            mKeyguardShowing = keyguardShowing;
            mUiEventLogger = uiEventLogger;
            mCentralSurfacesOptional = centralSurfacesOptional;
            mShadeController = shadeController;
            mKeyguardUpdateMonitor = keyguardUpdateMonitor;
            mLockPatternUtils = lockPatternUtils;
            mGestureDetector = new GestureDetector(mContext, mGestureListener);
@@ -2342,12 +2351,10 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
            mUiEventLogger.log(GlobalActionsEvent.GA_CLOSE_TAP_OUTSIDE);
            if (mCentralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing).orElse(false)) {
                // match existing lockscreen behavior to open QS when swiping from status bar
                mCentralSurfacesOptional.ifPresent(
                        centralSurfaces -> centralSurfaces.animateExpandSettingsPanel(null));
                mShadeController.animateExpandQs();
            } else {
                // otherwise, swiping down should expand notification shade
                mCentralSurfacesOptional.ifPresent(
                        centralSurfaces -> centralSurfaces.animateExpandNotificationsPanel());
                mShadeController.animateExpandShade();
            }
            dismiss();
        }
+7 −8
Original line number Diff line number Diff line
@@ -52,8 +52,8 @@ import com.android.systemui.qs.pipeline.data.repository.CustomTileAddedRepositor
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor;
import com.android.systemui.settings.UserFileManager;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.statusbar.phone.AutoTileManager;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;
import com.android.systemui.util.settings.SecureSettings;
@@ -66,7 +66,6 @@ import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.function.Predicate;
@@ -108,7 +107,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P
    private AutoTileManager mAutoTiles;
    private final ArrayList<QSFactory> mQsFactories = new ArrayList<>();
    private int mCurrentUser;
    private final Optional<CentralSurfaces> mCentralSurfacesOptional;
    private final ShadeController mShadeController;
    private Context mUserContext;
    private UserTracker mUserTracker;
    private SecureSettings mSecureSettings;
@@ -129,7 +128,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P
            PluginManager pluginManager,
            TunerService tunerService,
            Provider<AutoTileManager> autoTiles,
            Optional<CentralSurfaces> centralSurfacesOptional,
            ShadeController shadeController,
            QSLogger qsLogger,
            UserTracker userTracker,
            SecureSettings secureSettings,
@@ -148,7 +147,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P
        mUserFileManager = userFileManager;
        mFeatureFlags = featureFlags;

        mCentralSurfacesOptional = centralSurfacesOptional;
        mShadeController = shadeController;

        mQsFactories.add(defaultFactory);
        pluginManager.addPluginListener(this, QSFactory.class, true);
@@ -209,17 +208,17 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P

    @Override
    public void collapsePanels() {
        mCentralSurfacesOptional.ifPresent(CentralSurfaces::postAnimateCollapsePanels);
        mShadeController.postAnimateCollapseShade();
    }

    @Override
    public void forceCollapsePanels() {
        mCentralSurfacesOptional.ifPresent(CentralSurfaces::postAnimateForceCollapsePanels);
        mShadeController.postAnimateForceCollapseShade();
    }

    @Override
    public void openPanels() {
        mCentralSurfacesOptional.ifPresent(CentralSurfaces::postAnimateOpenPanels);
        mShadeController.postAnimateExpandQs();
    }

    @Override
+5 −6
Original line number Diff line number Diff line
@@ -16,8 +16,7 @@
package com.android.systemui.qs.pipeline.domain.interactor

import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.statusbar.phone.CentralSurfaces
import java.util.Optional
import com.android.systemui.shade.ShadeController
import javax.inject.Inject

/** Encapsulates business logic for interacting with the QS panel. */
@@ -37,17 +36,17 @@ interface PanelInteractor {
class PanelInteractorImpl
@Inject
constructor(
    private val centralSurfaces: Optional<CentralSurfaces>,
    private val shadeController: ShadeController,
) : PanelInteractor {
    override fun collapsePanels() {
        centralSurfaces.ifPresent { it.postAnimateCollapsePanels() }
        shadeController.postAnimateCollapseShade()
    }

    override fun forceCollapsePanels() {
        centralSurfaces.ifPresent { it.postAnimateForceCollapsePanels() }
        shadeController.postAnimateForceCollapseShade()
    }

    override fun openPanels() {
        centralSurfaces.ifPresent { it.postAnimateOpenPanels() }
        shadeController.postAnimateExpandQs()
    }
}
Loading