Merge changes from topic "b288868098_delGetSvc" into udc-qpr-dev
* changes: Delete CentralSurfaces.getShadeViewController Remove getShadeViewController calls Remove getShadeViewController calls Remove getShadeViewController calls Remove getShadeViewController calls
This commit is contained in:
@@ -54,6 +54,7 @@ import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.settings.DisplayTracker;
|
||||
import com.android.systemui.settings.UserTracker;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeViewController;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.phone.CentralSurfaces;
|
||||
@@ -188,6 +189,7 @@ public class SystemActions implements CoreStartable {
|
||||
private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
|
||||
private final NotificationShadeWindowController mNotificationShadeController;
|
||||
private final ShadeController mShadeController;
|
||||
private final Lazy<ShadeViewController> mShadeViewController;
|
||||
private final StatusBarWindowCallback mNotificationShadeCallback;
|
||||
private boolean mDismissNotificationShadeActionRegistered;
|
||||
|
||||
@@ -196,12 +198,14 @@ public class SystemActions implements CoreStartable {
|
||||
UserTracker userTracker,
|
||||
NotificationShadeWindowController notificationShadeController,
|
||||
ShadeController shadeController,
|
||||
Lazy<ShadeViewController> shadeViewController,
|
||||
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
|
||||
Optional<Recents> recentsOptional,
|
||||
DisplayTracker displayTracker) {
|
||||
mContext = context;
|
||||
mUserTracker = userTracker;
|
||||
mShadeController = shadeController;
|
||||
mShadeViewController = shadeViewController;
|
||||
mRecentsOptional = recentsOptional;
|
||||
mDisplayTracker = displayTracker;
|
||||
mReceiver = new SystemActionsBroadcastReceiver();
|
||||
@@ -330,8 +334,7 @@ public class SystemActions implements CoreStartable {
|
||||
final Optional<CentralSurfaces> centralSurfacesOptional =
|
||||
mCentralSurfacesOptionalLazy.get();
|
||||
if (centralSurfacesOptional.isPresent()
|
||||
&& centralSurfacesOptional.get().getShadeViewController() != null
|
||||
&& centralSurfacesOptional.get().getShadeViewController().isPanelExpanded()
|
||||
&& mShadeViewController.get().isPanelExpanded()
|
||||
&& !centralSurfacesOptional.get().isKeyguardShowing()) {
|
||||
if (!mDismissNotificationShadeActionRegistered) {
|
||||
mA11yManager.registerSystemAction(
|
||||
|
||||
@@ -37,12 +37,15 @@ import javax.inject.Named;
|
||||
*/
|
||||
public class ShadeTouchHandler implements DreamTouchHandler {
|
||||
private final Optional<CentralSurfaces> mSurfaces;
|
||||
private final ShadeViewController mShadeViewController;
|
||||
private final int mInitiationHeight;
|
||||
|
||||
@Inject
|
||||
ShadeTouchHandler(Optional<CentralSurfaces> centralSurfaces,
|
||||
ShadeViewController shadeViewController,
|
||||
@Named(NOTIFICATION_SHADE_GESTURE_INITIATION_HEIGHT) int initiationHeight) {
|
||||
mSurfaces = centralSurfaces;
|
||||
mShadeViewController = shadeViewController;
|
||||
mInitiationHeight = initiationHeight;
|
||||
}
|
||||
|
||||
@@ -54,12 +57,7 @@ public class ShadeTouchHandler implements DreamTouchHandler {
|
||||
}
|
||||
|
||||
session.registerInputListener(ev -> {
|
||||
final ShadeViewController viewController =
|
||||
mSurfaces.map(CentralSurfaces::getShadeViewController).orElse(null);
|
||||
|
||||
if (viewController != null) {
|
||||
viewController.handleExternalTouch((MotionEvent) ev);
|
||||
}
|
||||
mShadeViewController.handleExternalTouch((MotionEvent) ev);
|
||||
|
||||
if (ev instanceof MotionEvent) {
|
||||
if (((MotionEvent) ev).getAction() == MotionEvent.ACTION_UP) {
|
||||
|
||||
@@ -133,6 +133,7 @@ import com.android.systemui.settings.DisplayTracker;
|
||||
import com.android.systemui.settings.UserContextProvider;
|
||||
import com.android.systemui.settings.UserTracker;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeViewController;
|
||||
import com.android.systemui.shared.navigationbar.RegionSamplingHelper;
|
||||
import com.android.systemui.shared.recents.utilities.Utilities;
|
||||
import com.android.systemui.shared.rotation.RotationButton;
|
||||
@@ -199,6 +200,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
private final SysUiState mSysUiFlagsContainer;
|
||||
private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
|
||||
private final ShadeController mShadeController;
|
||||
private final ShadeViewController mShadeViewController;
|
||||
private final NotificationRemoteInputManager mNotificationRemoteInputManager;
|
||||
private final OverviewProxyService mOverviewProxyService;
|
||||
private final NavigationModeController mNavigationModeController;
|
||||
@@ -523,6 +525,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
@Inject
|
||||
NavigationBar(
|
||||
NavigationBarView navigationBarView,
|
||||
ShadeController shadeController,
|
||||
NavigationBarFrame navigationBarFrame,
|
||||
@Nullable Bundle savedState,
|
||||
@DisplayId Context context,
|
||||
@@ -541,7 +544,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
Optional<Pip> pipOptional,
|
||||
Optional<Recents> recentsOptional,
|
||||
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
|
||||
ShadeController shadeController,
|
||||
ShadeViewController shadeViewController,
|
||||
NotificationRemoteInputManager notificationRemoteInputManager,
|
||||
NotificationShadeDepthController notificationShadeDepthController,
|
||||
@Main Handler mainHandler,
|
||||
@@ -577,6 +580,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
mSysUiFlagsContainer = sysUiFlagsContainer;
|
||||
mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy;
|
||||
mShadeController = shadeController;
|
||||
mShadeViewController = shadeViewController;
|
||||
mNotificationRemoteInputManager = notificationRemoteInputManager;
|
||||
mOverviewProxyService = overviewProxyService;
|
||||
mNavigationModeController = navigationModeController;
|
||||
@@ -739,8 +743,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
final Display display = mView.getDisplay();
|
||||
mView.setComponents(mRecentsOptional);
|
||||
if (mCentralSurfacesOptionalLazy.get().isPresent()) {
|
||||
mView.setComponents(
|
||||
mCentralSurfacesOptionalLazy.get().get().getShadeViewController());
|
||||
mView.setComponents(mShadeViewController);
|
||||
}
|
||||
mView.setDisabledFlags(mDisabledFlags1, mSysUiFlagsContainer);
|
||||
mView.setOnVerticalChangedListener(this::onVerticalChanged);
|
||||
@@ -1341,9 +1344,10 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
}
|
||||
|
||||
private void onVerticalChanged(boolean isVertical) {
|
||||
Optional<CentralSurfaces> cs = mCentralSurfacesOptionalLazy.get();
|
||||
if (cs.isPresent() && cs.get().getShadeViewController() != null) {
|
||||
cs.get().getShadeViewController().setQsScrimEnabled(!isVertical);
|
||||
// This check can probably be safely removed. It only remained to reduce regression
|
||||
// risk for a broad change that removed the CentralSurfaces reference in the if block
|
||||
if (mCentralSurfacesOptionalLazy.get().isPresent()) {
|
||||
mShadeViewController.setQsScrimEnabled(!isVertical);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.app.AssistUtils;
|
||||
import com.android.internal.app.IVoiceInteractionSessionListener;
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.internal.policy.ScreenDecorationsUtils;
|
||||
import com.android.internal.util.ScreenshotHelper;
|
||||
import com.android.internal.util.ScreenshotRequest;
|
||||
import com.android.systemui.Dumpable;
|
||||
@@ -143,6 +142,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
||||
private final Executor mMainExecutor;
|
||||
private final ShellInterface mShellInterface;
|
||||
private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
|
||||
private final Lazy<ShadeViewController> mShadeViewControllerLazy;
|
||||
private SysUiState mSysUiState;
|
||||
private final Handler mHandler;
|
||||
private final Lazy<NavigationBarController> mNavBarControllerLazy;
|
||||
@@ -201,11 +201,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
||||
// TODO move this logic to message queue
|
||||
mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> {
|
||||
if (event.getActionMasked() == ACTION_DOWN) {
|
||||
ShadeViewController shadeViewController =
|
||||
centralSurfaces.getShadeViewController();
|
||||
if (shadeViewController != null) {
|
||||
shadeViewController.startExpandLatencyTracking();
|
||||
}
|
||||
mShadeViewControllerLazy.get().startExpandLatencyTracking();
|
||||
}
|
||||
mHandler.post(() -> {
|
||||
int action = event.getActionMasked();
|
||||
@@ -552,8 +548,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
||||
ShellInterface shellInterface,
|
||||
Lazy<NavigationBarController> navBarControllerLazy,
|
||||
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
|
||||
Lazy<ShadeViewController> shadeViewControllerLazy,
|
||||
NavigationModeController navModeController,
|
||||
NotificationShadeWindowController statusBarWinController, SysUiState sysUiState,
|
||||
NotificationShadeWindowController statusBarWinController,
|
||||
SysUiState sysUiState,
|
||||
UserTracker userTracker,
|
||||
ScreenLifecycle screenLifecycle,
|
||||
WakefulnessLifecycle wakefulnessLifecycle,
|
||||
@@ -573,6 +571,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
||||
mMainExecutor = mainExecutor;
|
||||
mShellInterface = shellInterface;
|
||||
mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy;
|
||||
mShadeViewControllerLazy = shadeViewControllerLazy;
|
||||
mHandler = new Handler();
|
||||
mNavBarControllerLazy = navBarControllerLazy;
|
||||
mStatusBarWinController = statusBarWinController;
|
||||
@@ -677,13 +676,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
||||
mNavBarControllerLazy.get().getDefaultNavigationBar();
|
||||
final NavigationBarView navBarView =
|
||||
mNavBarControllerLazy.get().getNavigationBarView(mContext.getDisplayId());
|
||||
final ShadeViewController panelController =
|
||||
mCentralSurfacesOptionalLazy.get()
|
||||
.map(CentralSurfaces::getShadeViewController)
|
||||
.orElse(null);
|
||||
if (SysUiState.DEBUG) {
|
||||
Log.d(TAG_OPS, "Updating sysui state flags: navBarFragment=" + navBarFragment
|
||||
+ " navBarView=" + navBarView + " panelController=" + panelController);
|
||||
+ " navBarView=" + navBarView
|
||||
+ " shadeViewController=" + mShadeViewControllerLazy.get());
|
||||
}
|
||||
|
||||
if (navBarFragment != null) {
|
||||
@@ -692,9 +688,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
|
||||
if (navBarView != null) {
|
||||
navBarView.updateDisabledSystemUiStateFlags(mSysUiState);
|
||||
}
|
||||
if (panelController != null) {
|
||||
panelController.updateSystemUiStateFlags();
|
||||
}
|
||||
mShadeViewControllerLazy.get().updateSystemUiStateFlags();
|
||||
if (mStatusBarWinController != null) {
|
||||
mStatusBarWinController.notifyStateChangedCallbacks();
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.android.systemui.plugins.ActivityStarter
|
||||
import com.android.systemui.plugins.ActivityStarter.OnDismissAction
|
||||
import com.android.systemui.settings.UserTracker
|
||||
import com.android.systemui.shade.ShadeController
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||
@@ -69,6 +70,7 @@ constructor(
|
||||
private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>,
|
||||
private val keyguardViewMediatorLazy: Lazy<KeyguardViewMediator>,
|
||||
private val shadeControllerLazy: Lazy<ShadeController>,
|
||||
private val shadeViewControllerLazy: Lazy<ShadeViewController>,
|
||||
private val statusBarKeyguardViewManagerLazy: Lazy<StatusBarKeyguardViewManager>,
|
||||
private val notifShadeWindowControllerLazy: Lazy<NotificationShadeWindowController>,
|
||||
private val activityLaunchAnimator: ActivityLaunchAnimator,
|
||||
@@ -896,7 +898,7 @@ constructor(
|
||||
if (dismissShade) {
|
||||
return StatusBarLaunchAnimatorController(
|
||||
animationController,
|
||||
it.shadeViewController,
|
||||
shadeViewControllerLazy.get(),
|
||||
shadeControllerLazy.get(),
|
||||
notifShadeWindowControllerLazy.get(),
|
||||
isLaunchForActivity
|
||||
|
||||
@@ -44,7 +44,6 @@ import com.android.systemui.display.data.repository.DisplayMetricsRepository;
|
||||
import com.android.systemui.navigationbar.NavigationBarView;
|
||||
import com.android.systemui.plugins.ActivityStarter.OnDismissAction;
|
||||
import com.android.systemui.qs.QSPanelController;
|
||||
import com.android.systemui.shade.ShadeViewController;
|
||||
import com.android.systemui.shared.system.RemoteAnimationRunnerCompat;
|
||||
import com.android.systemui.statusbar.NotificationPresenter;
|
||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||
@@ -195,9 +194,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {
|
||||
@Override
|
||||
Lifecycle getLifecycle();
|
||||
|
||||
/** */
|
||||
ShadeViewController getShadeViewController();
|
||||
|
||||
/** Get the Keyguard Message Area that displays auth messages. */
|
||||
AuthKeyguardMessageArea getKeyguardMessageArea();
|
||||
|
||||
|
||||
@@ -1326,7 +1326,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
||||
}
|
||||
});
|
||||
|
||||
mScreenOffAnimationController.initialize(this, mLightRevealScrim);
|
||||
mScreenOffAnimationController.initialize(this, mShadeSurface, mLightRevealScrim);
|
||||
updateLightRevealScrimVisibility();
|
||||
|
||||
mShadeSurface.initDependencies(
|
||||
@@ -1677,8 +1677,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShadeViewController getShadeViewController() {
|
||||
protected ShadeViewController getShadeViewController() {
|
||||
return mShadeSurface;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone
|
||||
import android.view.View
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.statusbar.LightRevealScrim
|
||||
import com.android.systemui.unfold.FoldAodAnimationController
|
||||
import com.android.systemui.unfold.SysUIUnfoldComponent
|
||||
@@ -37,8 +38,12 @@ class ScreenOffAnimationController @Inject constructor(
|
||||
private val animations: List<ScreenOffAnimation> =
|
||||
listOfNotNull(foldToAodAnimation, unlockedScreenOffAnimation)
|
||||
|
||||
fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) {
|
||||
animations.forEach { it.initialize(centralSurfaces, lightRevealScrim) }
|
||||
fun initialize(
|
||||
centralSurfaces: CentralSurfaces,
|
||||
shadeViewController: ShadeViewController,
|
||||
lightRevealScrim: LightRevealScrim,
|
||||
) {
|
||||
animations.forEach { it.initialize(centralSurfaces, shadeViewController, lightRevealScrim) }
|
||||
wakefulnessLifecycle.addObserver(this)
|
||||
}
|
||||
|
||||
@@ -197,7 +202,11 @@ class ScreenOffAnimationController @Inject constructor(
|
||||
}
|
||||
|
||||
interface ScreenOffAnimation {
|
||||
fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) {}
|
||||
fun initialize(
|
||||
centralSurfaces: CentralSurfaces,
|
||||
shadeViewController: ShadeViewController,
|
||||
lightRevealScrim: LightRevealScrim,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Called when started going to sleep, should return true if the animation will be played
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.android.app.animation.Interpolators
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.statusbar.CircleReveal
|
||||
import com.android.systemui.statusbar.LightRevealScrim
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController
|
||||
@@ -66,7 +67,8 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
private val powerManager: PowerManager,
|
||||
private val handler: Handler = Handler()
|
||||
) : WakefulnessLifecycle.Observer, ScreenOffAnimation {
|
||||
private lateinit var mCentralSurfaces: CentralSurfaces
|
||||
private lateinit var centralSurfaces: CentralSurfaces
|
||||
private lateinit var shadeViewController: ShadeViewController
|
||||
/**
|
||||
* Whether or not [initialize] has been called to provide us with the StatusBar,
|
||||
* NotificationPanelViewController, and LightRevealSrim so that we can run the unlocked screen
|
||||
@@ -126,7 +128,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
lightRevealAnimator.start()
|
||||
}
|
||||
|
||||
val animatorDurationScaleObserver = object : ContentObserver(null) {
|
||||
private val animatorDurationScaleObserver = object : ContentObserver(null) {
|
||||
override fun onChange(selfChange: Boolean) {
|
||||
updateAnimatorDurationScale()
|
||||
}
|
||||
@@ -134,11 +136,13 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
|
||||
override fun initialize(
|
||||
centralSurfaces: CentralSurfaces,
|
||||
shadeViewController: ShadeViewController,
|
||||
lightRevealScrim: LightRevealScrim
|
||||
) {
|
||||
this.initialized = true
|
||||
this.lightRevealScrim = lightRevealScrim
|
||||
this.mCentralSurfaces = centralSurfaces
|
||||
this.centralSurfaces = centralSurfaces
|
||||
this.shadeViewController = shadeViewController
|
||||
|
||||
updateAnimatorDurationScale()
|
||||
globalSettings.registerContentObserver(
|
||||
@@ -198,7 +202,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
|
||||
// Tell the CentralSurfaces to become keyguard for real - we waited on that
|
||||
// since it is slow and would have caused the animation to jank.
|
||||
mCentralSurfaces.updateIsKeyguard()
|
||||
centralSurfaces.updateIsKeyguard()
|
||||
|
||||
// Run the callback given to us by the KeyguardVisibilityHelper.
|
||||
after.run()
|
||||
@@ -251,7 +255,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
// even if we're going from SHADE to SHADE or KEYGUARD to KEYGUARD, since we might have
|
||||
// changed parts of the UI (such as showing AOD in the shade) without actually changing
|
||||
// the StatusBarState. This ensures that the UI definitely reflects the desired state.
|
||||
mCentralSurfaces.updateIsKeyguard(true /* forceStateChange */)
|
||||
centralSurfaces.updateIsKeyguard(true /* forceStateChange */)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +284,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
|
||||
// Show AOD. That'll cause the KeyguardVisibilityHelper to call
|
||||
// #animateInKeyguard.
|
||||
mCentralSurfaces.shadeViewController.showAodUi()
|
||||
shadeViewController.showAodUi()
|
||||
}
|
||||
}, (ANIMATE_IN_KEYGUARD_DELAY * animatorDurationScale).toLong())
|
||||
|
||||
@@ -328,8 +332,8 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
// We currently draw both the light reveal scrim, and the AOD UI, in the shade. If it's
|
||||
// already expanded and showing notifications/QS, the animation looks really messy. For now,
|
||||
// disable it if the notification panel is expanded.
|
||||
if ((!this::mCentralSurfaces.isInitialized ||
|
||||
mCentralSurfaces.shadeViewController.isPanelExpanded) &&
|
||||
if ((!this::centralSurfaces.isInitialized ||
|
||||
shadeViewController.isPanelExpanded) &&
|
||||
// Status bar might be expanded because we have started
|
||||
// playing the animation already
|
||||
!isAnimationPlaying()
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle
|
||||
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
|
||||
import com.android.systemui.lifecycle.repeatWhenAttached
|
||||
import com.android.systemui.shade.ShadeFoldAnimator
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.statusbar.LightRevealScrim
|
||||
import com.android.systemui.statusbar.phone.CentralSurfaces
|
||||
import com.android.systemui.statusbar.phone.ScreenOffAnimation
|
||||
@@ -62,7 +63,7 @@ constructor(
|
||||
private val keyguardInteractor: Lazy<KeyguardInteractor>,
|
||||
) : CallbackController<FoldAodAnimationStatus>, ScreenOffAnimation, WakefulnessLifecycle.Observer {
|
||||
|
||||
private lateinit var centralSurfaces: CentralSurfaces
|
||||
private lateinit var shadeViewController: ShadeViewController
|
||||
|
||||
private var isFolded = false
|
||||
private var isFoldHandled = true
|
||||
@@ -87,8 +88,12 @@ constructor(
|
||||
)
|
||||
}
|
||||
|
||||
override fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) {
|
||||
this.centralSurfaces = centralSurfaces
|
||||
override fun initialize(
|
||||
centralSurfaces: CentralSurfaces,
|
||||
shadeViewController: ShadeViewController,
|
||||
lightRevealScrim: LightRevealScrim,
|
||||
) {
|
||||
this.shadeViewController = shadeViewController
|
||||
|
||||
deviceStateManager.registerCallback(mainExecutor, FoldListener())
|
||||
wakefulnessLifecycle.addObserver(this)
|
||||
@@ -128,7 +133,7 @@ constructor(
|
||||
}
|
||||
|
||||
private fun getShadeFoldAnimator(): ShadeFoldAnimator =
|
||||
centralSurfaces.shadeViewController.shadeFoldAnimator
|
||||
shadeViewController.shadeFoldAnimator
|
||||
|
||||
private fun setAnimationState(playing: Boolean) {
|
||||
shouldPlayAnimation = playing
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.settings.FakeDisplayTracker;
|
||||
import com.android.systemui.settings.UserTracker;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeViewController;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.phone.CentralSurfaces;
|
||||
|
||||
@@ -65,6 +66,8 @@ public class SystemActionsTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private ShadeController mShadeController;
|
||||
@Mock
|
||||
private ShadeViewController mShadeViewController;
|
||||
@Mock
|
||||
private Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
|
||||
@Mock
|
||||
private Optional<Recents> mRecentsOptional;
|
||||
@@ -82,7 +85,8 @@ public class SystemActionsTest extends SysuiTestCase {
|
||||
mContext.addMockSystemService(TelecomManager.class, mTelecomManager);
|
||||
mContext.addMockSystemService(InputManager.class, mInputManager);
|
||||
mSystemActions = new SystemActions(mContext, mUserTracker, mNotificationShadeController,
|
||||
mShadeController, mCentralSurfacesOptionalLazy, mRecentsOptional, mDisplayTracker);
|
||||
mShadeController, () -> mShadeViewController, mCentralSurfacesOptionalLazy,
|
||||
mRecentsOptional, mDisplayTracker);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -61,10 +61,8 @@ public class ShadeTouchHandlerTest extends SysuiTestCase {
|
||||
@Before
|
||||
public void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces),
|
||||
mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces), mShadeViewController,
|
||||
TOUCH_HEIGHT);
|
||||
when(mCentralSurfaces.getShadeViewController())
|
||||
.thenReturn(mShadeViewController);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -94,6 +94,7 @@ import com.android.systemui.settings.UserContextProvider;
|
||||
import com.android.systemui.settings.UserTracker;
|
||||
import com.android.systemui.shade.NotificationShadeWindowView;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.shade.ShadeViewController;
|
||||
import com.android.systemui.shared.rotation.RotationButtonController;
|
||||
import com.android.systemui.shared.system.TaskStackChangeListeners;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
@@ -467,6 +468,7 @@ public class NavigationBarTest extends SysuiTestCase {
|
||||
when(deviceProvisionedController.isDeviceProvisioned()).thenReturn(true);
|
||||
return spy(new NavigationBar(
|
||||
mNavigationBarView,
|
||||
mock(ShadeController.class),
|
||||
mNavigationBarFrame,
|
||||
null,
|
||||
context,
|
||||
@@ -485,7 +487,7 @@ public class NavigationBarTest extends SysuiTestCase {
|
||||
Optional.of(mock(Pip.class)),
|
||||
Optional.of(mock(Recents.class)),
|
||||
() -> Optional.of(mCentralSurfaces),
|
||||
mock(ShadeController.class),
|
||||
mock(ShadeViewController.class),
|
||||
mock(NotificationRemoteInputManager.class),
|
||||
mock(NotificationShadeDepthController.class),
|
||||
mHandler,
|
||||
|
||||
@@ -38,6 +38,7 @@ import com.android.systemui.navigationbar.NavigationModeController
|
||||
import com.android.systemui.recents.OverviewProxyService.ACTION_QUICKSTEP
|
||||
import com.android.systemui.settings.FakeDisplayTracker
|
||||
import com.android.systemui.settings.UserTracker
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.shared.recents.IOverviewProxy
|
||||
import com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_WAKEFULNESS_MASK
|
||||
import com.android.systemui.shared.system.QuickStepContract.WAKEFULNESS_ASLEEP
|
||||
@@ -93,6 +94,7 @@ class OverviewProxyServiceTest : SysuiTestCase() {
|
||||
@Mock private lateinit var shellInterface: ShellInterface
|
||||
@Mock private lateinit var navBarController: NavigationBarController
|
||||
@Mock private lateinit var centralSurfaces: CentralSurfaces
|
||||
@Mock private lateinit var shadeViewController: ShadeViewController
|
||||
@Mock private lateinit var navModeController: NavigationModeController
|
||||
@Mock private lateinit var statusBarWinController: NotificationShadeWindowController
|
||||
@Mock private lateinit var userTracker: UserTracker
|
||||
@@ -132,6 +134,7 @@ class OverviewProxyServiceTest : SysuiTestCase() {
|
||||
shellInterface,
|
||||
Lazy { navBarController },
|
||||
Lazy { Optional.of(centralSurfaces) },
|
||||
Lazy { shadeViewController },
|
||||
navModeController,
|
||||
statusBarWinController,
|
||||
sysUiState,
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle
|
||||
import com.android.systemui.plugins.ActivityStarter.OnDismissAction
|
||||
import com.android.systemui.settings.UserTracker
|
||||
import com.android.systemui.shade.ShadeController
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||
@@ -65,6 +66,7 @@ class ActivityStarterImplTest : SysuiTestCase() {
|
||||
@Mock private lateinit var biometricUnlockController: BiometricUnlockController
|
||||
@Mock private lateinit var keyguardViewMediator: KeyguardViewMediator
|
||||
@Mock private lateinit var shadeController: ShadeController
|
||||
@Mock private lateinit var shadeViewController: ShadeViewController
|
||||
@Mock private lateinit var statusBarKeyguardViewManager: StatusBarKeyguardViewManager
|
||||
@Mock private lateinit var activityLaunchAnimator: ActivityLaunchAnimator
|
||||
@Mock private lateinit var lockScreenUserManager: NotificationLockscreenUserManager
|
||||
@@ -91,6 +93,7 @@ class ActivityStarterImplTest : SysuiTestCase() {
|
||||
Lazy { biometricUnlockController },
|
||||
Lazy { keyguardViewMediator },
|
||||
Lazy { shadeController },
|
||||
Lazy { shadeViewController },
|
||||
Lazy { statusBarKeyguardViewManager },
|
||||
Lazy { notifShadeWindowController },
|
||||
activityLaunchAnimator,
|
||||
|
||||
@@ -140,8 +140,6 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun handleTouchEventFromStatusBar_viewNotEnabled_returnsTrueAndNoViewEvent() {
|
||||
`when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true)
|
||||
`when`(centralSurfacesImpl.shadeViewController)
|
||||
.thenReturn(shadeViewController)
|
||||
`when`(shadeViewController.isViewEnabled).thenReturn(false)
|
||||
val returnVal = view.onTouchEvent(
|
||||
MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0))
|
||||
@@ -152,8 +150,6 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun handleTouchEventFromStatusBar_viewNotEnabledButIsMoveEvent_viewReceivesEvent() {
|
||||
`when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true)
|
||||
`when`(centralSurfacesImpl.shadeViewController)
|
||||
.thenReturn(shadeViewController)
|
||||
`when`(shadeViewController.isViewEnabled).thenReturn(false)
|
||||
val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_MOVE, 0f, 0f, 0)
|
||||
|
||||
@@ -165,8 +161,6 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun handleTouchEventFromStatusBar_panelAndViewEnabled_viewReceivesEvent() {
|
||||
`when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true)
|
||||
`when`(centralSurfacesImpl.shadeViewController)
|
||||
.thenReturn(shadeViewController)
|
||||
`when`(shadeViewController.isViewEnabled).thenReturn(true)
|
||||
val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0)
|
||||
|
||||
@@ -178,8 +172,6 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() {
|
||||
@Test
|
||||
fun handleTouchEventFromStatusBar_topEdgeTouch_viewNeverReceivesEvent() {
|
||||
`when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true)
|
||||
`when`(centralSurfacesImpl.shadeViewController)
|
||||
.thenReturn(shadeViewController)
|
||||
`when`(shadeViewController.isFullyCollapsed).thenReturn(true)
|
||||
val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
|
||||
|
||||
|
||||
@@ -97,9 +97,7 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() {
|
||||
powerManager,
|
||||
handler = handler
|
||||
)
|
||||
controller.initialize(centralSurfaces, lightRevealScrim)
|
||||
`when`(centralSurfaces.shadeViewController).thenReturn(
|
||||
shadeViewController)
|
||||
controller.initialize(centralSurfaces, shadeViewController, lightRevealScrim)
|
||||
|
||||
// Screen off does not run if the panel is expanded, so we should say it's collapsed to test
|
||||
// screen off.
|
||||
|
||||
@@ -101,7 +101,6 @@ class FoldAodAnimationControllerTest : SysuiTestCase() {
|
||||
whenever(viewGroup.viewTreeObserver).thenReturn(viewTreeObserver)
|
||||
whenever(wakefulnessLifecycle.lastSleepReason)
|
||||
.thenReturn(PowerManager.GO_TO_SLEEP_REASON_DEVICE_FOLD)
|
||||
whenever(centralSurfaces.shadeViewController).thenReturn(shadeViewController)
|
||||
whenever(shadeFoldAnimator.startFoldToAodAnimation(any(), any(), any())).then {
|
||||
val onActionStarted = it.arguments[0] as Runnable
|
||||
onActionStarted.run()
|
||||
@@ -124,7 +123,7 @@ class FoldAodAnimationControllerTest : SysuiTestCase() {
|
||||
latencyTracker,
|
||||
{ keyguardInteractor },
|
||||
)
|
||||
.apply { initialize(centralSurfaces, lightRevealScrim) }
|
||||
.apply { initialize(centralSurfaces, shadeViewController, lightRevealScrim) }
|
||||
|
||||
verify(deviceStateManager).registerCallback(any(), foldStateListenerCaptor.capture())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user