Merge "Revert "Revert "[CS] Make NPVC and QuickSettingsController singl..."" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a855866fa8
@@ -59,7 +59,7 @@ constructor(
|
|||||||
// At startup, 2 views with the ID `R.id.keyguard_indication_area` will be available.
|
// At startup, 2 views with the ID `R.id.keyguard_indication_area` will be available.
|
||||||
// Disable one of them
|
// Disable one of them
|
||||||
if (featureFlags.isEnabled(Flags.MIGRATE_INDICATION_AREA)) {
|
if (featureFlags.isEnabled(Flags.MIGRATE_INDICATION_AREA)) {
|
||||||
legacyParent.requireViewById<View>(R.id.keyguard_indication_area).let {
|
legacyParent.findViewById<View>(R.id.keyguard_indication_area)?.let {
|
||||||
legacyParent.removeView(it)
|
legacyParent.removeView(it)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
|
|||||||
import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants;
|
import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants;
|
||||||
import com.android.systemui.classifier.Classifier;
|
import com.android.systemui.classifier.Classifier;
|
||||||
import com.android.systemui.classifier.FalsingCollector;
|
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.DisplayId;
|
||||||
import com.android.systemui.dagger.qualifiers.Main;
|
import com.android.systemui.dagger.qualifiers.Main;
|
||||||
import com.android.systemui.doze.DozeLog;
|
import com.android.systemui.doze.DozeLog;
|
||||||
@@ -208,7 +209,6 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
|||||||
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
|
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
|
||||||
import com.android.systemui.statusbar.phone.TapAgainViewController;
|
import com.android.systemui.statusbar.phone.TapAgainViewController;
|
||||||
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
|
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.phone.fragment.CollapsedStatusBarFragment;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||||
import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController;
|
import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController;
|
||||||
@@ -238,7 +238,7 @@ import kotlin.Unit;
|
|||||||
|
|
||||||
import kotlinx.coroutines.CoroutineDispatcher;
|
import kotlinx.coroutines.CoroutineDispatcher;
|
||||||
|
|
||||||
@CentralSurfacesComponent.CentralSurfacesScope
|
@SysUISingleton
|
||||||
public final class NotificationPanelViewController implements ShadeSurface, Dumpable {
|
public final class NotificationPanelViewController implements ShadeSurface, Dumpable {
|
||||||
|
|
||||||
public static final String TAG = NotificationPanelView.class.getSimpleName();
|
public static final String TAG = NotificationPanelView.class.getSimpleName();
|
||||||
@@ -1409,11 +1409,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
mKeyguardBottomArea = keyguardBottomArea;
|
mKeyguardBottomArea = keyguardBottomArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOpenCloseListener(OpenCloseListener openCloseListener) {
|
@Override
|
||||||
|
public void setOpenCloseListener(OpenCloseListener openCloseListener) {
|
||||||
mOpenCloseListener = openCloseListener;
|
mOpenCloseListener = openCloseListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) {
|
@Override
|
||||||
|
public void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) {
|
||||||
mTrackingStartedListener = trackingStartedListener;
|
mTrackingStartedListener = trackingStartedListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3380,11 +3382,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
ViewGroupFadeHelper.reset(mView);
|
ViewGroupFadeHelper.reset(mView);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
|
@Override
|
||||||
|
public void addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
|
||||||
mView.getViewTreeObserver().addOnGlobalLayoutListener(listener);
|
mView.getViewTreeObserver().addOnGlobalLayoutListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
|
@Override
|
||||||
|
public void removeOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener) {
|
||||||
mView.getViewTreeObserver().removeOnGlobalLayoutListener(listener);
|
mView.getViewTreeObserver().removeOnGlobalLayoutListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3854,8 +3858,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
return !isFullyCollapsed() && !mTracking && !mClosing;
|
return !isFullyCollapsed() && !mTracking && !mClosing;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Collapses the shade instantly without animation. */
|
@Override
|
||||||
void instantCollapse() {
|
public void instantCollapse() {
|
||||||
abortAnimations();
|
abortAnimations();
|
||||||
setExpandedFraction(0f);
|
setExpandedFraction(0f);
|
||||||
if (mExpanding) {
|
if (mExpanding) {
|
||||||
@@ -4028,8 +4032,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
mFixedDuration = NO_FIXED_DURATION;
|
mFixedDuration = NO_FIXED_DURATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
@Override
|
||||||
boolean postToView(Runnable action) {
|
public boolean postToView(Runnable action) {
|
||||||
return mView.post(action);
|
return mView.post(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5124,18 +5128,5 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
|||||||
return super.performAccessibilityAction(host, action, args);
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ import com.android.systemui.Dumpable;
|
|||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.classifier.Classifier;
|
import com.android.systemui.classifier.Classifier;
|
||||||
import com.android.systemui.classifier.FalsingCollector;
|
import com.android.systemui.classifier.FalsingCollector;
|
||||||
|
import com.android.systemui.dagger.SysUISingleton;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
import com.android.systemui.flags.FeatureFlags;
|
import com.android.systemui.flags.FeatureFlags;
|
||||||
import com.android.systemui.fragments.FragmentHostManager;
|
import com.android.systemui.fragments.FragmentHostManager;
|
||||||
@@ -98,7 +99,6 @@ import com.android.systemui.statusbar.phone.LockscreenGestureLogger;
|
|||||||
import com.android.systemui.statusbar.phone.ScrimController;
|
import com.android.systemui.statusbar.phone.ScrimController;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
|
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.CastController;
|
||||||
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
||||||
import com.android.systemui.util.LargeScreenUtils;
|
import com.android.systemui.util.LargeScreenUtils;
|
||||||
@@ -113,7 +113,7 @@ import javax.inject.Inject;
|
|||||||
/** Handles QuickSettings touch handling, expansion and animation state
|
/** Handles QuickSettings touch handling, expansion and animation state
|
||||||
* TODO (b/264460656) make this dumpable
|
* TODO (b/264460656) make this dumpable
|
||||||
*/
|
*/
|
||||||
@CentralSurfacesComponent.CentralSurfacesScope
|
@SysUISingleton
|
||||||
public class QuickSettingsController implements Dumpable {
|
public class QuickSettingsController implements Dumpable {
|
||||||
public static final String TAG = "QuickSettingsController";
|
public static final String TAG = "QuickSettingsController";
|
||||||
|
|
||||||
|
|||||||
@@ -165,8 +165,7 @@ public interface ShadeController {
|
|||||||
NotificationShadeWindowViewController notificationShadeWindowViewController);
|
NotificationShadeWindowViewController notificationShadeWindowViewController);
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
void setNotificationPanelViewController(
|
void setShadeViewController(ShadeViewController shadeViewController);
|
||||||
NotificationPanelViewController notificationPanelViewController);
|
|
||||||
|
|
||||||
/** Listens for shade visibility changes. */
|
/** Listens for shade visibility changes. */
|
||||||
interface ShadeVisibilityListener {
|
interface ShadeVisibilityListener {
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ public final class ShadeControllerImpl implements ShadeController {
|
|||||||
|
|
||||||
private boolean mExpandedVisible;
|
private boolean mExpandedVisible;
|
||||||
|
|
||||||
private NotificationPanelViewController mNotificationPanelViewController;
|
// TODO(b/237661616): Rename this variable to mShadeViewController.
|
||||||
|
private ShadeViewController mNotificationPanelViewController;
|
||||||
private NotificationPresenter mPresenter;
|
private NotificationPresenter mPresenter;
|
||||||
private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
|
private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
|
||||||
private ShadeVisibilityListener mShadeVisibilityListener;
|
private ShadeVisibilityListener mShadeVisibilityListener;
|
||||||
@@ -426,12 +427,11 @@ public final class ShadeControllerImpl implements ShadeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNotificationPanelViewController(
|
public void setShadeViewController(ShadeViewController shadeViewController) {
|
||||||
NotificationPanelViewController notificationPanelViewController) {
|
mNotificationPanelViewController = shadeViewController;
|
||||||
mNotificationPanelViewController = notificationPanelViewController;
|
|
||||||
mNotificationPanelViewController.setTrackingStartedListener(this::runPostCollapseRunnables);
|
mNotificationPanelViewController.setTrackingStartedListener(this::runPostCollapseRunnables);
|
||||||
mNotificationPanelViewController.setOpenCloseListener(
|
mNotificationPanelViewController.setOpenCloseListener(
|
||||||
new NotificationPanelViewController.OpenCloseListener() {
|
new OpenCloseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClosingFinished() {
|
public void onClosingFinished() {
|
||||||
ShadeControllerImpl.this.onClosingFinished();
|
ShadeControllerImpl.this.onClosingFinished();
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ abstract class ShadeModule {
|
|||||||
@ClassKey(AuthRippleController::class)
|
@ClassKey(AuthRippleController::class)
|
||||||
abstract fun bindAuthRippleController(controller: AuthRippleController): CoreStartable
|
abstract fun bindAuthRippleController(controller: AuthRippleController): CoreStartable
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
@SysUISingleton
|
||||||
|
abstract fun bindsShadeViewController(
|
||||||
|
notificationPanelViewController: NotificationPanelViewController
|
||||||
|
): ShadeViewController
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val SHADE_HEADER = "large_screen_shade_header"
|
const val SHADE_HEADER = "large_screen_shade_header"
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package com.android.systemui.shade
|
|||||||
|
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.ViewTreeObserver
|
||||||
import com.android.systemui.keyguard.shared.model.WakefulnessModel
|
import com.android.systemui.keyguard.shared.model.WakefulnessModel
|
||||||
import com.android.systemui.statusbar.RemoteInputController
|
import com.android.systemui.statusbar.RemoteInputController
|
||||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
|
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
|
||||||
@@ -77,6 +78,9 @@ interface ShadeViewController {
|
|||||||
/** Collapses the shade with an animation duration in milliseconds. */
|
/** Collapses the shade with an animation duration in milliseconds. */
|
||||||
fun collapseWithDuration(animationDuration: Int)
|
fun collapseWithDuration(animationDuration: Int)
|
||||||
|
|
||||||
|
/** Collapses the shade instantly without animation. */
|
||||||
|
fun instantCollapse()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animate QS collapse by flinging it. If QS is expanded, it will collapse into QQS and stop. If
|
* Animate QS collapse by flinging it. If QS is expanded, it will collapse into QQS and stop. If
|
||||||
* in split shade, it will collapse the whole shade.
|
* in split shade, it will collapse the whole shade.
|
||||||
@@ -100,6 +104,9 @@ interface ShadeViewController {
|
|||||||
/** Returns whether the shade's top level view is enabled. */
|
/** Returns whether the shade's top level view is enabled. */
|
||||||
val isViewEnabled: Boolean
|
val isViewEnabled: Boolean
|
||||||
|
|
||||||
|
/** Sets a listener to be notified when the shade starts opening or finishes closing. */
|
||||||
|
fun setOpenCloseListener(openCloseListener: OpenCloseListener)
|
||||||
|
|
||||||
/** Returns whether status bar icons should be hidden when the shade is expanded. */
|
/** Returns whether status bar icons should be hidden when the shade is expanded. */
|
||||||
fun shouldHideStatusBarIconsWhenExpanded(): Boolean
|
fun shouldHideStatusBarIconsWhenExpanded(): Boolean
|
||||||
|
|
||||||
@@ -109,6 +116,9 @@ interface ShadeViewController {
|
|||||||
*/
|
*/
|
||||||
fun blockExpansionForCurrentTouch()
|
fun blockExpansionForCurrentTouch()
|
||||||
|
|
||||||
|
/** Sets a listener to be notified when touch tracking begins. */
|
||||||
|
fun setTrackingStartedListener(trackingStartedListener: TrackingStartedListener)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables the shade header.
|
* Disables the shade header.
|
||||||
*
|
*
|
||||||
@@ -178,6 +188,15 @@ interface ShadeViewController {
|
|||||||
/** Ensures that the touchable region is updated. */
|
/** Ensures that the touchable region is updated. */
|
||||||
fun updateTouchableRegion()
|
fun updateTouchableRegion()
|
||||||
|
|
||||||
|
/** Adds a global layout listener. */
|
||||||
|
fun addOnGlobalLayoutListener(listener: ViewTreeObserver.OnGlobalLayoutListener)
|
||||||
|
|
||||||
|
/** Removes a global layout listener. */
|
||||||
|
fun removeOnGlobalLayoutListener(listener: ViewTreeObserver.OnGlobalLayoutListener)
|
||||||
|
|
||||||
|
/** Posts the given runnable to the view. */
|
||||||
|
fun postToView(action: Runnable): Boolean
|
||||||
|
|
||||||
// ******* Begin Keyguard Section *********
|
// ******* Begin Keyguard Section *********
|
||||||
/** Animate to expanded shade after a delay in ms. Used for lockscreen to shade transition. */
|
/** Animate to expanded shade after a delay in ms. Used for lockscreen to shade transition. */
|
||||||
fun transitionToExpandedShade(delay: Long)
|
fun transitionToExpandedShade(delay: Long)
|
||||||
@@ -337,3 +356,17 @@ interface ShadeViewStateProvider {
|
|||||||
/** Return the fraction of the shade that's expanded, when in lockscreen. */
|
/** Return the fraction of the shade that's expanded, when in lockscreen. */
|
||||||
val lockscreenShadeDragProgress: Float
|
val lockscreenShadeDragProgress: Float
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Listens for when touch tracking begins. */
|
||||||
|
interface TrackingStartedListener {
|
||||||
|
fun onTrackingStarted()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Listens for when shade begins opening or finishes closing. */
|
||||||
|
interface OpenCloseListener {
|
||||||
|
/** Called when the shade finishes closing. */
|
||||||
|
fun onClosingFinished()
|
||||||
|
|
||||||
|
/** Called when the shade starts opening. */
|
||||||
|
fun onOpenStarted()
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ import com.android.systemui.plugins.ActivityStarter;
|
|||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.power.domain.interactor.PowerInteractor;
|
import com.android.systemui.power.domain.interactor.PowerInteractor;
|
||||||
import com.android.systemui.settings.DisplayTracker;
|
import com.android.systemui.settings.DisplayTracker;
|
||||||
|
import com.android.systemui.shade.NotificationPanelViewController;
|
||||||
|
import com.android.systemui.shade.ShadeSurface;
|
||||||
import com.android.systemui.shade.carrier.ShadeCarrierGroupController;
|
import com.android.systemui.shade.carrier.ShadeCarrierGroupController;
|
||||||
import com.android.systemui.statusbar.ActionClickLogger;
|
import com.android.systemui.statusbar.ActionClickLogger;
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
@@ -273,6 +275,21 @@ public interface CentralSurfacesDependenciesModule {
|
|||||||
return ongoingCallController;
|
return ongoingCallController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link NotificationPanelViewController} implements two interfaces:
|
||||||
|
* - {@link com.android.systemui.shade.ShadeViewController}, which can be used by any class
|
||||||
|
* needing access to the shade.
|
||||||
|
* - {@link ShadeSurface}, which should *only* be used by {@link CentralSurfacesImpl}.
|
||||||
|
*
|
||||||
|
* Since {@link ShadeSurface} should only be accessible by {@link CentralSurfacesImpl}, it's
|
||||||
|
* *only* bound in this CentralSurfaces dependencies module.
|
||||||
|
* The {@link com.android.systemui.shade.ShadeViewController} interface is bound in
|
||||||
|
* {@link com.android.systemui.shade.ShadeModule} so others can access it.
|
||||||
|
*/
|
||||||
|
@Binds
|
||||||
|
@SysUISingleton
|
||||||
|
ShadeSurface provideShadeSurface(NotificationPanelViewController impl);
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
@Binds
|
@Binds
|
||||||
ShadeCarrierGroupController.SlotIndexResolver provideSlotIndexResolver(
|
ShadeCarrierGroupController.SlotIndexResolver provideSlotIndexResolver(
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ import com.android.systemui.scrim.ScrimView;
|
|||||||
import com.android.systemui.settings.UserTracker;
|
import com.android.systemui.settings.UserTracker;
|
||||||
import com.android.systemui.settings.brightness.BrightnessSliderController;
|
import com.android.systemui.settings.brightness.BrightnessSliderController;
|
||||||
import com.android.systemui.shade.CameraLauncher;
|
import com.android.systemui.shade.CameraLauncher;
|
||||||
import com.android.systemui.shade.NotificationPanelViewController;
|
|
||||||
import com.android.systemui.shade.NotificationShadeWindowView;
|
import com.android.systemui.shade.NotificationShadeWindowView;
|
||||||
import com.android.systemui.shade.NotificationShadeWindowViewController;
|
import com.android.systemui.shade.NotificationShadeWindowViewController;
|
||||||
import com.android.systemui.shade.QuickSettingsController;
|
import com.android.systemui.shade.QuickSettingsController;
|
||||||
@@ -477,14 +476,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
private final Lazy<LightRevealScrimViewModel> mLightRevealScrimViewModelLazy;
|
private final Lazy<LightRevealScrimViewModel> mLightRevealScrimViewModelLazy;
|
||||||
|
|
||||||
/** Controller for the Shade. */
|
/** Controller for the Shade. */
|
||||||
@VisibleForTesting
|
private final ShadeSurface mShadeSurface;
|
||||||
ShadeSurface mShadeSurface;
|
|
||||||
private final ShadeLogger mShadeLogger;
|
private final ShadeLogger mShadeLogger;
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
private QSPanelController mQSPanelController;
|
private QSPanelController mQSPanelController;
|
||||||
@VisibleForTesting
|
private final QuickSettingsController mQsController;
|
||||||
QuickSettingsController mQsController;
|
|
||||||
|
|
||||||
KeyguardIndicationController mKeyguardIndicationController;
|
KeyguardIndicationController mKeyguardIndicationController;
|
||||||
|
|
||||||
@@ -704,9 +701,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
MetricsLogger metricsLogger,
|
MetricsLogger metricsLogger,
|
||||||
ShadeLogger shadeLogger,
|
ShadeLogger shadeLogger,
|
||||||
@UiBackground Executor uiBgExecutor,
|
@UiBackground Executor uiBgExecutor,
|
||||||
|
ShadeSurface shadeSurface,
|
||||||
NotificationMediaManager notificationMediaManager,
|
NotificationMediaManager notificationMediaManager,
|
||||||
NotificationLockscreenUserManager lockScreenUserManager,
|
NotificationLockscreenUserManager lockScreenUserManager,
|
||||||
NotificationRemoteInputManager remoteInputManager,
|
NotificationRemoteInputManager remoteInputManager,
|
||||||
|
QuickSettingsController quickSettingsController,
|
||||||
UserSwitcherController userSwitcherController,
|
UserSwitcherController userSwitcherController,
|
||||||
BatteryController batteryController,
|
BatteryController batteryController,
|
||||||
SysuiColorExtractor colorExtractor,
|
SysuiColorExtractor colorExtractor,
|
||||||
@@ -805,9 +804,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mMetricsLogger = metricsLogger;
|
mMetricsLogger = metricsLogger;
|
||||||
mShadeLogger = shadeLogger;
|
mShadeLogger = shadeLogger;
|
||||||
mUiBgExecutor = uiBgExecutor;
|
mUiBgExecutor = uiBgExecutor;
|
||||||
|
mShadeSurface = shadeSurface;
|
||||||
mMediaManager = notificationMediaManager;
|
mMediaManager = notificationMediaManager;
|
||||||
mLockscreenUserManager = lockScreenUserManager;
|
mLockscreenUserManager = lockScreenUserManager;
|
||||||
mRemoteInputManager = remoteInputManager;
|
mRemoteInputManager = remoteInputManager;
|
||||||
|
mQsController = quickSettingsController;
|
||||||
mUserSwitcherController = userSwitcherController;
|
mUserSwitcherController = userSwitcherController;
|
||||||
mBatteryController = batteryController;
|
mBatteryController = batteryController;
|
||||||
mColorExtractor = colorExtractor;
|
mColorExtractor = colorExtractor;
|
||||||
@@ -1611,13 +1612,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
// (Right now, there's a circular dependency.)
|
// (Right now, there's a circular dependency.)
|
||||||
mNotificationShadeWindowController.setWindowRootView(windowRootView);
|
mNotificationShadeWindowController.setWindowRootView(windowRootView);
|
||||||
mNotificationShadeWindowViewController.setupExpandedStatusBar();
|
mNotificationShadeWindowViewController.setupExpandedStatusBar();
|
||||||
NotificationPanelViewController npvc =
|
mShadeController.setShadeViewController(mShadeSurface);
|
||||||
mCentralSurfacesComponent.getNotificationPanelViewController();
|
|
||||||
mShadeSurface = npvc;
|
|
||||||
mShadeController.setNotificationPanelViewController(npvc);
|
|
||||||
mShadeController.setNotificationShadeWindowViewController(
|
mShadeController.setNotificationShadeWindowViewController(
|
||||||
mNotificationShadeWindowViewController);
|
mNotificationShadeWindowViewController);
|
||||||
mQsController = mCentralSurfacesComponent.getQuickSettingsController();
|
|
||||||
mBackActionInteractor.setup(mQsController, mShadeSurface);
|
mBackActionInteractor.setup(mQsController, mShadeSurface);
|
||||||
mPresenter = mCentralSurfacesComponent.getNotificationPresenter();
|
mPresenter = mCentralSurfacesComponent.getNotificationPresenter();
|
||||||
mNotificationActivityStarter = mCentralSurfacesComponent.getNotificationActivityStarter();
|
mNotificationActivityStarter = mCentralSurfacesComponent.getNotificationActivityStarter();
|
||||||
@@ -1813,7 +1810,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStatusBarTrackpadEvent(MotionEvent event) {
|
public void onStatusBarTrackpadEvent(MotionEvent event) {
|
||||||
mCentralSurfacesComponent.getNotificationPanelViewController().handleExternalTouch(event);
|
mShadeSurface.handleExternalTouch(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onExpandedInvisible() {
|
private void onExpandedInvisible() {
|
||||||
|
|||||||
@@ -21,10 +21,8 @@ import static com.android.systemui.statusbar.phone.dagger.StatusBarViewModule.ST
|
|||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
import com.android.systemui.scene.ui.view.WindowRootView;
|
import com.android.systemui.scene.ui.view.WindowRootView;
|
||||||
import com.android.systemui.shade.NotificationPanelViewController;
|
|
||||||
import com.android.systemui.shade.NotificationShadeWindowView;
|
import com.android.systemui.shade.NotificationShadeWindowView;
|
||||||
import com.android.systemui.shade.NotificationShadeWindowViewController;
|
import com.android.systemui.shade.NotificationShadeWindowViewController;
|
||||||
import com.android.systemui.shade.QuickSettingsController;
|
|
||||||
import com.android.systemui.shade.ShadeHeaderController;
|
import com.android.systemui.shade.ShadeHeaderController;
|
||||||
import com.android.systemui.statusbar.NotificationPresenter;
|
import com.android.systemui.statusbar.NotificationPresenter;
|
||||||
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
|
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
|
||||||
@@ -88,14 +86,6 @@ public interface CentralSurfacesComponent {
|
|||||||
*/
|
*/
|
||||||
NotificationShadeWindowViewController getNotificationShadeWindowViewController();
|
NotificationShadeWindowViewController getNotificationShadeWindowViewController();
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a NotificationPanelViewController.
|
|
||||||
*/
|
|
||||||
NotificationPanelViewController getNotificationPanelViewController();
|
|
||||||
|
|
||||||
/** Creates a QuickSettingsController. */
|
|
||||||
QuickSettingsController getQuickSettingsController();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a StatusBarHeadsUpChangeListener.
|
* Creates a StatusBarHeadsUpChangeListener.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import com.android.systemui.dagger.qualifiers.Main;
|
|||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
import com.android.systemui.flags.FeatureFlags;
|
import com.android.systemui.flags.FeatureFlags;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.shade.NotificationPanelViewController;
|
|
||||||
import com.android.systemui.shade.ShadeExpansionStateManager;
|
import com.android.systemui.shade.ShadeExpansionStateManager;
|
||||||
import com.android.systemui.shade.ShadeViewController;
|
import com.android.systemui.shade.ShadeViewController;
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
@@ -65,12 +64,6 @@ public abstract class StatusBarViewModule {
|
|||||||
|
|
||||||
public static final String STATUS_BAR_FRAGMENT = "status_bar_fragment";
|
public static final String STATUS_BAR_FRAGMENT = "status_bar_fragment";
|
||||||
|
|
||||||
/** */
|
|
||||||
@Binds
|
|
||||||
@CentralSurfacesComponent.CentralSurfacesScope
|
|
||||||
abstract ShadeViewController bindsShadeViewController(
|
|
||||||
NotificationPanelViewController notificationPanelViewController);
|
|
||||||
|
|
||||||
@Binds
|
@Binds
|
||||||
@IntoSet
|
@IntoSet
|
||||||
abstract StatusBarBoundsProvider.BoundsChangeListener sysBarAttrsListenerAsBoundsListener(
|
abstract StatusBarBoundsProvider.BoundsChangeListener sysBarAttrsListenerAsBoundsListener(
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ import com.android.keyguard.logging.KeyguardLogger;
|
|||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.biometrics.AuthController;
|
import com.android.systemui.biometrics.AuthController;
|
||||||
|
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor;
|
||||||
import com.android.systemui.classifier.FalsingCollectorFake;
|
import com.android.systemui.classifier.FalsingCollectorFake;
|
||||||
import com.android.systemui.classifier.FalsingManagerFake;
|
import com.android.systemui.classifier.FalsingManagerFake;
|
||||||
import com.android.systemui.common.ui.view.LongPressHandlingView;
|
import com.android.systemui.common.ui.view.LongPressHandlingView;
|
||||||
@@ -91,7 +92,6 @@ import com.android.systemui.fragments.FragmentService;
|
|||||||
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
|
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
|
||||||
import com.android.systemui.keyguard.KeyguardViewConfigurator;
|
import com.android.systemui.keyguard.KeyguardViewConfigurator;
|
||||||
import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository;
|
import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository;
|
||||||
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor;
|
|
||||||
import com.android.systemui.keyguard.domain.interactor.KeyguardBottomAreaInteractor;
|
import com.android.systemui.keyguard.domain.interactor.KeyguardBottomAreaInteractor;
|
||||||
import com.android.systemui.keyguard.domain.interactor.KeyguardFaceAuthInteractor;
|
import com.android.systemui.keyguard.domain.interactor.KeyguardFaceAuthInteractor;
|
||||||
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
|
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
|
||||||
@@ -629,7 +629,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
|
|||||||
mHeadsUpManager);
|
mHeadsUpManager);
|
||||||
mNotificationPanelViewController.setTrackingStartedListener(() -> {});
|
mNotificationPanelViewController.setTrackingStartedListener(() -> {});
|
||||||
mNotificationPanelViewController.setOpenCloseListener(
|
mNotificationPanelViewController.setOpenCloseListener(
|
||||||
new NotificationPanelViewController.OpenCloseListener() {
|
new OpenCloseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClosingFinished() {}
|
public void onClosingFinished() {}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class ShadeControllerImplTest : SysuiTestCase() {
|
|||||||
@Mock private lateinit var windowManager: WindowManager
|
@Mock private lateinit var windowManager: WindowManager
|
||||||
@Mock private lateinit var assistManager: AssistManager
|
@Mock private lateinit var assistManager: AssistManager
|
||||||
@Mock private lateinit var gutsManager: NotificationGutsManager
|
@Mock private lateinit var gutsManager: NotificationGutsManager
|
||||||
@Mock private lateinit var notificationPanelViewController: NotificationPanelViewController
|
@Mock private lateinit var shadeViewController: ShadeViewController
|
||||||
@Mock private lateinit var nswvc: NotificationShadeWindowViewController
|
@Mock private lateinit var nswvc: NotificationShadeWindowViewController
|
||||||
@Mock private lateinit var display: Display
|
@Mock private lateinit var display: Display
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ class ShadeControllerImplTest : SysuiTestCase() {
|
|||||||
Lazy { gutsManager },
|
Lazy { gutsManager },
|
||||||
)
|
)
|
||||||
shadeController.setNotificationShadeWindowViewController(nswvc)
|
shadeController.setNotificationShadeWindowViewController(nswvc)
|
||||||
shadeController.setNotificationPanelViewController(notificationPanelViewController)
|
shadeController.setShadeViewController(shadeViewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -91,9 +91,9 @@ class ShadeControllerImplTest : SysuiTestCase() {
|
|||||||
|
|
||||||
// Trying to open it does nothing.
|
// Trying to open it does nothing.
|
||||||
shadeController.animateExpandShade()
|
shadeController.animateExpandShade()
|
||||||
verify(notificationPanelViewController, never()).expandToNotifications()
|
verify(shadeViewController, never()).expandToNotifications()
|
||||||
shadeController.animateExpandQs()
|
shadeController.animateExpandQs()
|
||||||
verify(notificationPanelViewController, never()).expand(ArgumentMatchers.anyBoolean())
|
verify(shadeViewController, never()).expand(ArgumentMatchers.anyBoolean())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -102,15 +102,15 @@ class ShadeControllerImplTest : SysuiTestCase() {
|
|||||||
|
|
||||||
// Can now be opened.
|
// Can now be opened.
|
||||||
shadeController.animateExpandShade()
|
shadeController.animateExpandShade()
|
||||||
verify(notificationPanelViewController).expandToNotifications()
|
verify(shadeViewController).expandToNotifications()
|
||||||
shadeController.animateExpandQs()
|
shadeController.animateExpandQs()
|
||||||
verify(notificationPanelViewController).expandToQs()
|
verify(shadeViewController).expandToQs()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun cancelExpansionAndCollapseShade_callsCancelCurrentTouch() {
|
fun cancelExpansionAndCollapseShade_callsCancelCurrentTouch() {
|
||||||
// GIVEN the shade is tracking a touch
|
// GIVEN the shade is tracking a touch
|
||||||
whenever(notificationPanelViewController.isTracking).thenReturn(true)
|
whenever(shadeViewController.isTracking).thenReturn(true)
|
||||||
|
|
||||||
// WHEN cancelExpansionAndCollapseShade is called
|
// WHEN cancelExpansionAndCollapseShade is called
|
||||||
shadeController.cancelExpansionAndCollapseShade()
|
shadeController.cancelExpansionAndCollapseShade()
|
||||||
@@ -122,7 +122,7 @@ class ShadeControllerImplTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun cancelExpansionAndCollapseShade_doesNotCallAnimateCollapseShade_whenCollapsed() {
|
fun cancelExpansionAndCollapseShade_doesNotCallAnimateCollapseShade_whenCollapsed() {
|
||||||
// GIVEN the shade is tracking a touch
|
// GIVEN the shade is tracking a touch
|
||||||
whenever(notificationPanelViewController.isTracking).thenReturn(false)
|
whenever(shadeViewController.isTracking).thenReturn(false)
|
||||||
|
|
||||||
// WHEN cancelExpansionAndCollapseShade is called
|
// WHEN cancelExpansionAndCollapseShade is called
|
||||||
shadeController.cancelExpansionAndCollapseShade()
|
shadeController.cancelExpansionAndCollapseShade()
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
() -> mAssistManager,
|
() -> mAssistManager,
|
||||||
() -> mNotificationGutsManager
|
() -> mNotificationGutsManager
|
||||||
));
|
));
|
||||||
mShadeController.setNotificationPanelViewController(mNotificationPanelViewController);
|
mShadeController.setShadeViewController(mNotificationPanelViewController);
|
||||||
mShadeController.setNotificationShadeWindowViewController(
|
mShadeController.setNotificationShadeWindowViewController(
|
||||||
mNotificationShadeWindowViewController);
|
mNotificationShadeWindowViewController);
|
||||||
mShadeController.setNotificationPresenter(mNotificationPresenter);
|
mShadeController.setNotificationPresenter(mNotificationPresenter);
|
||||||
@@ -490,9 +490,11 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
mMetricsLogger,
|
mMetricsLogger,
|
||||||
mShadeLogger,
|
mShadeLogger,
|
||||||
mUiBgExecutor,
|
mUiBgExecutor,
|
||||||
|
mNotificationPanelViewController,
|
||||||
mNotificationMediaManager,
|
mNotificationMediaManager,
|
||||||
mLockscreenUserManager,
|
mLockscreenUserManager,
|
||||||
mRemoteInputManager,
|
mRemoteInputManager,
|
||||||
|
mQuickSettingsController,
|
||||||
mUserSwitcherController,
|
mUserSwitcherController,
|
||||||
mBatteryController,
|
mBatteryController,
|
||||||
mColorExtractor,
|
mColorExtractor,
|
||||||
@@ -587,8 +589,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
// TODO: we should be able to call mCentralSurfaces.start() and have all the below values
|
// TODO: we should be able to call mCentralSurfaces.start() and have all the below values
|
||||||
// initialized automatically and make NPVC private.
|
// initialized automatically and make NPVC private.
|
||||||
mCentralSurfaces.mNotificationShadeWindowView = mNotificationShadeWindowView;
|
mCentralSurfaces.mNotificationShadeWindowView = mNotificationShadeWindowView;
|
||||||
mCentralSurfaces.mShadeSurface = mNotificationPanelViewController;
|
|
||||||
mCentralSurfaces.mQsController = mQuickSettingsController;
|
|
||||||
mCentralSurfaces.mDozeScrimController = mDozeScrimController;
|
mCentralSurfaces.mDozeScrimController = mDozeScrimController;
|
||||||
mCentralSurfaces.mPresenter = mNotificationPresenter;
|
mCentralSurfaces.mPresenter = mNotificationPresenter;
|
||||||
mCentralSurfaces.mKeyguardIndicationController = mKeyguardIndicationController;
|
mCentralSurfaces.mKeyguardIndicationController = mKeyguardIndicationController;
|
||||||
|
|||||||
Reference in New Issue
Block a user