Merge "[CS] Make NotificationShadeWindowViewController a singleton." into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
435322b4a7
@@ -46,6 +46,7 @@ import com.android.systemui.bouncer.ui.binder.KeyguardBouncerViewBinder;
|
|||||||
import com.android.systemui.bouncer.ui.viewmodel.KeyguardBouncerViewModel;
|
import com.android.systemui.bouncer.ui.viewmodel.KeyguardBouncerViewModel;
|
||||||
import com.android.systemui.classifier.FalsingCollector;
|
import com.android.systemui.classifier.FalsingCollector;
|
||||||
import com.android.systemui.compose.ComposeFacade;
|
import com.android.systemui.compose.ComposeFacade;
|
||||||
|
import com.android.systemui.dagger.SysUISingleton;
|
||||||
import com.android.systemui.dock.DockManager;
|
import com.android.systemui.dock.DockManager;
|
||||||
import com.android.systemui.flags.FeatureFlags;
|
import com.android.systemui.flags.FeatureFlags;
|
||||||
import com.android.systemui.flags.Flags;
|
import com.android.systemui.flags.Flags;
|
||||||
@@ -72,7 +73,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll
|
|||||||
import com.android.systemui.statusbar.phone.CentralSurfaces;
|
import com.android.systemui.statusbar.phone.CentralSurfaces;
|
||||||
import com.android.systemui.statusbar.phone.PhoneStatusBarViewController;
|
import com.android.systemui.statusbar.phone.PhoneStatusBarViewController;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
|
|
||||||
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
|
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
|
||||||
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
|
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
|
||||||
import com.android.systemui.util.time.SystemClock;
|
import com.android.systemui.util.time.SystemClock;
|
||||||
@@ -87,7 +87,7 @@ import javax.inject.Provider;
|
|||||||
/**
|
/**
|
||||||
* Controller for {@link NotificationShadeWindowView}.
|
* Controller for {@link NotificationShadeWindowView}.
|
||||||
*/
|
*/
|
||||||
@CentralSurfacesComponent.CentralSurfacesScope
|
@SysUISingleton
|
||||||
public class NotificationShadeWindowViewController {
|
public class NotificationShadeWindowViewController {
|
||||||
private static final String TAG = "NotifShadeWindowVC";
|
private static final String TAG = "NotifShadeWindowVC";
|
||||||
private final FalsingCollector mFalsingCollector;
|
private final FalsingCollector mFalsingCollector;
|
||||||
|
|||||||
@@ -413,7 +413,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
|
|
||||||
private final Point mCurrentDisplaySize = new Point();
|
private final Point mCurrentDisplaySize = new Point();
|
||||||
|
|
||||||
protected NotificationShadeWindowView mNotificationShadeWindowView;
|
|
||||||
protected PhoneStatusBarView mStatusBarView;
|
protected PhoneStatusBarView mStatusBarView;
|
||||||
private PhoneStatusBarViewController mPhoneStatusBarViewController;
|
private PhoneStatusBarViewController mPhoneStatusBarViewController;
|
||||||
private PhoneStatusBarTransitions mStatusBarTransitions;
|
private PhoneStatusBarTransitions mStatusBarTransitions;
|
||||||
@@ -456,7 +455,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
private final FalsingManager mFalsingManager;
|
private final FalsingManager mFalsingManager;
|
||||||
private final BroadcastDispatcher mBroadcastDispatcher;
|
private final BroadcastDispatcher mBroadcastDispatcher;
|
||||||
private final ConfigurationController mConfigurationController;
|
private final ConfigurationController mConfigurationController;
|
||||||
protected NotificationShadeWindowViewController mNotificationShadeWindowViewController;
|
private final Lazy<NotificationShadeWindowViewController>
|
||||||
|
mNotificationShadeWindowViewControllerLazy;
|
||||||
private final DozeParameters mDozeParameters;
|
private final DozeParameters mDozeParameters;
|
||||||
private final Lazy<BiometricUnlockController> mBiometricUnlockControllerLazy;
|
private final Lazy<BiometricUnlockController> mBiometricUnlockControllerLazy;
|
||||||
private final CentralSurfacesComponent.Factory mCentralSurfacesComponentFactory;
|
private final CentralSurfacesComponent.Factory mCentralSurfacesComponentFactory;
|
||||||
@@ -722,6 +722,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
Lazy<AssistManager> assistManagerLazy,
|
Lazy<AssistManager> assistManagerLazy,
|
||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
NotificationShadeWindowController notificationShadeWindowController,
|
NotificationShadeWindowController notificationShadeWindowController,
|
||||||
|
Lazy<NotificationShadeWindowViewController> notificationShadeWindowViewControllerLazy,
|
||||||
NotificationShelfController notificationShelfController,
|
NotificationShelfController notificationShelfController,
|
||||||
NotificationStackScrollLayoutController notificationStackScrollLayoutController,
|
NotificationStackScrollLayoutController notificationStackScrollLayoutController,
|
||||||
DozeParameters dozeParameters,
|
DozeParameters dozeParameters,
|
||||||
@@ -825,6 +826,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mAssistManagerLazy = assistManagerLazy;
|
mAssistManagerLazy = assistManagerLazy;
|
||||||
mConfigurationController = configurationController;
|
mConfigurationController = configurationController;
|
||||||
mNotificationShadeWindowController = notificationShadeWindowController;
|
mNotificationShadeWindowController = notificationShadeWindowController;
|
||||||
|
mNotificationShadeWindowViewControllerLazy = notificationShadeWindowViewControllerLazy;
|
||||||
mNotificationShelfController = notificationShelfController;
|
mNotificationShelfController = notificationShelfController;
|
||||||
mStackScrollerController = notificationStackScrollLayoutController;
|
mStackScrollerController = notificationStackScrollLayoutController;
|
||||||
mStackScroller = mStackScrollerController.getView();
|
mStackScroller = mStackScrollerController.getView();
|
||||||
@@ -1073,7 +1075,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mDozeServiceHost.initialize(
|
mDozeServiceHost.initialize(
|
||||||
this,
|
this,
|
||||||
mStatusBarKeyguardViewManager,
|
mStatusBarKeyguardViewManager,
|
||||||
mNotificationShadeWindowViewController,
|
getNotificationShadeWindowViewController(),
|
||||||
mShadeSurface,
|
mShadeSurface,
|
||||||
mAmbientIndicationContainer);
|
mAmbientIndicationContainer);
|
||||||
updateLightRevealScrimVisibility();
|
updateLightRevealScrimVisibility();
|
||||||
@@ -1235,8 +1237,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
updateTheme();
|
updateTheme();
|
||||||
|
|
||||||
inflateStatusBarWindow();
|
inflateStatusBarWindow();
|
||||||
mNotificationShadeWindowView.setOnTouchListener(getStatusBarWindowTouchListener());
|
getNotificationShadeWindowView().setOnTouchListener(getStatusBarWindowTouchListener());
|
||||||
mWallpaperController.setRootView(mNotificationShadeWindowView);
|
mWallpaperController.setRootView(getNotificationShadeWindowView());
|
||||||
|
|
||||||
// TODO: Deal with the ugliness that comes from having some of the status bar broken out
|
// TODO: Deal with the ugliness that comes from having some of the status bar broken out
|
||||||
// into fragments, but the rest here, it leaves some awkward lifecycle and whatnot.
|
// into fragments, but the rest here, it leaves some awkward lifecycle and whatnot.
|
||||||
@@ -1257,7 +1259,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mStatusBarView = statusBarView;
|
mStatusBarView = statusBarView;
|
||||||
mPhoneStatusBarViewController = statusBarViewController;
|
mPhoneStatusBarViewController = statusBarViewController;
|
||||||
mStatusBarTransitions = statusBarTransitions;
|
mStatusBarTransitions = statusBarTransitions;
|
||||||
mNotificationShadeWindowViewController
|
getNotificationShadeWindowViewController()
|
||||||
.setStatusBarViewController(mPhoneStatusBarViewController);
|
.setStatusBarViewController(mPhoneStatusBarViewController);
|
||||||
// Ensure we re-propagate panel expansion values to the panel controller and
|
// Ensure we re-propagate panel expansion values to the panel controller and
|
||||||
// any listeners it may have, such as PanelBar. This will also ensure we
|
// any listeners it may have, such as PanelBar. This will also ensure we
|
||||||
@@ -1271,7 +1273,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mStatusBarInitializer.initializeStatusBar(
|
mStatusBarInitializer.initializeStatusBar(
|
||||||
mCentralSurfacesComponent::createCollapsedStatusBarFragment);
|
mCentralSurfacesComponent::createCollapsedStatusBarFragment);
|
||||||
|
|
||||||
mStatusBarTouchableRegionManager.setup(this, mNotificationShadeWindowView);
|
mStatusBarTouchableRegionManager.setup(this, getNotificationShadeWindowView());
|
||||||
|
|
||||||
createNavigationBar(result);
|
createNavigationBar(result);
|
||||||
|
|
||||||
@@ -1279,7 +1281,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mLockscreenWallpaper = mLockscreenWallpaperLazy.get();
|
mLockscreenWallpaper = mLockscreenWallpaperLazy.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
mAmbientIndicationContainer = mNotificationShadeWindowView.findViewById(
|
mAmbientIndicationContainer = getNotificationShadeWindowView().findViewById(
|
||||||
R.id.ambient_indication_container);
|
R.id.ambient_indication_container);
|
||||||
|
|
||||||
mAutoHideController.setStatusBar(new AutoHideUiElement() {
|
mAutoHideController.setStatusBar(new AutoHideUiElement() {
|
||||||
@@ -1304,10 +1306,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ScrimView scrimBehind = mNotificationShadeWindowView.findViewById(R.id.scrim_behind);
|
ScrimView scrimBehind = getNotificationShadeWindowView().findViewById(R.id.scrim_behind);
|
||||||
ScrimView notificationsScrim = mNotificationShadeWindowView
|
ScrimView notificationsScrim = getNotificationShadeWindowView()
|
||||||
.findViewById(R.id.scrim_notifications);
|
.findViewById(R.id.scrim_notifications);
|
||||||
ScrimView scrimInFront = mNotificationShadeWindowView.findViewById(R.id.scrim_in_front);
|
ScrimView scrimInFront = getNotificationShadeWindowView().findViewById(R.id.scrim_in_front);
|
||||||
|
|
||||||
mScrimController.setScrimVisibleListener(scrimsVisible -> {
|
mScrimController.setScrimVisibleListener(scrimsVisible -> {
|
||||||
mNotificationShadeWindowController.setScrimsVisibility(scrimsVisible);
|
mNotificationShadeWindowController.setScrimsVisibility(scrimsVisible);
|
||||||
@@ -1345,7 +1347,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mNotificationShelfController,
|
mNotificationShelfController,
|
||||||
mHeadsUpManager);
|
mHeadsUpManager);
|
||||||
|
|
||||||
BackDropView backdrop = mNotificationShadeWindowView.findViewById(R.id.backdrop);
|
BackDropView backdrop = getNotificationShadeWindowView().findViewById(R.id.backdrop);
|
||||||
if (mWallpaperManager.isLockscreenLiveWallpaperEnabled()) {
|
if (mWallpaperManager.isLockscreenLiveWallpaperEnabled()) {
|
||||||
mMediaManager.setup(null, null, null, mScrimController, null);
|
mMediaManager.setup(null, null, null, mScrimController, null);
|
||||||
} else {
|
} else {
|
||||||
@@ -1364,7 +1366,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Set up the quick settings tile panel
|
// Set up the quick settings tile panel
|
||||||
final View container = mNotificationShadeWindowView.findViewById(R.id.qs_frame);
|
final View container = getNotificationShadeWindowView().findViewById(R.id.qs_frame);
|
||||||
if (container != null) {
|
if (container != null) {
|
||||||
FragmentHostManager fragmentHostManager =
|
FragmentHostManager fragmentHostManager =
|
||||||
mFragmentService.getFragmentHostManager(container);
|
mFragmentService.getFragmentHostManager(container);
|
||||||
@@ -1379,7 +1381,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
.withDefault(this::createDefaultQSFragment)
|
.withDefault(this::createDefaultQSFragment)
|
||||||
.build());
|
.build());
|
||||||
mBrightnessMirrorController = new BrightnessMirrorController(
|
mBrightnessMirrorController = new BrightnessMirrorController(
|
||||||
mNotificationShadeWindowView,
|
getNotificationShadeWindowView(),
|
||||||
mShadeSurface,
|
mShadeSurface,
|
||||||
mNotificationShadeDepthControllerLazy.get(),
|
mNotificationShadeDepthControllerLazy.get(),
|
||||||
mBrightnessSliderFactory,
|
mBrightnessSliderFactory,
|
||||||
@@ -1396,7 +1398,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mReportRejectedTouch = mNotificationShadeWindowView
|
mReportRejectedTouch = getNotificationShadeWindowView()
|
||||||
.findViewById(R.id.report_rejected_touch);
|
.findViewById(R.id.report_rejected_touch);
|
||||||
if (mReportRejectedTouch != null) {
|
if (mReportRejectedTouch != null) {
|
||||||
updateReportRejectedTouchVisibility();
|
updateReportRejectedTouchVisibility();
|
||||||
@@ -1544,7 +1546,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
|
|
||||||
protected QS createDefaultQSFragment() {
|
protected QS createDefaultQSFragment() {
|
||||||
return mFragmentService
|
return mFragmentService
|
||||||
.getFragmentHostManager(mNotificationShadeWindowView)
|
.getFragmentHostManager(getNotificationShadeWindowView())
|
||||||
.create(QSFragment.class);
|
.create(QSFragment.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1553,7 +1555,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mActivityLaunchAnimator.setCallback(mActivityLaunchAnimatorCallback);
|
mActivityLaunchAnimator.setCallback(mActivityLaunchAnimatorCallback);
|
||||||
mActivityLaunchAnimator.addListener(mActivityLaunchAnimatorListener);
|
mActivityLaunchAnimator.addListener(mActivityLaunchAnimatorListener);
|
||||||
mNotificationAnimationProvider = new NotificationLaunchAnimatorControllerProvider(
|
mNotificationAnimationProvider = new NotificationLaunchAnimatorControllerProvider(
|
||||||
mNotificationShadeWindowViewController,
|
getNotificationShadeWindowViewController(),
|
||||||
mNotifListContainer,
|
mNotifListContainer,
|
||||||
mHeadsUpManager,
|
mHeadsUpManager,
|
||||||
mJankMonitor);
|
mJankMonitor);
|
||||||
@@ -1592,7 +1594,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mAutoHideController.checkUserAutoHide(event);
|
mAutoHideController.checkUserAutoHide(event);
|
||||||
mRemoteInputManager.checkRemoteInputOutside(event);
|
mRemoteInputManager.checkRemoteInputOutside(event);
|
||||||
mShadeController.onStatusBarTouch(event);
|
mShadeController.onStatusBarTouch(event);
|
||||||
return mNotificationShadeWindowView.onTouchEvent(event);
|
return getNotificationShadeWindowView().onTouchEvent(event);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1606,15 +1608,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mCentralSurfacesComponent::createCollapsedStatusBarFragment);
|
mCentralSurfacesComponent::createCollapsedStatusBarFragment);
|
||||||
|
|
||||||
ViewGroup windowRootView = mCentralSurfacesComponent.getWindowRootView();
|
ViewGroup windowRootView = mCentralSurfacesComponent.getWindowRootView();
|
||||||
mNotificationShadeWindowView = mCentralSurfacesComponent.getNotificationShadeWindowView();
|
|
||||||
mNotificationShadeWindowViewController = mCentralSurfacesComponent
|
|
||||||
.getNotificationShadeWindowViewController();
|
|
||||||
// TODO(b/277762009): Inject [NotificationShadeWindowView] directly into the controller.
|
// TODO(b/277762009): Inject [NotificationShadeWindowView] directly into the controller.
|
||||||
// (Right now, there's a circular dependency.)
|
// (Right now, there's a circular dependency.)
|
||||||
mNotificationShadeWindowController.setWindowRootView(windowRootView);
|
mNotificationShadeWindowController.setWindowRootView(windowRootView);
|
||||||
mNotificationShadeWindowViewController.setupExpandedStatusBar();
|
getNotificationShadeWindowViewController().setupExpandedStatusBar();
|
||||||
mShadeController.setNotificationShadeWindowViewController(
|
mShadeController.setNotificationShadeWindowViewController(
|
||||||
mNotificationShadeWindowViewController);
|
getNotificationShadeWindowViewController());
|
||||||
mBackActionInteractor.setup(mQsController, mShadeSurface);
|
mBackActionInteractor.setup(mQsController, mShadeSurface);
|
||||||
mPresenter = mCentralSurfacesComponent.getNotificationPresenter();
|
mPresenter = mCentralSurfacesComponent.getNotificationPresenter();
|
||||||
mNotificationActivityStarter = mCentralSurfacesComponent.getNotificationActivityStarter();
|
mNotificationActivityStarter = mCentralSurfacesComponent.getNotificationActivityStarter();
|
||||||
@@ -1633,6 +1632,14 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mCommandQueue.addCallback(mCommandQueueCallbacks);
|
mCommandQueue.addCallback(mCommandQueueCallbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected NotificationShadeWindowViewController getNotificationShadeWindowViewController() {
|
||||||
|
return mNotificationShadeWindowViewControllerLazy.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected NotificationShadeWindowView getNotificationShadeWindowView() {
|
||||||
|
return getNotificationShadeWindowViewController().getView();
|
||||||
|
}
|
||||||
|
|
||||||
protected void startKeyguard() {
|
protected void startKeyguard() {
|
||||||
Trace.beginSection("CentralSurfaces#startKeyguard");
|
Trace.beginSection("CentralSurfaces#startKeyguard");
|
||||||
mStatusBarStateController.addCallback(mStateListener,
|
mStatusBarStateController.addCallback(mStateListener,
|
||||||
@@ -1688,7 +1695,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuthKeyguardMessageArea getKeyguardMessageArea() {
|
public AuthKeyguardMessageArea getKeyguardMessageArea() {
|
||||||
return mNotificationShadeWindowViewController.getKeyguardMessageArea();
|
return getNotificationShadeWindowViewController().getKeyguardMessageArea();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1982,11 +1989,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
pw.print(" mWallpaperSupported= "); pw.println(mWallpaperSupported);
|
pw.print(" mWallpaperSupported= "); pw.println(mWallpaperSupported);
|
||||||
|
|
||||||
pw.println(" ShadeWindowView: ");
|
pw.println(" ShadeWindowView: ");
|
||||||
if (mNotificationShadeWindowViewController != null) {
|
getNotificationShadeWindowViewController().dump(pw, args);
|
||||||
mNotificationShadeWindowViewController.dump(pw, args);
|
CentralSurfaces.dumpBarTransitions(
|
||||||
CentralSurfaces.dumpBarTransitions(
|
pw, "PhoneStatusBarTransitions", mStatusBarTransitions);
|
||||||
pw, "PhoneStatusBarTransitions", mStatusBarTransitions);
|
|
||||||
}
|
|
||||||
|
|
||||||
pw.println(" mMediaManager: ");
|
pw.println(" mMediaManager: ");
|
||||||
if (mMediaManager != null) {
|
if (mMediaManager != null) {
|
||||||
@@ -2860,7 +2865,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
updateVisibleToUser();
|
updateVisibleToUser();
|
||||||
|
|
||||||
updateNotificationPanelTouchState();
|
updateNotificationPanelTouchState();
|
||||||
mNotificationShadeWindowViewController.cancelCurrentTouch();
|
getNotificationShadeWindowViewController().cancelCurrentTouch();
|
||||||
if (mLaunchCameraOnFinishedGoingToSleep) {
|
if (mLaunchCameraOnFinishedGoingToSleep) {
|
||||||
mLaunchCameraOnFinishedGoingToSleep = false;
|
mLaunchCameraOnFinishedGoingToSleep = false;
|
||||||
|
|
||||||
@@ -3172,12 +3177,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
updateScrimController();
|
updateScrimController();
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public void setNotificationShadeWindowViewController(
|
|
||||||
NotificationShadeWindowViewController nswvc) {
|
|
||||||
mNotificationShadeWindowViewController = nswvc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the amount of progress we are currently in if we're transitioning to the full shade.
|
* Set the amount of progress we are currently in if we're transitioning to the full shade.
|
||||||
* 0.0f means we're not transitioning yet, while 1 means we're all the way in the full
|
* 0.0f means we're not transitioning yet, while 1 means we're all the way in the full
|
||||||
@@ -3412,7 +3411,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
|||||||
mVisible = visible;
|
mVisible = visible;
|
||||||
if (visible) {
|
if (visible) {
|
||||||
DejankUtils.notifyRendererOfExpensiveFrame(
|
DejankUtils.notifyRendererOfExpensiveFrame(
|
||||||
mNotificationShadeWindowView, "onShadeVisibilityChanged");
|
getNotificationShadeWindowView(), "onShadeVisibilityChanged");
|
||||||
} else {
|
} else {
|
||||||
mGutsManager.closeAndSaveGuts(true /* removeLeavebehind */, true /* force */,
|
mGutsManager.closeAndSaveGuts(true /* removeLeavebehind */, true /* force */,
|
||||||
true /* removeControls */, -1 /* x */, -1 /* y */, true /* resetMenu */);
|
true /* removeControls */, -1 /* x */, -1 /* y */, true /* resetMenu */);
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ 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.NotificationShadeWindowView;
|
|
||||||
import com.android.systemui.shade.NotificationShadeWindowViewController;
|
|
||||||
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;
|
||||||
@@ -76,16 +74,6 @@ public interface CentralSurfacesComponent {
|
|||||||
/** Creates the root view of the main SysUI window}. */
|
/** Creates the root view of the main SysUI window}. */
|
||||||
WindowRootView getWindowRootView();
|
WindowRootView getWindowRootView();
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates or returns a {@link NotificationShadeWindowView}.
|
|
||||||
*/
|
|
||||||
NotificationShadeWindowView getNotificationShadeWindowView();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a NotificationShadeWindowViewController.
|
|
||||||
*/
|
|
||||||
NotificationShadeWindowViewController getNotificationShadeWindowViewController();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a StatusBarHeadsUpChangeListener.
|
* Creates a StatusBarHeadsUpChangeListener.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ import com.android.systemui.settings.brightness.BrightnessSliderController;
|
|||||||
import com.android.systemui.shade.CameraLauncher;
|
import com.android.systemui.shade.CameraLauncher;
|
||||||
import com.android.systemui.shade.NotificationPanelView;
|
import com.android.systemui.shade.NotificationPanelView;
|
||||||
import com.android.systemui.shade.NotificationPanelViewController;
|
import com.android.systemui.shade.NotificationPanelViewController;
|
||||||
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;
|
||||||
import com.android.systemui.shade.ShadeController;
|
import com.android.systemui.shade.ShadeController;
|
||||||
@@ -252,7 +251,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Mock private NotificationLogger.ExpansionStateLogger mExpansionStateLogger;
|
@Mock private NotificationLogger.ExpansionStateLogger mExpansionStateLogger;
|
||||||
@Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
@Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||||
@Mock private StatusBarSignalPolicy mStatusBarSignalPolicy;
|
@Mock private StatusBarSignalPolicy mStatusBarSignalPolicy;
|
||||||
@Mock private NotificationShadeWindowView mNotificationShadeWindowView;
|
|
||||||
@Mock private BroadcastDispatcher mBroadcastDispatcher;
|
@Mock private BroadcastDispatcher mBroadcastDispatcher;
|
||||||
@Mock private AssistManager mAssistManager;
|
@Mock private AssistManager mAssistManager;
|
||||||
@Mock private NotificationGutsManager mNotificationGutsManager;
|
@Mock private NotificationGutsManager mNotificationGutsManager;
|
||||||
@@ -276,6 +274,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
@Mock private NotificationShadeWindowController mNotificationShadeWindowController;
|
@Mock private NotificationShadeWindowController mNotificationShadeWindowController;
|
||||||
@Mock private NotificationIconAreaController mNotificationIconAreaController;
|
@Mock private NotificationIconAreaController mNotificationIconAreaController;
|
||||||
@Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
|
@Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
|
||||||
|
@Mock private Lazy<NotificationShadeWindowViewController>
|
||||||
|
mNotificationShadeWindowViewControllerLazy;
|
||||||
@Mock private NotificationShelfController mNotificationShelfController;
|
@Mock private NotificationShelfController mNotificationShelfController;
|
||||||
@Mock private DozeParameters mDozeParameters;
|
@Mock private DozeParameters mDozeParameters;
|
||||||
@Mock private Lazy<LockscreenWallpaper> mLockscreenWallpaperLazy;
|
@Mock private Lazy<LockscreenWallpaper> mLockscreenWallpaperLazy;
|
||||||
@@ -428,10 +428,10 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
when(mLockscreenWallpaperLazy.get()).thenReturn(mLockscreenWallpaper);
|
when(mLockscreenWallpaperLazy.get()).thenReturn(mLockscreenWallpaper);
|
||||||
when(mBiometricUnlockControllerLazy.get()).thenReturn(mBiometricUnlockController);
|
when(mBiometricUnlockControllerLazy.get()).thenReturn(mBiometricUnlockController);
|
||||||
when(mCameraLauncherLazy.get()).thenReturn(mCameraLauncher);
|
when(mCameraLauncherLazy.get()).thenReturn(mCameraLauncher);
|
||||||
|
when(mNotificationShadeWindowViewControllerLazy.get())
|
||||||
|
.thenReturn(mNotificationShadeWindowViewController);
|
||||||
|
|
||||||
when(mStatusBarComponentFactory.create()).thenReturn(mCentralSurfacesComponent);
|
when(mStatusBarComponentFactory.create()).thenReturn(mCentralSurfacesComponent);
|
||||||
when(mCentralSurfacesComponent.getNotificationShadeWindowViewController()).thenReturn(
|
|
||||||
mNotificationShadeWindowViewController);
|
|
||||||
doAnswer(invocation -> {
|
doAnswer(invocation -> {
|
||||||
((Runnable) invocation.getArgument(0)).run();
|
((Runnable) invocation.getArgument(0)).run();
|
||||||
return null;
|
return null;
|
||||||
@@ -510,6 +510,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
() -> mAssistManager,
|
() -> mAssistManager,
|
||||||
configurationController,
|
configurationController,
|
||||||
mNotificationShadeWindowController,
|
mNotificationShadeWindowController,
|
||||||
|
mNotificationShadeWindowViewControllerLazy,
|
||||||
mNotificationShelfController,
|
mNotificationShelfController,
|
||||||
mStackScrollerController,
|
mStackScrollerController,
|
||||||
mDozeParameters,
|
mDozeParameters,
|
||||||
@@ -586,9 +587,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
when(mKeyguardViewMediator.getViewMediatorCallback()).thenReturn(
|
when(mKeyguardViewMediator.getViewMediatorCallback()).thenReturn(
|
||||||
mKeyguardVieMediatorCallback);
|
mKeyguardVieMediatorCallback);
|
||||||
|
|
||||||
// TODO: we should be able to call mCentralSurfaces.start() and have all the below values
|
// TODO(b/277764509): we should be able to call mCentralSurfaces.start() and have all the
|
||||||
// initialized automatically and make NPVC private.
|
// below values initialized automatically.
|
||||||
mCentralSurfaces.mNotificationShadeWindowView = mNotificationShadeWindowView;
|
|
||||||
mCentralSurfaces.mDozeScrimController = mDozeScrimController;
|
mCentralSurfaces.mDozeScrimController = mDozeScrimController;
|
||||||
mCentralSurfaces.mPresenter = mNotificationPresenter;
|
mCentralSurfaces.mPresenter = mNotificationPresenter;
|
||||||
mCentralSurfaces.mKeyguardIndicationController = mKeyguardIndicationController;
|
mCentralSurfaces.mKeyguardIndicationController = mKeyguardIndicationController;
|
||||||
@@ -823,8 +823,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testPredictiveBackCallback_invocationCollapsesPanel() {
|
public void testPredictiveBackCallback_invocationCollapsesPanel() {
|
||||||
mCentralSurfaces.setNotificationShadeWindowViewController(
|
|
||||||
mNotificationShadeWindowViewController);
|
|
||||||
mCentralSurfaces.handleVisibleToUserChanged(true);
|
mCentralSurfaces.handleVisibleToUserChanged(true);
|
||||||
verify(mOnBackInvokedDispatcher).registerOnBackInvokedCallback(
|
verify(mOnBackInvokedDispatcher).registerOnBackInvokedCallback(
|
||||||
eq(OnBackInvokedDispatcher.PRIORITY_DEFAULT),
|
eq(OnBackInvokedDispatcher.PRIORITY_DEFAULT),
|
||||||
@@ -841,8 +839,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testPredictiveBackAnimation_progressMaxScalesPanel() {
|
public void testPredictiveBackAnimation_progressMaxScalesPanel() {
|
||||||
mCentralSurfaces.setNotificationShadeWindowViewController(
|
|
||||||
mNotificationShadeWindowViewController);
|
|
||||||
mCentralSurfaces.handleVisibleToUserChanged(true);
|
mCentralSurfaces.handleVisibleToUserChanged(true);
|
||||||
verify(mOnBackInvokedDispatcher).registerOnBackInvokedCallback(
|
verify(mOnBackInvokedDispatcher).registerOnBackInvokedCallback(
|
||||||
eq(OnBackInvokedDispatcher.PRIORITY_DEFAULT),
|
eq(OnBackInvokedDispatcher.PRIORITY_DEFAULT),
|
||||||
@@ -864,8 +860,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testPredictiveBackAnimation_progressMinScalesPanel() {
|
public void testPredictiveBackAnimation_progressMinScalesPanel() {
|
||||||
mCentralSurfaces.setNotificationShadeWindowViewController(
|
|
||||||
mNotificationShadeWindowViewController);
|
|
||||||
mCentralSurfaces.handleVisibleToUserChanged(true);
|
mCentralSurfaces.handleVisibleToUserChanged(true);
|
||||||
verify(mOnBackInvokedDispatcher).registerOnBackInvokedCallback(
|
verify(mOnBackInvokedDispatcher).registerOnBackInvokedCallback(
|
||||||
eq(OnBackInvokedDispatcher.PRIORITY_DEFAULT),
|
eq(OnBackInvokedDispatcher.PRIORITY_DEFAULT),
|
||||||
|
|||||||
Reference in New Issue
Block a user