Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +23 −34 Original line number Diff line number Diff line Loading @@ -163,7 +163,6 @@ import com.android.systemui.plugins.FalsingManager.FalsingTapListener; import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shade.transition.ShadeTransitionController; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.QuickStepContract; Loading Loading @@ -356,7 +355,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final AlternateBouncerInteractor mAlternateBouncerInteractor; private final KeyguardRootView mKeyguardRootView; private final QuickSettingsController mQsController; private final ShadeInteractor mShadeInteractor; private final TouchHandler mTouchHandler = new TouchHandler(); private long mDownTime; Loading Loading @@ -561,6 +559,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private float mHintDistance; private float mInitialOffsetOnTouch; private boolean mCollapsedAndHeadsUpOnDown; private float mExpandedFraction = 0; private float mExpansionDragDownAmountPx = 0; private boolean mPanelClosedOnDown; private boolean mHasLayoutedSinceDown; Loading Loading @@ -710,12 +709,10 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump VibratorHelper vibratorHelper, LatencyTracker latencyTracker, PowerManager powerManager, AccessibilityManager accessibilityManager, @DisplayId int displayId, AccessibilityManager accessibilityManager, @DisplayId int displayId, KeyguardUpdateMonitor keyguardUpdateMonitor, MetricsLogger metricsLogger, ShadeLogger shadeLogger, ShadeInteractor shadeInteractor, ConfigurationController configurationController, Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder, StatusBarTouchableRegionManager statusBarTouchableRegionManager, Loading Loading @@ -788,7 +785,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mView = view; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mLockscreenGestureLogger = lockscreenGestureLogger; mShadeInteractor = shadeInteractor; mShadeExpansionStateManager = shadeExpansionStateManager; mShadeLog = shadeLogger; mGutsManager = gutsManager; Loading Loading @@ -2248,7 +2244,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (!isFalseTouch(x, y, interactionType)) { mShadeLog.logFlingExpands(vel, vectorVel, interactionType, this.mFlingAnimationUtils.getMinVelocityPxPerSecond(), getExpandedFraction() > 0.5f, mAllowExpandForSmallExpansion); mExpandedFraction > 0.5f, mAllowExpandForSmallExpansion); if (Math.abs(vectorVel) < this.mFlingAnimationUtils.getMinVelocityPxPerSecond()) { expands = shouldExpandWhenNotFlinging(); } else { Loading Loading @@ -2423,7 +2419,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump void requestScrollerTopPaddingUpdate(boolean animate) { mNotificationStackScrollLayoutController.updateTopPadding( mQsController.calculateNotificationsTopPadding(mIsExpandingOrCollapsing, getKeyguardNotificationStaticPadding(), getExpandedFraction()), animate); getKeyguardNotificationStaticPadding(), mExpandedFraction), animate); if (isKeyguardShowing() && mKeyguardBypassController.getBypassEnabled()) { // update the position of the header Loading Loading @@ -2505,10 +2501,10 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private void onHeightUpdated(float expandedHeight) { if (expandedHeight <= 0) { mShadeLog.logExpansionChanged("onHeightUpdated: fully collapsed.", getExpandedFraction(), isExpanded(), mTracking, mExpansionDragDownAmountPx); mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); } else if (isFullyExpanded()) { mShadeLog.logExpansionChanged("onHeightUpdated: fully expanded.", getExpandedFraction(), isExpanded(), mTracking, mExpansionDragDownAmountPx); mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); } if (!mQsController.getExpanded() || mQsController.isExpandImmediate() || mIsExpandingOrCollapsing && mQsController.getExpandedWhenExpandingStarted()) { Loading Loading @@ -3434,7 +3430,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ipw.print("mHintDistance="); ipw.println(mHintDistance); ipw.print("mInitialOffsetOnTouch="); ipw.println(mInitialOffsetOnTouch); ipw.print("mCollapsedAndHeadsUpOnDown="); ipw.println(mCollapsedAndHeadsUpOnDown); ipw.print("getExpandedFraction()="); ipw.println(getExpandedFraction()); ipw.print("mExpandedFraction="); ipw.println(mExpandedFraction); ipw.print("mExpansionDragDownAmountPx="); ipw.println(mExpansionDragDownAmountPx); ipw.print("mPanelClosedOnDown="); ipw.println(mPanelClosedOnDown); ipw.print("mHasLayoutedSinceDown="); ipw.println(mHasLayoutedSinceDown); Loading Loading @@ -3770,7 +3766,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump // don't fling while in keyguard to avoid jump in shade expand animation; // touch has been intercepted already so flinging here is redundant if (mBarState == KEYGUARD && getExpandedFraction() >= 1.0) { if (mBarState == KEYGUARD && mExpandedFraction >= 1.0) { mShadeLog.d("NPVC endMotionEvent - skipping fling on keyguard"); } else { fling(vel, expand, isFalseTouch(x, y, interactionType)); Loading Loading @@ -3866,16 +3862,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @VisibleForTesting void setExpandedHeight(float height) { debugLog("setExpandedHeight(%.1f)", height); int maxPanelTransitionDistance = getMaxPanelTransitionDistance(); if (maxPanelTransitionDistance == 0) { setExpandedFracAndHeight(0, height); } else { setExpandedFracAndHeight(height / maxPanelTransitionDistance, height); } } private void setExpandedFracAndHeight(float frac, float height) { mShadeInteractor.setExpansion(frac); setExpandedHeightInternal(height); } Loading Loading @@ -3931,9 +3917,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mHeightAnimator.end(); } } mQsController.setShadeExpansion(mExpandedHeight, getExpandedFraction()); mExpandedFraction = Math.min(1f, maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight); mQsController.setShadeExpansion(mExpandedHeight, mExpandedFraction); mExpansionDragDownAmountPx = h; mAmbientState.setExpansionFraction(getExpandedFraction()); mAmbientState.setExpansionFraction(mExpandedFraction); onHeightUpdated(mExpandedHeight); updateExpansionAndVisibility(); }); Loading Loading @@ -3961,7 +3949,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump /** Sets the expanded height relative to a number from 0 to 1. */ @VisibleForTesting void setExpandedFraction(float frac) { setExpandedFracAndHeight(frac, getMaxPanelTransitionDistance() * frac); final int maxDist = getMaxPanelTransitionDistance(); setExpandedHeight(maxDist * frac); } float getExpandedHeight() { Loading @@ -3969,7 +3958,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } float getExpandedFraction() { return mShadeInteractor.getExpansion().getValue(); return mExpandedFraction; } @Override Loading @@ -3991,7 +3980,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public boolean isFullyCollapsed() { return getExpandedFraction() <= 0.0f; return mExpandedFraction <= 0.0f; } @Override Loading Loading @@ -4150,7 +4139,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump animator.getAnimatedFraction())); setOverExpansionInternal(expansion, false /* isFromGesture */); } setExpandedHeight((float) animation.getAnimatedValue()); setExpandedHeightInternal((float) animation.getAnimatedValue()); }); return animator; } Loading @@ -4164,14 +4153,14 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public void updateExpansionAndVisibility() { mShadeExpansionStateManager.onPanelExpansionChanged( getExpandedFraction(), isExpanded(), mTracking, mExpansionDragDownAmountPx); mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); updateVisibility(); } @Override public boolean isExpanded() { return getExpandedFraction() > 0f return mExpandedFraction > 0f || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking Loading Loading @@ -4929,7 +4918,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mMotionAborted = false; mPanelClosedOnDown = isFullyCollapsed(); mShadeLog.logPanelClosedOnDown("intercept down touch", mPanelClosedOnDown, getExpandedFraction()); mExpandedFraction); mCollapsedAndHeadsUpOnDown = false; mHasLayoutedSinceDown = false; mUpdateFlingOnLayout = false; Loading Loading @@ -5148,7 +5137,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mMinExpandHeight = 0.0f; mPanelClosedOnDown = isFullyCollapsed(); mShadeLog.logPanelClosedOnDown("handle down touch", mPanelClosedOnDown, getExpandedFraction()); mExpandedFraction); mHasLayoutedSinceDown = false; mUpdateFlingOnLayout = false; mMotionAborted = false; Loading Loading @@ -5207,7 +5196,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (isFullyCollapsed()) { // If panel is fully collapsed, reset haptic effect before adding movement. mHasVibratedOnOpen = false; mShadeLog.logHasVibrated(mHasVibratedOnOpen, getExpandedFraction()); mShadeLog.logHasVibrated(mHasVibratedOnOpen, mExpandedFraction); } addMovement(event); if (!isFullyCollapsed()) { Loading Loading @@ -5243,7 +5232,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump // otherwise {@link NotificationStackScrollLayout} // wrongly enables stack height updates at the start of lockscreen swipe-up mAmbientState.setSwipingUp(h <= 0); setExpandedHeight(newHeight); setExpandedHeightInternal(newHeight); } break; Loading packages/SystemUI/src/com/android/systemui/shade/data/repository/ShadeRepository.kt +1 −30 Original line number Diff line number Diff line Loading @@ -34,34 +34,13 @@ interface ShadeRepository { /** ShadeModel information regarding shade expansion events */ val shadeModel: Flow<ShadeModel> /** * Value from `0` to `1` representing the amount the shade has expanded where `1` is fully * expanded and `0` is fully collapsed. Quick Settings can be expanded without a fully expanded * shade. */ /** Amount qs has expanded. Quick Settings can be expanded without the full shade expansion. */ val qsExpansion: StateFlow<Float> /** * Value from `0` to `1` representing the amount the shade has expanded where `1` is fully * expanded and `0` is fully collapsed. */ val expansion: StateFlow<Float> /** Amount shade has expanded with regard to the UDFPS location */ val udfpsTransitionToFullShadeProgress: StateFlow<Float> /** * Set shade expansion to a value from `0` to `1` representing the amount the shade has expanded * where `1` is fully expanded and `0` is fully collapsed. */ fun setExpansion(expansion: Float) /** * Set quick settings expansion to a value from `0` to `1` representing the amount quick * settings has expanded where `1` is fully expanded and `0` is fully collapsed. */ fun setQsExpansion(qsExpansion: Float) fun setUdfpsTransitionToFullShadeProgress(progress: Float) } Loading Loading @@ -99,17 +78,9 @@ constructor(shadeExpansionStateManager: ShadeExpansionStateManager) : ShadeRepos private val _qsExpansion = MutableStateFlow(0f) override val qsExpansion: StateFlow<Float> = _qsExpansion.asStateFlow() private val _expansion = MutableStateFlow(0f) override val expansion: StateFlow<Float> = _expansion.asStateFlow() private var _udfpsTransitionToFullShadeProgress = MutableStateFlow(0f) override val udfpsTransitionToFullShadeProgress: StateFlow<Float> = _udfpsTransitionToFullShadeProgress.asStateFlow() override fun setExpansion(expansion: Float) { _expansion.value = expansion } override fun setQsExpansion(qsExpansion: Float) { _qsExpansion.value = qsExpansion } Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt +0 −12 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.shade.domain.interactor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.data.repository.KeyguardRepository import com.android.systemui.shade.data.repository.ShadeRepository import com.android.systemui.statusbar.disableflags.data.repository.DisableFlagsRepository import com.android.systemui.statusbar.pipeline.mobile.data.repository.UserSetupRepository import com.android.systemui.statusbar.policy.DeviceProvisionedController Loading @@ -39,29 +38,18 @@ class ShadeInteractor @Inject constructor( @Application scope: CoroutineScope, private val shadeRepository: ShadeRepository, disableFlagsRepository: DisableFlagsRepository, keyguardRepository: KeyguardRepository, userSetupRepository: UserSetupRepository, deviceProvisionedController: DeviceProvisionedController, userInteractor: UserInteractor, ) { /** * Value from `0` to `1` representing the amount the shade has expanded where `1` is fully * expanded and `0` is fully collapsed. */ val expansion = shadeRepository.expansion /** Emits true if the shade is currently allowed and false otherwise. */ val isShadeEnabled: StateFlow<Boolean> = disableFlagsRepository.disableFlags .map { it.isShadeEnabled() } .stateIn(scope, SharingStarted.Eagerly, initialValue = false) fun setExpansion(expansion: Float) { shadeRepository.setExpansion(expansion) } /** Emits true if the shade can be expanded from QQS to QS and false otherwise. */ val isExpandToQsEnabled: Flow<Boolean> = combine( Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +6 −36 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ import com.android.keyguard.KeyguardStatusView; import com.android.keyguard.KeyguardStatusViewController; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.LockIconViewController; import com.android.keyguard.TestScopeProvider; import com.android.keyguard.dagger.KeyguardQsUserSwitchComponent; import com.android.keyguard.dagger.KeyguardStatusBarViewComponent; import com.android.keyguard.dagger.KeyguardStatusViewComponent; Loading Loading @@ -120,7 +119,6 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.qs.QS; import com.android.systemui.qs.QSFragment; import com.android.systemui.screenrecord.RecordingController; import com.android.systemui.shade.data.repository.FakeShadeRepository; import com.android.systemui.shade.data.repository.ShadeRepository; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shade.transition.ShadeTransitionController; Loading @@ -136,7 +134,6 @@ import com.android.systemui.statusbar.QsFrameTranslateController; import com.android.systemui.statusbar.StatusBarStateControllerImpl; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.disableflags.data.repository.FakeDisableFlagsRepository; import com.android.systemui.statusbar.notification.ConversationNotificationManager; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; Loading Loading @@ -167,17 +164,14 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager; import com.android.systemui.statusbar.phone.TapAgainViewController; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository; import com.android.systemui.statusbar.policy.CastController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcherController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcherView; import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.unfold.SysUIUnfoldComponent; import com.android.systemui.user.domain.interactor.UserInteractor; import com.android.systemui.util.kotlin.JavaAdapter; import com.android.systemui.util.time.FakeSystemClock; import com.android.systemui.util.time.SystemClock; Loading Loading @@ -364,16 +358,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mFakeKeyguardRepository = keyguardInteractorDeps.getRepository(); mKeyguardBottomAreaInteractor = new KeyguardBottomAreaInteractor(mFakeKeyguardRepository); mKeyguardInteractor = keyguardInteractorDeps.getKeyguardInteractor(); mShadeRepository = new FakeShadeRepository(); mShadeInteractor = new ShadeInteractor( TestScopeProvider.getTestScope(), mShadeRepository, new FakeDisableFlagsRepository(), new FakeKeyguardRepository(), new FakeUserSetupRepository(), mock(DeviceProvisionedController.class), mock(UserInteractor.class) ); SystemClock systemClock = new FakeSystemClock(); mStatusBarStateController = new StatusBarStateControllerImpl(mUiEventLogger, mDumpManager, Loading Loading @@ -600,33 +584,19 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mMainHandler, mLayoutInflater, mFeatureFlags, coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController, mFalsingManager, new FalsingCollectorFake(), coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController, mFalsingManager, new FalsingCollectorFake(), mKeyguardStateController, mStatusBarStateController, mStatusBarWindowStateController, mNotificationShadeWindowController, mDozeLog, mDozeParameters, mCommandQueue, mVibratorHelper, mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor, mDozeLog, mDozeParameters, mCommandQueue, mVibratorHelper, mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor, mMetricsLogger, mShadeLog, mShadeInteractor, mConfigurationController, () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, mStatusBarKeyguardViewManager, mGutsManager, mNotificationsQSContainerController, Loading packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerBaseTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.qs.QS; import com.android.systemui.qs.QSFragment; import com.android.systemui.screenrecord.RecordingController; import com.android.systemui.shade.data.repository.FakeShadeRepository; import com.android.systemui.shade.data.repository.ShadeRepository; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shade.transition.ShadeTransitionController; Loading Loading @@ -171,7 +170,6 @@ public class QuickSettingsControllerBaseTest extends SysuiTestCase { mShadeInteractor = new ShadeInteractor( mTestScope.getBackgroundScope(), new FakeShadeRepository(), mDisableFlagsRepository, mKeyguardRepository, new FakeUserSetupRepository(), Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +23 −34 Original line number Diff line number Diff line Loading @@ -163,7 +163,6 @@ import com.android.systemui.plugins.FalsingManager.FalsingTapListener; import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shade.transition.ShadeTransitionController; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.QuickStepContract; Loading Loading @@ -356,7 +355,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private final AlternateBouncerInteractor mAlternateBouncerInteractor; private final KeyguardRootView mKeyguardRootView; private final QuickSettingsController mQsController; private final ShadeInteractor mShadeInteractor; private final TouchHandler mTouchHandler = new TouchHandler(); private long mDownTime; Loading Loading @@ -561,6 +559,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private float mHintDistance; private float mInitialOffsetOnTouch; private boolean mCollapsedAndHeadsUpOnDown; private float mExpandedFraction = 0; private float mExpansionDragDownAmountPx = 0; private boolean mPanelClosedOnDown; private boolean mHasLayoutedSinceDown; Loading Loading @@ -710,12 +709,10 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump VibratorHelper vibratorHelper, LatencyTracker latencyTracker, PowerManager powerManager, AccessibilityManager accessibilityManager, @DisplayId int displayId, AccessibilityManager accessibilityManager, @DisplayId int displayId, KeyguardUpdateMonitor keyguardUpdateMonitor, MetricsLogger metricsLogger, ShadeLogger shadeLogger, ShadeInteractor shadeInteractor, ConfigurationController configurationController, Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder, StatusBarTouchableRegionManager statusBarTouchableRegionManager, Loading Loading @@ -788,7 +785,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mView = view; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mLockscreenGestureLogger = lockscreenGestureLogger; mShadeInteractor = shadeInteractor; mShadeExpansionStateManager = shadeExpansionStateManager; mShadeLog = shadeLogger; mGutsManager = gutsManager; Loading Loading @@ -2248,7 +2244,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (!isFalseTouch(x, y, interactionType)) { mShadeLog.logFlingExpands(vel, vectorVel, interactionType, this.mFlingAnimationUtils.getMinVelocityPxPerSecond(), getExpandedFraction() > 0.5f, mAllowExpandForSmallExpansion); mExpandedFraction > 0.5f, mAllowExpandForSmallExpansion); if (Math.abs(vectorVel) < this.mFlingAnimationUtils.getMinVelocityPxPerSecond()) { expands = shouldExpandWhenNotFlinging(); } else { Loading Loading @@ -2423,7 +2419,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump void requestScrollerTopPaddingUpdate(boolean animate) { mNotificationStackScrollLayoutController.updateTopPadding( mQsController.calculateNotificationsTopPadding(mIsExpandingOrCollapsing, getKeyguardNotificationStaticPadding(), getExpandedFraction()), animate); getKeyguardNotificationStaticPadding(), mExpandedFraction), animate); if (isKeyguardShowing() && mKeyguardBypassController.getBypassEnabled()) { // update the position of the header Loading Loading @@ -2505,10 +2501,10 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private void onHeightUpdated(float expandedHeight) { if (expandedHeight <= 0) { mShadeLog.logExpansionChanged("onHeightUpdated: fully collapsed.", getExpandedFraction(), isExpanded(), mTracking, mExpansionDragDownAmountPx); mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); } else if (isFullyExpanded()) { mShadeLog.logExpansionChanged("onHeightUpdated: fully expanded.", getExpandedFraction(), isExpanded(), mTracking, mExpansionDragDownAmountPx); mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); } if (!mQsController.getExpanded() || mQsController.isExpandImmediate() || mIsExpandingOrCollapsing && mQsController.getExpandedWhenExpandingStarted()) { Loading Loading @@ -3434,7 +3430,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump ipw.print("mHintDistance="); ipw.println(mHintDistance); ipw.print("mInitialOffsetOnTouch="); ipw.println(mInitialOffsetOnTouch); ipw.print("mCollapsedAndHeadsUpOnDown="); ipw.println(mCollapsedAndHeadsUpOnDown); ipw.print("getExpandedFraction()="); ipw.println(getExpandedFraction()); ipw.print("mExpandedFraction="); ipw.println(mExpandedFraction); ipw.print("mExpansionDragDownAmountPx="); ipw.println(mExpansionDragDownAmountPx); ipw.print("mPanelClosedOnDown="); ipw.println(mPanelClosedOnDown); ipw.print("mHasLayoutedSinceDown="); ipw.println(mHasLayoutedSinceDown); Loading Loading @@ -3770,7 +3766,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump // don't fling while in keyguard to avoid jump in shade expand animation; // touch has been intercepted already so flinging here is redundant if (mBarState == KEYGUARD && getExpandedFraction() >= 1.0) { if (mBarState == KEYGUARD && mExpandedFraction >= 1.0) { mShadeLog.d("NPVC endMotionEvent - skipping fling on keyguard"); } else { fling(vel, expand, isFalseTouch(x, y, interactionType)); Loading Loading @@ -3866,16 +3862,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @VisibleForTesting void setExpandedHeight(float height) { debugLog("setExpandedHeight(%.1f)", height); int maxPanelTransitionDistance = getMaxPanelTransitionDistance(); if (maxPanelTransitionDistance == 0) { setExpandedFracAndHeight(0, height); } else { setExpandedFracAndHeight(height / maxPanelTransitionDistance, height); } } private void setExpandedFracAndHeight(float frac, float height) { mShadeInteractor.setExpansion(frac); setExpandedHeightInternal(height); } Loading Loading @@ -3931,9 +3917,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mHeightAnimator.end(); } } mQsController.setShadeExpansion(mExpandedHeight, getExpandedFraction()); mExpandedFraction = Math.min(1f, maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight); mQsController.setShadeExpansion(mExpandedHeight, mExpandedFraction); mExpansionDragDownAmountPx = h; mAmbientState.setExpansionFraction(getExpandedFraction()); mAmbientState.setExpansionFraction(mExpandedFraction); onHeightUpdated(mExpandedHeight); updateExpansionAndVisibility(); }); Loading Loading @@ -3961,7 +3949,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump /** Sets the expanded height relative to a number from 0 to 1. */ @VisibleForTesting void setExpandedFraction(float frac) { setExpandedFracAndHeight(frac, getMaxPanelTransitionDistance() * frac); final int maxDist = getMaxPanelTransitionDistance(); setExpandedHeight(maxDist * frac); } float getExpandedHeight() { Loading @@ -3969,7 +3958,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } float getExpandedFraction() { return mShadeInteractor.getExpansion().getValue(); return mExpandedFraction; } @Override Loading @@ -3991,7 +3980,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public boolean isFullyCollapsed() { return getExpandedFraction() <= 0.0f; return mExpandedFraction <= 0.0f; } @Override Loading Loading @@ -4150,7 +4139,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump animator.getAnimatedFraction())); setOverExpansionInternal(expansion, false /* isFromGesture */); } setExpandedHeight((float) animation.getAnimatedValue()); setExpandedHeightInternal((float) animation.getAnimatedValue()); }); return animator; } Loading @@ -4164,14 +4153,14 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public void updateExpansionAndVisibility() { mShadeExpansionStateManager.onPanelExpansionChanged( getExpandedFraction(), isExpanded(), mTracking, mExpansionDragDownAmountPx); mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); updateVisibility(); } @Override public boolean isExpanded() { return getExpandedFraction() > 0f return mExpandedFraction > 0f || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking Loading Loading @@ -4929,7 +4918,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mMotionAborted = false; mPanelClosedOnDown = isFullyCollapsed(); mShadeLog.logPanelClosedOnDown("intercept down touch", mPanelClosedOnDown, getExpandedFraction()); mExpandedFraction); mCollapsedAndHeadsUpOnDown = false; mHasLayoutedSinceDown = false; mUpdateFlingOnLayout = false; Loading Loading @@ -5148,7 +5137,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mMinExpandHeight = 0.0f; mPanelClosedOnDown = isFullyCollapsed(); mShadeLog.logPanelClosedOnDown("handle down touch", mPanelClosedOnDown, getExpandedFraction()); mExpandedFraction); mHasLayoutedSinceDown = false; mUpdateFlingOnLayout = false; mMotionAborted = false; Loading Loading @@ -5207,7 +5196,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (isFullyCollapsed()) { // If panel is fully collapsed, reset haptic effect before adding movement. mHasVibratedOnOpen = false; mShadeLog.logHasVibrated(mHasVibratedOnOpen, getExpandedFraction()); mShadeLog.logHasVibrated(mHasVibratedOnOpen, mExpandedFraction); } addMovement(event); if (!isFullyCollapsed()) { Loading Loading @@ -5243,7 +5232,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump // otherwise {@link NotificationStackScrollLayout} // wrongly enables stack height updates at the start of lockscreen swipe-up mAmbientState.setSwipingUp(h <= 0); setExpandedHeight(newHeight); setExpandedHeightInternal(newHeight); } break; Loading
packages/SystemUI/src/com/android/systemui/shade/data/repository/ShadeRepository.kt +1 −30 Original line number Diff line number Diff line Loading @@ -34,34 +34,13 @@ interface ShadeRepository { /** ShadeModel information regarding shade expansion events */ val shadeModel: Flow<ShadeModel> /** * Value from `0` to `1` representing the amount the shade has expanded where `1` is fully * expanded and `0` is fully collapsed. Quick Settings can be expanded without a fully expanded * shade. */ /** Amount qs has expanded. Quick Settings can be expanded without the full shade expansion. */ val qsExpansion: StateFlow<Float> /** * Value from `0` to `1` representing the amount the shade has expanded where `1` is fully * expanded and `0` is fully collapsed. */ val expansion: StateFlow<Float> /** Amount shade has expanded with regard to the UDFPS location */ val udfpsTransitionToFullShadeProgress: StateFlow<Float> /** * Set shade expansion to a value from `0` to `1` representing the amount the shade has expanded * where `1` is fully expanded and `0` is fully collapsed. */ fun setExpansion(expansion: Float) /** * Set quick settings expansion to a value from `0` to `1` representing the amount quick * settings has expanded where `1` is fully expanded and `0` is fully collapsed. */ fun setQsExpansion(qsExpansion: Float) fun setUdfpsTransitionToFullShadeProgress(progress: Float) } Loading Loading @@ -99,17 +78,9 @@ constructor(shadeExpansionStateManager: ShadeExpansionStateManager) : ShadeRepos private val _qsExpansion = MutableStateFlow(0f) override val qsExpansion: StateFlow<Float> = _qsExpansion.asStateFlow() private val _expansion = MutableStateFlow(0f) override val expansion: StateFlow<Float> = _expansion.asStateFlow() private var _udfpsTransitionToFullShadeProgress = MutableStateFlow(0f) override val udfpsTransitionToFullShadeProgress: StateFlow<Float> = _udfpsTransitionToFullShadeProgress.asStateFlow() override fun setExpansion(expansion: Float) { _expansion.value = expansion } override fun setQsExpansion(qsExpansion: Float) { _qsExpansion.value = qsExpansion } Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt +0 −12 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.shade.domain.interactor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.data.repository.KeyguardRepository import com.android.systemui.shade.data.repository.ShadeRepository import com.android.systemui.statusbar.disableflags.data.repository.DisableFlagsRepository import com.android.systemui.statusbar.pipeline.mobile.data.repository.UserSetupRepository import com.android.systemui.statusbar.policy.DeviceProvisionedController Loading @@ -39,29 +38,18 @@ class ShadeInteractor @Inject constructor( @Application scope: CoroutineScope, private val shadeRepository: ShadeRepository, disableFlagsRepository: DisableFlagsRepository, keyguardRepository: KeyguardRepository, userSetupRepository: UserSetupRepository, deviceProvisionedController: DeviceProvisionedController, userInteractor: UserInteractor, ) { /** * Value from `0` to `1` representing the amount the shade has expanded where `1` is fully * expanded and `0` is fully collapsed. */ val expansion = shadeRepository.expansion /** Emits true if the shade is currently allowed and false otherwise. */ val isShadeEnabled: StateFlow<Boolean> = disableFlagsRepository.disableFlags .map { it.isShadeEnabled() } .stateIn(scope, SharingStarted.Eagerly, initialValue = false) fun setExpansion(expansion: Float) { shadeRepository.setExpansion(expansion) } /** Emits true if the shade can be expanded from QQS to QS and false otherwise. */ val isExpandToQsEnabled: Flow<Boolean> = combine( Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +6 −36 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ import com.android.keyguard.KeyguardStatusView; import com.android.keyguard.KeyguardStatusViewController; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.LockIconViewController; import com.android.keyguard.TestScopeProvider; import com.android.keyguard.dagger.KeyguardQsUserSwitchComponent; import com.android.keyguard.dagger.KeyguardStatusBarViewComponent; import com.android.keyguard.dagger.KeyguardStatusViewComponent; Loading Loading @@ -120,7 +119,6 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.qs.QS; import com.android.systemui.qs.QSFragment; import com.android.systemui.screenrecord.RecordingController; import com.android.systemui.shade.data.repository.FakeShadeRepository; import com.android.systemui.shade.data.repository.ShadeRepository; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shade.transition.ShadeTransitionController; Loading @@ -136,7 +134,6 @@ import com.android.systemui.statusbar.QsFrameTranslateController; import com.android.systemui.statusbar.StatusBarStateControllerImpl; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.disableflags.data.repository.FakeDisableFlagsRepository; import com.android.systemui.statusbar.notification.ConversationNotificationManager; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; Loading Loading @@ -167,17 +164,14 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager; import com.android.systemui.statusbar.phone.TapAgainViewController; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository; import com.android.systemui.statusbar.policy.CastController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcherController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcherView; import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.unfold.SysUIUnfoldComponent; import com.android.systemui.user.domain.interactor.UserInteractor; import com.android.systemui.util.kotlin.JavaAdapter; import com.android.systemui.util.time.FakeSystemClock; import com.android.systemui.util.time.SystemClock; Loading Loading @@ -364,16 +358,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mFakeKeyguardRepository = keyguardInteractorDeps.getRepository(); mKeyguardBottomAreaInteractor = new KeyguardBottomAreaInteractor(mFakeKeyguardRepository); mKeyguardInteractor = keyguardInteractorDeps.getKeyguardInteractor(); mShadeRepository = new FakeShadeRepository(); mShadeInteractor = new ShadeInteractor( TestScopeProvider.getTestScope(), mShadeRepository, new FakeDisableFlagsRepository(), new FakeKeyguardRepository(), new FakeUserSetupRepository(), mock(DeviceProvisionedController.class), mock(UserInteractor.class) ); SystemClock systemClock = new FakeSystemClock(); mStatusBarStateController = new StatusBarStateControllerImpl(mUiEventLogger, mDumpManager, Loading Loading @@ -600,33 +584,19 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mMainHandler, mLayoutInflater, mFeatureFlags, coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController, mFalsingManager, new FalsingCollectorFake(), coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController, mFalsingManager, new FalsingCollectorFake(), mKeyguardStateController, mStatusBarStateController, mStatusBarWindowStateController, mNotificationShadeWindowController, mDozeLog, mDozeParameters, mCommandQueue, mVibratorHelper, mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor, mDozeLog, mDozeParameters, mCommandQueue, mVibratorHelper, mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor, mMetricsLogger, mShadeLog, mShadeInteractor, mConfigurationController, () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, mStatusBarKeyguardViewManager, mGutsManager, mNotificationsQSContainerController, Loading
packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerBaseTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.qs.QS; import com.android.systemui.qs.QSFragment; import com.android.systemui.screenrecord.RecordingController; import com.android.systemui.shade.data.repository.FakeShadeRepository; import com.android.systemui.shade.data.repository.ShadeRepository; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shade.transition.ShadeTransitionController; Loading Loading @@ -171,7 +170,6 @@ public class QuickSettingsControllerBaseTest extends SysuiTestCase { mShadeInteractor = new ShadeInteractor( mTestScope.getBackgroundScope(), new FakeShadeRepository(), mDisableFlagsRepository, mKeyguardRepository, new FakeUserSetupRepository(), Loading