Merge changes from topic "bye-niac" into main
* changes:
Remove enabled NotificationIconContainerRefactor flag
Hard-code NotifIconContainerRefactor flag to true
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java
index 2114489..6441405 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java
@@ -88,7 +88,6 @@
@Mock private PowerManager mPowerManager;
@Mock private WakefulnessLifecycle mWakefullnessLifecycle;
@Mock private CentralSurfaces mCentralSurfaces;
- @Mock private NotificationIconAreaController mNotificationIconAreaController;
@Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
@Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
@Mock private ShadeLockscreenInteractor mShadeLockscreenInteractor;
@@ -106,7 +105,7 @@
mHeadsUpManager, mBatteryController, mScrimController,
() -> mBiometricUnlockController, () -> mAssistManager, mDozeScrimController,
mKeyguardUpdateMonitor, mPulseExpansionHandler, mNotificationShadeWindowController,
- mNotificationWakeUpCoordinator, mAuthController, mNotificationIconAreaController,
+ mNotificationWakeUpCoordinator, mAuthController,
mShadeLockscreenInteractor, mDozeInteractor);
mDozeServiceHost.initialize(
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index f688d4f..d468f2f 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -60,9 +60,7 @@
import com.android.systemui.statusbar.notification.AnimatableProperty;
import com.android.systemui.statusbar.notification.PropertyAnimator;
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerAlwaysOnDisplayViewBinder;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
-import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.util.ViewController;
import com.android.systemui.util.concurrency.DelayableExecutor;
@@ -87,7 +85,6 @@
private final StatusBarStateController mStatusBarStateController;
private final ClockRegistry mClockRegistry;
private final KeyguardSliceViewController mKeyguardSliceViewController;
- private final NotificationIconAreaController mNotificationIconAreaController;
private final LockscreenSmartspaceController mSmartspaceController;
private final SecureSettings mSecureSettings;
private final DumpManager mDumpManager;
@@ -165,7 +162,6 @@
StatusBarStateController statusBarStateController,
ClockRegistry clockRegistry,
KeyguardSliceViewController keyguardSliceViewController,
- NotificationIconAreaController notificationIconAreaController,
LockscreenSmartspaceController smartspaceController,
NotificationIconContainerAlwaysOnDisplayViewBinder nicViewBinder,
KeyguardUnlockAnimationController keyguardUnlockAnimationController,
@@ -183,7 +179,6 @@
mStatusBarStateController = statusBarStateController;
mClockRegistry = clockRegistry;
mKeyguardSliceViewController = keyguardSliceViewController;
- mNotificationIconAreaController = notificationIconAreaController;
mSmartspaceController = smartspaceController;
mNicViewBinder = nicViewBinder;
mSecureSettings = secureSettings;
@@ -351,10 +346,8 @@
int getNotificationIconAreaHeight() {
if (MigrateClocksToBlueprint.isEnabled()) {
return 0;
- } else if (NotificationIconContainerRefactor.isEnabled()) {
- return mAodIconContainer != null ? mAodIconContainer.getHeight() : 0;
} else {
- return mNotificationIconAreaController.getHeight();
+ return mAodIconContainer != null ? mAodIconContainer.getHeight() : 0;
}
}
@@ -603,16 +596,11 @@
NotificationIconContainer nic = (NotificationIconContainer)
mView.findViewById(
com.android.systemui.res.R.id.left_aligned_notification_icon_container);
- if (NotificationIconContainerRefactor.isEnabled()) {
- if (mAodIconsBindHandle != null) {
- mAodIconsBindHandle.dispose();
- }
- if (nic != null) {
- mAodIconsBindHandle = mNicViewBinder.bindWhileAttached(nic);
- mAodIconContainer = nic;
- }
- } else {
- mNotificationIconAreaController.setupAodIcons(nic);
+ if (mAodIconsBindHandle != null) {
+ mAodIconsBindHandle.dispose();
+ }
+ if (nic != null) {
+ mAodIconsBindHandle = mNicViewBinder.bindWhileAttached(nic);
mAodIconContainer = nic;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 609aa39..25b6b14 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -132,7 +132,6 @@
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.ConfigurationControllerModule;
import com.android.systemui.statusbar.phone.LetterboxModule;
-import com.android.systemui.statusbar.phone.NotificationIconAreaControllerModule;
import com.android.systemui.statusbar.pipeline.dagger.StatusBarPipelineModule;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -230,7 +229,6 @@
MediaProjectionTaskSwitcherModule.class,
MediaRouterModule.class,
MotionToolModule.class,
- NotificationIconAreaControllerModule.class,
PeopleHubModule.class,
PeopleModule.class,
PluginModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt b/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
index 59de203..1d1ac5a 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
@@ -39,14 +39,11 @@
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.statusbar.notification.collection.SortBySectionTimeFlag
-import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor
import com.android.systemui.statusbar.notification.interruption.VisualInterruptionRefactor
import com.android.systemui.statusbar.notification.shared.NotificationAvalancheSuppression
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun
import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRefactor
-import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor
import com.android.systemui.statusbar.notification.shared.PriorityPeopleSection
import javax.inject.Inject
@@ -61,8 +58,6 @@
modesUi dependsOn modesApi
// Internal notification frontend dependencies
- NotificationsLiveDataStoreRefactor.token dependsOn NotificationIconContainerRefactor.token
- FooterViewRefactor.token dependsOn NotificationIconContainerRefactor.token
NotificationAvalancheSuppression.token dependsOn VisualInterruptionRefactor.token
PriorityPeopleSection.token dependsOn SortBySectionTimeFlag.token
NotificationMinimalismPrototype.token dependsOn NotificationsHeadsUpRefactor.token
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
index 91b66c3..aab5b9b 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
@@ -70,7 +70,6 @@
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.CrossFadeHelper
import com.android.systemui.statusbar.VibratorHelper
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.phone.ScreenOffAnimationController
import com.android.systemui.temporarydisplay.ViewPriority
import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
@@ -292,20 +291,18 @@
}
}
- if (NotificationIconContainerRefactor.isEnabled) {
- launch {
- val iconsAppearTranslationPx =
- configuration
- .getDimensionPixelSize(R.dimen.shelf_appear_translation)
- .stateIn(this)
- viewModel.isNotifIconContainerVisible.collect { isVisible ->
- childViews[aodNotificationIconContainerId]
- ?.setAodNotifIconContainerIsVisible(
- isVisible,
- iconsAppearTranslationPx.value,
- screenOffAnimationController,
- )
- }
+ launch {
+ val iconsAppearTranslationPx =
+ configuration
+ .getDimensionPixelSize(R.dimen.shelf_appear_translation)
+ .stateIn(this)
+ viewModel.isNotifIconContainerVisible.collect { isVisible ->
+ childViews[aodNotificationIconContainerId]
+ ?.setAodNotifIconContainerIsVisible(
+ isVisible,
+ iconsAppearTranslationPx.value,
+ screenOffAnimationController,
+ )
}
}
@@ -519,7 +516,6 @@
if (MigrateClocksToBlueprint.isEnabled) {
throw IllegalStateException("should only be called in legacy code paths")
}
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return
coroutineScope {
val iconAppearTranslationPx =
configuration.getDimensionPixelSize(R.dimen.shelf_appear_translation).stateIn(this)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt
index d77b548..36ef78e 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt
@@ -37,8 +37,6 @@
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.StatusBarIconViewBindingFailureTracker
import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerAlwaysOnDisplayViewModel
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
-import com.android.systemui.statusbar.phone.NotificationIconAreaController
import com.android.systemui.statusbar.phone.NotificationIconContainer
import com.android.systemui.statusbar.ui.SystemBarUtilsState
import com.android.systemui.util.ui.value
@@ -53,7 +51,6 @@
private val iconBindingFailureTracker: StatusBarIconViewBindingFailureTracker,
private val nicAodViewModel: NotificationIconContainerAlwaysOnDisplayViewModel,
private val nicAodIconViewStore: AlwaysOnDisplayNotificationIconViewStore,
- private val notificationIconAreaController: NotificationIconAreaController,
private val systemBarUtilsState: SystemBarUtilsState,
private val rootViewModel: KeyguardRootViewModel,
) : KeyguardSection() {
@@ -86,20 +83,16 @@
return
}
- if (NotificationIconContainerRefactor.isEnabled) {
- nicBindingDisposable?.dispose()
- nicBindingDisposable =
- NotificationIconContainerViewBinder.bindWhileAttached(
- nic,
- nicAodViewModel,
- configurationState,
- systemBarUtilsState,
- iconBindingFailureTracker,
- nicAodIconViewStore,
- )
- } else {
- notificationIconAreaController.setupAodIcons(nic)
- }
+ nicBindingDisposable?.dispose()
+ nicBindingDisposable =
+ NotificationIconContainerViewBinder.bindWhileAttached(
+ nic,
+ nicAodViewModel,
+ configurationState,
+ systemBarUtilsState,
+ iconBindingFailureTracker,
+ nicAodIconViewStore,
+ )
}
override fun applyConstraints(constraintSet: ConstraintSet) {
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index 257390f..104d4b5 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -1097,14 +1097,6 @@
}
@Override
- public void onPulseExpansionAmountChanged(boolean expandingChanged) {
- if (mKeyguardBypassController.getBypassEnabled()) {
- // Position the notifications while dragging down while pulsing
- requestScrollerTopPaddingUpdate(false /* animate */);
- }
- }
-
- @Override
public void onDelayedDozeAmountAnimationRunning(boolean running) {
// On running OR finished, the animation is no longer waiting to play
setWillPlayDelayedDozeAmountAnimation(false);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java
index 49743bf..ccea254 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java
@@ -35,7 +35,6 @@
import com.android.systemui.statusbar.notification.collection.NotifCollection;
import com.android.systemui.statusbar.notification.collection.PipelineDumpable;
import com.android.systemui.statusbar.notification.collection.PipelineDumper;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.NotificationListenerWithPlugins;
import com.android.systemui.util.time.SystemClock;
@@ -66,7 +65,6 @@
private final SystemClock mSystemClock;
private final Executor mMainExecutor;
private final List<NotificationHandler> mNotificationHandlers = new ArrayList<>();
- private final ArrayList<NotificationSettingsListener> mSettingsListeners = new ArrayList<>();
private final Deque<RankingMap> mRankingMapQueue = new ConcurrentLinkedDeque<>();
private final Runnable mDispatchRankingUpdateRunnable = this::dispatchRankingUpdate;
@@ -99,13 +97,6 @@
mNotificationHandlers.add(handler);
}
- /** Registers a listener that's notified when any notification-related settings change. */
- @Deprecated
- public void addNotificationSettingsListener(NotificationSettingsListener listener) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mSettingsListeners.add(listener);
- }
-
@Override
public void onListenerConnected() {
if (DEBUG) Log.d(TAG, "onListenerConnected");
@@ -237,13 +228,7 @@
@Override
public void onSilentStatusBarIconsVisibilityChanged(boolean hideSilentStatusIcons) {
- if (NotificationIconContainerRefactor.isEnabled()) {
- mStatusIconInteractor.setHideSilentStatusIcons(hideSilentStatusIcons);
- } else {
- for (NotificationSettingsListener listener : mSettingsListeners) {
- listener.onStatusBarIconsBehaviorChanged(hideSilentStatusIcons);
- }
- }
+ mStatusIconInteractor.setHideSilentStatusIcons(hideSilentStatusIcons);
}
public final void unsnoozeNotification(@NonNull String key) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 28e3a83..696e222 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -48,7 +48,6 @@
import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableView;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
@@ -153,11 +152,7 @@
R.dimen.notification_corner_animation_distance);
mEnableNotificationClipping = res.getBoolean(R.bool.notification_enable_clipping);
- if (NotificationIconContainerRefactor.isEnabled()) {
- mShelfIcons.setOverrideIconColor(true);
- } else {
- mShelfIcons.setInNotificationIconShelf(true);
- }
+ mShelfIcons.setOverrideIconColor(true);
if (!mShowNotificationShelf) {
setVisibility(GONE);
}
@@ -228,9 +223,6 @@
} else {
viewState.setAlpha(1f - ambientState.getHideAmount());
}
- if (!NotificationIconContainerRefactor.isEnabled()) {
- viewState.belowSpeedBump = getSpeedBumpIndex() == 0;
- }
viewState.hideSensitive = false;
viewState.setXTranslation(getTranslationX());
viewState.hasItemsInStableShelf = lastViewState.inShelf;
@@ -276,30 +268,7 @@
}
}
- private int getSpeedBumpIndex() {
- NotificationIconContainerRefactor.assertInLegacyMode();
- return mHostLayout.getSpeedBumpIndex();
- }
-
- /**
- * @param fractionToShade Fraction of lockscreen to shade transition
- * @param shortestWidth Shortest width to use for lockscreen shelf
- */
- @VisibleForTesting
- public void updateActualWidth(float fractionToShade, float shortestWidth) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- final float actualWidth = mAmbientState.isOnKeyguard()
- ? MathUtils.lerp(shortestWidth, getWidth(), fractionToShade)
- : getWidth();
- setBackgroundWidth((int) actualWidth);
- if (mShelfIcons != null) {
- mShelfIcons.setActualLayoutWidth((int) actualWidth);
- }
- mActualWidth = actualWidth;
- }
-
private void setActualWidth(float actualWidth) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
setBackgroundWidth((int) actualWidth);
if (mShelfIcons != null) {
mShelfIcons.setActualLayoutWidth((int) actualWidth);
@@ -482,25 +451,17 @@
final float fractionToShade = Interpolators.STANDARD.getInterpolation(
mAmbientState.getFractionToShade());
- if (NotificationIconContainerRefactor.isEnabled()) {
- if (mAmbientState.isOnKeyguard()) {
- float numViews = MathUtils.min(numViewsInShelf, mMaxIconsOnLockscreen + 1);
- float shortestWidth = mShelfIcons.calculateWidthFor(numViews);
- float actualWidth = MathUtils.lerp(shortestWidth, getWidth(), fractionToShade);
- setActualWidth(actualWidth);
- } else {
- setActualWidth(getWidth());
- }
+ if (mAmbientState.isOnKeyguard()) {
+ float numViews = MathUtils.min(numViewsInShelf, mMaxIconsOnLockscreen + 1);
+ float shortestWidth = mShelfIcons.calculateWidthFor(numViews);
+ float actualWidth = MathUtils.lerp(shortestWidth, getWidth(), fractionToShade);
+ setActualWidth(actualWidth);
} else {
- final float shortestWidth = mShelfIcons.calculateWidthFor(numViewsInShelf);
- updateActualWidth(fractionToShade, shortestWidth);
+ setActualWidth(getWidth());
}
// TODO(b/172289889) transition last icon in shelf to notification icon and vice versa.
setVisibility(isHidden ? View.INVISIBLE : View.VISIBLE);
- if (!NotificationIconContainerRefactor.isEnabled()) {
- mShelfIcons.setSpeedBumpIndex(getSpeedBumpIndex());
- }
mShelfIcons.calculateIconXTranslations();
mShelfIcons.applyIconStates();
for (int i = 0; i < getHostLayoutChildCount(); i++) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index bbf0ae1..3068460 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -64,7 +64,6 @@
import com.android.systemui.statusbar.notification.NotificationContentDescription;
import com.android.systemui.statusbar.notification.NotificationDozeHelper;
import com.android.systemui.statusbar.notification.NotificationUtils;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.util.drawable.DrawableSize;
import java.lang.annotation.Retention;
@@ -906,12 +905,7 @@
return mDotAppearAmount;
}
- public void setDozing(boolean dozing, boolean animate, long delay) {
- setDozing(dozing, animate, delay, /* onChildCompleted= */ null);
- }
-
public void setTintAlpha(float tintAlpha) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
setDozeAmount(tintAlpha);
}
@@ -921,15 +915,6 @@
updateIconColor();
}
- public void setDozing(boolean dozing, boolean animate, long delay,
- @Nullable Runnable endRunnable) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mDozer.setDozing(f -> {
- setDozeAmount(f);
- updateAllowAnimation();
- }, dozing, animate, delay, this, endRunnable);
- }
-
private void updateAllowAnimation() {
if (mDozeAmount == 0 || mDozeAmount == 1) {
setAllowAnimation(mDozeAmount == 0);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
index 9240c1c..22c537c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
@@ -34,7 +34,6 @@
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.domain.interactor.NotificationsKeyguardInteractor
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
import com.android.systemui.statusbar.phone.DozeParameters
@@ -223,11 +222,6 @@
val nowExpanding = isPulseExpanding()
val changed = nowExpanding != pulseExpanding
pulseExpanding = nowExpanding
- if (!NotificationIconContainerRefactor.isEnabled) {
- for (listener in wakeUpListeners) {
- listener.onPulseExpansionAmountChanged(changed)
- }
- }
if (changed) {
for (listener in wakeUpListeners) {
listener.onPulseExpandingChanged(pulseExpanding)
@@ -683,17 +677,6 @@
fun onFullyHiddenChanged(isFullyHidden: Boolean) {}
/**
- * Called whenever the pulseExpansion changes
- *
- * @param expandingChanged if the user has started or stopped expanding
- */
- @Deprecated(
- message = "Use onPulseExpandedChanged instead.",
- replaceWith = ReplaceWith("onPulseExpandedChanged"),
- )
- fun onPulseExpansionAmountChanged(expandingChanged: Boolean) {}
-
- /**
* Called when the animator started by [scheduleDelayedDozeAmountAnimation] begins running
* after the start delay, or after it ends/is cancelled.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt
index 1511abd..f74c9a6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt
@@ -28,9 +28,7 @@
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
import com.android.systemui.statusbar.notification.domain.interactor.RenderNotificationListInteractor
import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.notification.stack.BUCKET_SILENT
-import com.android.systemui.statusbar.phone.NotificationIconAreaController
import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController
import javax.inject.Inject
@@ -43,7 +41,6 @@
@Inject
internal constructor(
private val groupExpansionManagerImpl: GroupExpansionManagerImpl,
- private val notificationIconAreaController: NotificationIconAreaController,
private val renderListInteractor: RenderNotificationListInteractor,
private val activeNotificationsInteractor: ActiveNotificationsInteractor,
private val sensitiveNotificationProtectionController:
@@ -63,12 +60,7 @@
} else {
controller.setNotifStats(notifStats)
}
- if (NotificationIconContainerRefactor.isEnabled || FooterViewRefactor.isEnabled) {
- renderListInteractor.setRenderedList(entries)
- }
- if (!NotificationIconContainerRefactor.isEnabled) {
- notificationIconAreaController.updateNotificationIcons(entries)
- }
+ renderListInteractor.setRenderedList(entries)
}
private fun calculateNotifStats(entries: List<ListEntry>): NotifStats {
@@ -76,9 +68,10 @@
var hasClearableAlertingNotifs = false
var hasNonClearableSilentNotifs = false
var hasClearableSilentNotifs = false
- val isSensitiveContentProtectionActive = screenshareNotificationHiding() &&
- screenshareNotificationHidingBugFix() &&
- sensitiveNotificationProtectionController.isSensitiveStateActive
+ val isSensitiveContentProtectionActive =
+ screenshareNotificationHiding() &&
+ screenshareNotificationHidingBugFix() &&
+ sensitiveNotificationProtectionController.isSensitiveStateActive
entries.forEach {
val section = checkNotNull(it.section) { "Null section for ${it.key}" }
val entry = checkNotNull(it.representativeEntry) { "Null notif entry for ${it.key}" }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImpl.kt
deleted file mode 100644
index 1bcab3f..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImpl.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.statusbar.notification.icon.ui.viewbinder
-
-import android.content.Context
-import android.graphics.Rect
-import android.view.View
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.statusbar.StatusBarIconView
-import com.android.systemui.statusbar.notification.collection.ListEntry
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
-import com.android.systemui.statusbar.phone.NotificationIconAreaController
-import com.android.systemui.statusbar.phone.NotificationIconContainer
-import javax.inject.Inject
-
-/**
- * Controller class for [NotificationIconContainer]. This implementation serves as a temporary
- * wrapper around [NotificationIconContainerViewBinder], so that external code can continue to
- * depend on the [NotificationIconAreaController] interface. Once
- * [LegacyNotificationIconAreaControllerImpl] is removed, this class can go away and the ViewBinder
- * can be used directly.
- */
-@SysUISingleton
-class NotificationIconAreaControllerViewBinderWrapperImpl @Inject constructor() :
- NotificationIconAreaController {
-
- /** Called by the Keyguard*ViewController whose view contains the aod icons. */
- override fun setupAodIcons(aodIcons: NotificationIconContainer?) = unsupported
-
- override fun setShelfIcons(icons: NotificationIconContainer) = unsupported
-
- override fun onDensityOrFontScaleChanged(context: Context) = unsupported
-
- /** Returns the view that represents the notification area. */
- override fun getNotificationInnerAreaView(): View? = unsupported
-
- /** Updates the notifications with the given list of notifications to display. */
- override fun updateNotificationIcons(entries: List<ListEntry>) = unsupported
-
- override fun updateAodNotificationIcons() = unsupported
-
- override fun showIconIsolated(icon: StatusBarIconView?, animated: Boolean) = unsupported
-
- override fun setIsolatedIconLocation(iconDrawingRect: Rect, requireStateUpdate: Boolean) =
- unsupported
-
- override fun setAnimationsEnabled(enabled: Boolean) = unsupported
-
- override fun onThemeChanged() = unsupported
-
- override fun getHeight(): Int = unsupported
-
- companion object {
- val unsupported: Nothing
- get() =
- error(
- "Code path not supported when ${NotificationIconContainerRefactor.FLAG_NAME}" +
- " is disabled"
- )
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBindingFailureTracker.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBindingFailureTracker.kt
index 0c114a2..931381f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBindingFailureTracker.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBindingFailureTracker.kt
@@ -17,7 +17,6 @@
import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.util.asIndenting
import com.android.systemui.util.printCollection
import dagger.Binds
@@ -40,7 +39,6 @@
}
override fun dump(pw: PrintWriter, args: Array<out String>) {
- if (!NotificationIconContainerRefactor.isEnabled) return
pw.asIndenting().run {
printCollection("AOD Icon binding failures:", aodFailures)
printCollection("Status Bar Icon binding failures:", statusBarFailures)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java
index d2d0aaa..560028c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java
@@ -46,7 +46,6 @@
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.shared.NotificationHeadsUpCycling;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
@@ -236,16 +235,6 @@
setOutlineAlpha(alpha);
}
- @Override
- public void setBelowSpeedBump(boolean below) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- super.setBelowSpeedBump(below);
- if (below != mIsBelowSpeedBump) {
- mIsBelowSpeedBump = below;
- updateBackgroundTint();
- }
- }
-
/**
* Sets the tint color of the background
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
index 6becbd2..afda426 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
@@ -40,7 +40,6 @@
import com.android.systemui.statusbar.StatusBarIconView;
import com.android.systemui.statusbar.notification.Roundable;
import com.android.systemui.statusbar.notification.RoundableState;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.util.Compile;
@@ -394,14 +393,6 @@
public abstract void performAddAnimation(long delay, long duration, boolean isHeadsUpAppear,
Runnable onEndRunnable);
- /**
- * Set the notification appearance to be below the speed bump.
- * @param below true if it is below.
- */
- public void setBelowSpeedBump(boolean below) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- }
-
public int getPinnedHeadsUpHeight() {
return getIntrinsicHeight();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationIconContainerRefactor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationIconContainerRefactor.kt
deleted file mode 100644
index a08af75..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationIconContainerRefactor.kt
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- *
- */
-
-package com.android.systemui.statusbar.notification.shared
-
-import com.android.systemui.Flags
-import com.android.systemui.flags.FlagToken
-import com.android.systemui.flags.RefactorFlagUtils
-
-/** Helper for reading or using the NotificationIconContainer refactor flag state. */
-@Suppress("NOTHING_TO_INLINE")
-object NotificationIconContainerRefactor {
- /** The aconfig flag name */
- const val FLAG_NAME = Flags.FLAG_NOTIFICATIONS_ICON_CONTAINER_REFACTOR
-
- /** A token used for dependency declaration */
- val token: FlagToken
- get() = FlagToken(FLAG_NAME, isEnabled)
-
- /** Is the refactor enabled? */
- @JvmStatic
- inline val isEnabled
- get() = Flags.notificationsIconContainerRefactor()
-
- /**
- * Called to ensure code is only run when the flag is enabled. This protects users from the
- * unintended behaviors caused by accidentally running new logic, while also crashing on an eng
- * build to ensure that the refactor author catches issues in testing.
- */
- @JvmStatic
- inline fun isUnexpectedlyInLegacyMode() =
- RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)
-
- /**
- * Called to ensure code is only run when the flag is disabled. This will throw an exception if
- * the flag is enabled to ensure that the refactor author catches issues in testing.
- */
- @JvmStatic
- inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt
index 819527e..15dc115 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt
@@ -21,9 +21,7 @@
import com.android.systemui.statusbar.NotificationShelf
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerShelfViewBinder
import com.android.systemui.statusbar.notification.row.ui.viewbinder.ActivatableNotificationViewBinder
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.notification.shelf.ui.viewmodel.NotificationShelfViewModel
-import com.android.systemui.statusbar.phone.NotificationIconAreaController
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
@@ -35,17 +33,10 @@
viewModel: NotificationShelfViewModel,
falsingManager: FalsingManager,
nicBinder: NotificationIconContainerShelfViewBinder,
- notificationIconAreaController: NotificationIconAreaController,
): Unit = coroutineScope {
ActivatableNotificationViewBinder.bind(viewModel, shelf, falsingManager)
shelf.apply {
- traceSection("NotifShelf#bindShelfIcons") {
- if (NotificationIconContainerRefactor.isEnabled) {
- launch { nicBinder.bind(shelfIcons) }
- } else {
- notificationIconAreaController.setShelfIcons(shelfIcons)
- }
- }
+ traceSection("NotifShelf#bindShelfIcons") { launch { nicBinder.bind(shelfIcons) } }
launch {
viewModel.canModifyColorOfNotifications.collect(::setCanModifyColorOfNotifications)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ExpandableViewState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ExpandableViewState.java
index 83de226..69c9a4b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ExpandableViewState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ExpandableViewState.java
@@ -26,7 +26,6 @@
import com.android.systemui.res.R;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableView;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
/**
* A state of an expandable view
@@ -157,11 +156,6 @@
expandableView.setHideSensitive(
this.hideSensitive, false /* animated */, 0 /* delay */, 0 /* duration */);
- // apply below shelf speed bump
- if (!NotificationIconContainerRefactor.isEnabled()) {
- expandableView.setBelowSpeedBump(this.belowSpeedBump);
- }
-
// apply clipping
final float oldClipTopAmount = expandableView.getClipTopAmount();
if (oldClipTopAmount != this.clipTopAmount) {
@@ -211,11 +205,6 @@
abortAnimation(child, TAG_ANIMATOR_BOTTOM_INSET);
}
- // apply below the speed bump
- if (!NotificationIconContainerRefactor.isEnabled()) {
- expandableView.setBelowSpeedBump(this.belowSpeedBump);
- }
-
// start hiding sensitive animation
expandableView.setHideSensitive(this.hideSensitive, animationFilter.animateHideSensitive,
properties.delay, properties.duration);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt
index 5544f93..5572f8e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt
@@ -46,7 +46,6 @@
import com.android.systemui.statusbar.notification.stack.ui.viewbinder.HideNotificationsBinder.bindHideList
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationListViewModel
import com.android.systemui.statusbar.notification.ui.viewbinder.HeadsUpNotificationViewBinder
-import com.android.systemui.statusbar.phone.NotificationIconAreaController
import com.android.systemui.util.kotlin.awaitCancellationThenDispose
import com.android.systemui.util.kotlin.getOrNull
import com.android.systemui.util.ui.isAnimating
@@ -74,7 +73,6 @@
private val configuration: ConfigurationState,
private val falsingManager: FalsingManager,
private val hunBinder: HeadsUpNotificationViewBinder,
- private val iconAreaController: NotificationIconAreaController,
private val loggerOptional: Optional<NotificationStatsLogger>,
private val metricsLogger: MetricsLogger,
private val nicBinder: NotificationIconContainerShelfViewBinder,
@@ -128,7 +126,6 @@
viewModel.shelf,
falsingManager,
nicBinder,
- iconAreaController,
)
}
@@ -183,12 +180,12 @@
launchNotificationSettings = { view ->
notificationActivityStarter
.get()
- .startHistoryIntent(view, /* showHistory = */ false)
+ .startHistoryIntent(view, /* showHistory= */ false)
},
launchNotificationHistory = { view ->
notificationActivityStarter
.get()
- .startHistoryIntent(view, /* showHistory = */ true)
+ .startHistoryIntent(view, /* showHistory= */ true)
},
)
launch {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 3a3b05b..2c7ce00 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -209,7 +209,6 @@
import com.android.systemui.statusbar.notification.init.NotificationsController;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
@@ -237,10 +236,10 @@
import com.android.wm.shell.startingsurface.SplashscreenContentDrawer;
import com.android.wm.shell.startingsurface.StartingSurface;
-import dalvik.annotation.optimization.NeverCompile;
-
import dagger.Lazy;
+import dalvik.annotation.optimization.NeverCompile;
+
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Map;
@@ -546,7 +545,6 @@
protected final BatteryController mBatteryController;
private UiModeManager mUiModeManager;
private LogMaker mStatusBarStateLog;
- protected final NotificationIconAreaController mNotificationIconAreaController;
@Nullable private View mAmbientIndicationContainer;
private final SysuiColorExtractor mColorExtractor;
private final ScreenLifecycle mScreenLifecycle;
@@ -683,7 +681,6 @@
DemoModeController demoModeController,
Lazy<NotificationShadeDepthController> notificationShadeDepthControllerLazy,
StatusBarTouchableRegionManager statusBarTouchableRegionManager,
- NotificationIconAreaController notificationIconAreaController,
BrightnessSliderController.Factory brightnessSliderFactory,
ScreenOffAnimationController screenOffAnimationController,
WallpaperController wallpaperController,
@@ -787,7 +784,6 @@
mUserInfoControllerImpl = userInfoControllerImpl;
mIconPolicy = phoneStatusBarPolicy;
mDemoModeController = demoModeController;
- mNotificationIconAreaController = notificationIconAreaController;
mBrightnessSliderFactory = brightnessSliderFactory;
mWallpaperController = wallpaperController;
mStatusBarSignalPolicy = statusBarSignalPolicy;
@@ -2652,9 +2648,6 @@
!mDozeServiceHost.isPulsing());
mShadeSurface.setTouchAndAnimationDisabled(disabled);
- if (!NotificationIconContainerRefactor.isEnabled()) {
- mNotificationIconAreaController.setAnimationsEnabled(!disabled);
- }
}
final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() {
@@ -3053,9 +3046,6 @@
}
// TODO: Bring these out of CentralSurfaces.
mUserInfoControllerImpl.onDensityOrFontScaleChanged();
- if (!NotificationIconContainerRefactor.isEnabled()) {
- mNotificationIconAreaController.onDensityOrFontScaleChanged(mContext);
- }
}
@Override
@@ -3073,9 +3063,6 @@
if (mAmbientIndicationContainer instanceof AutoReinflateContainer) {
((AutoReinflateContainer) mAmbientIndicationContainer).inflateLayout();
}
- if (!NotificationIconContainerRefactor.isEnabled()) {
- mNotificationIconAreaController.onThemeChanged();
- }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
index ca1fb78b..f13a593 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
@@ -52,7 +52,6 @@
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -106,7 +105,6 @@
private final NotificationWakeUpCoordinator mNotificationWakeUpCoordinator;
private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
private final AuthController mAuthController;
- private final NotificationIconAreaController mNotificationIconAreaController;
private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
private final ShadeLockscreenInteractor mShadeLockscreenInteractor;
private View mAmbientIndicationContainer;
@@ -129,7 +127,6 @@
NotificationShadeWindowController notificationShadeWindowController,
NotificationWakeUpCoordinator notificationWakeUpCoordinator,
AuthController authController,
- NotificationIconAreaController notificationIconAreaController,
ShadeLockscreenInteractor shadeLockscreenInteractor,
DozeInteractor dozeInteractor) {
super();
@@ -149,7 +146,6 @@
mNotificationShadeWindowController = notificationShadeWindowController;
mNotificationWakeUpCoordinator = notificationWakeUpCoordinator;
mAuthController = authController;
- mNotificationIconAreaController = notificationIconAreaController;
mShadeLockscreenInteractor = shadeLockscreenInteractor;
mHeadsUpManager.addListener(mOnHeadsUpChangedListener);
mDozeInteractor = dozeInteractor;
@@ -196,13 +192,8 @@
void fireNotificationPulse(NotificationEntry entry) {
Runnable pulseSuppressedListener = () -> {
- if (NotificationIconContainerRefactor.isEnabled()) {
- mHeadsUpManager.removeNotification(
- entry.getKey(), /* releaseImmediately= */ true, /* animate= */ false);
- } else {
- entry.setPulseSuppressed(true);
- mNotificationIconAreaController.updateAodNotificationIcons();
- }
+ mHeadsUpManager.removeNotification(
+ entry.getKey(), /* releaseImmediately= */ true, /* animate= */ false);
};
Assert.isMainThread();
for (Callback callback : mCallbacks) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
index f99a81e..8f94c06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
@@ -42,7 +42,6 @@
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationIconInteractor;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.shared.AsyncGroupHeaderViewInflation;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.stack.NotificationRoundnessManager;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentScope;
@@ -74,7 +73,6 @@
private static final SourceType HEADS_UP = SourceType.from("HeadsUp");
private static final SourceType PULSING = SourceType.from("Pulsing");
- private final NotificationIconAreaController mNotificationIconAreaController;
private final HeadsUpManager mHeadsUpManager;
private final NotificationStackScrollLayoutController mStackScrollerController;
@@ -114,7 +112,6 @@
@VisibleForTesting
@Inject
public HeadsUpAppearanceController(
- NotificationIconAreaController notificationIconAreaController,
HeadsUpManager headsUpManager,
StatusBarStateController stateController,
PhoneStatusBarTransitions phoneStatusBarTransitions,
@@ -132,7 +129,6 @@
HeadsUpNotificationIconInteractor headsUpNotificationIconInteractor,
@Named(OPERATOR_NAME_FRAME_VIEW) Optional<View> operatorNameViewOptional) {
super(headsUpStatusBarView);
- mNotificationIconAreaController = notificationIconAreaController;
mNotificationRoundnessManager = notificationRoundnessManager;
mHeadsUpManager = headsUpManager;
@@ -178,11 +174,8 @@
@Override
protected void onViewAttached() {
mHeadsUpManager.addListener(this);
- mView.setOnDrawingRectChangedListener(
- () -> updateIsolatedIconLocation(true /* requireUpdate */));
- if (NotificationIconContainerRefactor.isEnabled()) {
- updateIsolatedIconLocation(true);
- }
+ mView.setOnDrawingRectChangedListener(this::updateIsolatedIconLocation);
+ updateIsolatedIconLocation();
mWakeUpCoordinator.addListener(this);
getShadeHeadsUpTracker().addTrackingHeadsUpListener(mSetTrackingHeadsUp);
getShadeHeadsUpTracker().setHeadsUpAppearanceController(this);
@@ -198,9 +191,7 @@
protected void onViewDetached() {
mHeadsUpManager.removeListener(this);
mView.setOnDrawingRectChangedListener(null);
- if (NotificationIconContainerRefactor.isEnabled()) {
- mHeadsUpNotificationIconInteractor.setIsolatedIconLocation(null);
- }
+ mHeadsUpNotificationIconInteractor.setIsolatedIconLocation(null);
mWakeUpCoordinator.removeListener(this);
getShadeHeadsUpTracker().removeTrackingHeadsUpListener(mSetTrackingHeadsUp);
getShadeHeadsUpTracker().setHeadsUpAppearanceController(null);
@@ -208,14 +199,8 @@
mDarkIconDispatcher.removeDarkReceiver(this);
}
- private void updateIsolatedIconLocation(boolean requireStateUpdate) {
- if (NotificationIconContainerRefactor.isEnabled()) {
- mHeadsUpNotificationIconInteractor
- .setIsolatedIconLocation(mView.getIconDrawingRect());
- } else {
- mNotificationIconAreaController.setIsolatedIconLocation(
- mView.getIconDrawingRect(), requireStateUpdate);
- }
+ private void updateIsolatedIconLocation() {
+ mHeadsUpNotificationIconInteractor.setIsolatedIconLocation(mView.getIconDrawingRect());
}
@Override
@@ -251,14 +236,8 @@
setShown(true);
animateIsolation = !isExpanded();
}
- if (NotificationIconContainerRefactor.isEnabled()) {
- mHeadsUpNotificationIconInteractor.setIsolatedIconNotificationKey(
- newEntry == null ? null : newEntry.getRepresentativeEntry().getKey());
- } else {
- updateIsolatedIconLocation(false /* requireUpdate */);
- mNotificationIconAreaController.showIconIsolated(newEntry == null ? null
- : newEntry.getIcons().getStatusBarIcon(), animateIsolation);
- }
+ mHeadsUpNotificationIconInteractor.setIsolatedIconNotificationKey(
+ newEntry == null ? null : newEntry.getRepresentativeEntry().getKey());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImpl.java
deleted file mode 100644
index f84efbb..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImpl.java
+++ /dev/null
@@ -1,700 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.statusbar.phone;
-
-import static com.android.systemui.Flags.newAodTransition;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Color;
-import android.graphics.Rect;
-import android.os.Bundle;
-import android.os.Trace;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.FrameLayout;
-
-import androidx.annotation.ColorInt;
-import androidx.annotation.NonNull;
-import androidx.annotation.VisibleForTesting;
-import androidx.collection.ArrayMap;
-
-import com.android.app.animation.Interpolators;
-import com.android.internal.statusbar.StatusBarIcon;
-import com.android.internal.util.ContrastColorUtil;
-import com.android.settingslib.Utils;
-import com.android.systemui.dagger.SysUISingleton;
-import com.android.systemui.demomode.DemoMode;
-import com.android.systemui.demomode.DemoModeController;
-import com.android.systemui.flags.FeatureFlags;
-import com.android.systemui.keyguard.MigrateClocksToBlueprint;
-import com.android.systemui.plugins.DarkIconDispatcher;
-import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver;
-import com.android.systemui.plugins.statusbar.StatusBarStateController;
-import com.android.systemui.res.R;
-import com.android.systemui.statusbar.CrossFadeHelper;
-import com.android.systemui.statusbar.NotificationListener;
-import com.android.systemui.statusbar.NotificationMediaManager;
-import com.android.systemui.statusbar.StatusBarIconView;
-import com.android.systemui.statusbar.StatusBarState;
-import com.android.systemui.statusbar.notification.NotificationUtils;
-import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
-import com.android.systemui.statusbar.notification.collection.ListEntry;
-import com.android.systemui.statusbar.notification.collection.NotificationEntry;
-import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider;
-import com.android.systemui.statusbar.window.StatusBarWindowController;
-import com.android.wm.shell.bubbles.Bubbles;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.Function;
-
-import javax.inject.Inject;
-
-/**
- * A controller for the space in the status bar to the left of the system icons. This area is
- * normally reserved for notifications.
- */
-@SysUISingleton
-public class LegacyNotificationIconAreaControllerImpl implements
- NotificationIconAreaController,
- DarkReceiver,
- StatusBarStateController.StateListener,
- NotificationWakeUpCoordinator.WakeUpListener,
- DemoMode {
-
- private static final long AOD_ICONS_APPEAR_DURATION = 200;
- @ColorInt
- private static final int DEFAULT_AOD_ICON_COLOR = 0xffffffff;
-
- private final ContrastColorUtil mContrastColorUtil;
- private final Runnable mUpdateStatusBarIcons = this::updateStatusBarIcons;
- private final StatusBarStateController mStatusBarStateController;
- private final NotificationMediaManager mMediaManager;
- private final NotificationWakeUpCoordinator mWakeUpCoordinator;
- private final KeyguardBypassController mBypassController;
- private final DozeParameters mDozeParameters;
- private final SectionStyleProvider mSectionStyleProvider;
- private final Optional<Bubbles> mBubblesOptional;
- private final StatusBarWindowController mStatusBarWindowController;
- private final ScreenOffAnimationController mScreenOffAnimationController;
-
- private int mIconSize;
- private int mIconHPadding;
- private int mIconTint = Color.WHITE;
-
- private List<ListEntry> mNotificationEntries = List.of();
- protected View mNotificationIconArea;
- private NotificationIconContainer mNotificationIcons;
- private NotificationIconContainer mShelfIcons;
- private NotificationIconContainer mAodIcons;
- private final ArrayList<Rect> mTintAreas = new ArrayList<>();
- private final Context mContext;
- private int mAodIconAppearTranslation;
-
- private boolean mAnimationsEnabled;
- private int mAodIconTint;
- private boolean mAodIconsVisible;
- private boolean mShowLowPriority = true;
-
- @VisibleForTesting
- final NotificationListener.NotificationSettingsListener mSettingsListener =
- new NotificationListener.NotificationSettingsListener() {
- @Override
- public void onStatusBarIconsBehaviorChanged(boolean hideSilentStatusIcons) {
- mShowLowPriority = !hideSilentStatusIcons;
- updateStatusBarIcons();
- }
- };
-
- @Inject
- public LegacyNotificationIconAreaControllerImpl(
- Context context,
- StatusBarStateController statusBarStateController,
- NotificationWakeUpCoordinator wakeUpCoordinator,
- KeyguardBypassController keyguardBypassController,
- NotificationMediaManager notificationMediaManager,
- NotificationListener notificationListener,
- DozeParameters dozeParameters,
- SectionStyleProvider sectionStyleProvider,
- Optional<Bubbles> bubblesOptional,
- DemoModeController demoModeController,
- DarkIconDispatcher darkIconDispatcher,
- FeatureFlags featureFlags,
- StatusBarWindowController statusBarWindowController,
- ScreenOffAnimationController screenOffAnimationController) {
- mContrastColorUtil = ContrastColorUtil.getInstance(context);
- mContext = context;
- mStatusBarStateController = statusBarStateController;
- mStatusBarStateController.addCallback(this);
- mMediaManager = notificationMediaManager;
- mDozeParameters = dozeParameters;
- mSectionStyleProvider = sectionStyleProvider;
- mWakeUpCoordinator = wakeUpCoordinator;
- wakeUpCoordinator.addListener(this);
- mBypassController = keyguardBypassController;
- mBubblesOptional = bubblesOptional;
- demoModeController.addCallback(this);
- mStatusBarWindowController = statusBarWindowController;
- mScreenOffAnimationController = screenOffAnimationController;
- notificationListener.addNotificationSettingsListener(mSettingsListener);
- initializeNotificationAreaViews(context);
- reloadAodColor();
- darkIconDispatcher.addDarkReceiver(this);
- }
-
- protected View inflateIconArea(LayoutInflater inflater) {
- return inflater.inflate(R.layout.notification_icon_area, null);
- }
-
- /**
- * Initializes the views that will represent the notification area.
- */
- protected void initializeNotificationAreaViews(Context context) {
- reloadDimens(context);
-
- LayoutInflater layoutInflater = LayoutInflater.from(context);
- mNotificationIconArea = inflateIconArea(layoutInflater);
- mNotificationIcons = mNotificationIconArea.findViewById(R.id.notificationIcons);
- }
-
- /**
- * Called by the Keyguard*ViewController whose view contains the aod icons.
- */
- public void setupAodIcons(@NonNull NotificationIconContainer aodIcons) {
- boolean changed = mAodIcons != null && aodIcons != mAodIcons;
- if (changed) {
- mAodIcons.setAnimationsEnabled(false);
- mAodIcons.removeAllViews();
- }
- mAodIcons = aodIcons;
- mAodIcons.setOnLockScreen(true);
- updateAodIconsVisibility(false /* animate */, changed);
- updateAnimations();
- if (changed) {
- updateAodNotificationIcons();
- }
- updateIconLayoutParams(mContext);
- }
-
- public void setShelfIcons(NotificationIconContainer icons) {
- mShelfIcons = icons;
- }
-
- public void onDensityOrFontScaleChanged(@NotNull Context context) {
- updateIconLayoutParams(context);
- }
-
- private void updateIconLayoutParams(Context context) {
- reloadDimens(context);
- final FrameLayout.LayoutParams params = generateIconLayoutParams();
- for (int i = 0; i < mNotificationIcons.getChildCount(); i++) {
- View child = mNotificationIcons.getChildAt(i);
- child.setLayoutParams(params);
- }
- if (mShelfIcons != null) {
- for (int i = 0; i < mShelfIcons.getChildCount(); i++) {
- View child = mShelfIcons.getChildAt(i);
- child.setLayoutParams(params);
- }
- }
- if (mAodIcons != null) {
- for (int i = 0; i < mAodIcons.getChildCount(); i++) {
- View child = mAodIcons.getChildAt(i);
- child.setLayoutParams(params);
- }
- }
- }
-
- @NonNull
- private FrameLayout.LayoutParams generateIconLayoutParams() {
- return new FrameLayout.LayoutParams(
- mIconSize + 2 * mIconHPadding, mStatusBarWindowController.getStatusBarHeight());
- }
-
- private void reloadDimens(Context context) {
- Resources res = context.getResources();
- mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size_sp);
- mIconHPadding = res.getDimensionPixelSize(R.dimen.status_bar_icon_horizontal_margin);
- mAodIconAppearTranslation = res.getDimensionPixelSize(
- R.dimen.shelf_appear_translation);
- }
-
- /**
- * Returns the view that represents the notification area.
- */
- public View getNotificationInnerAreaView() {
- return mNotificationIconArea;
- }
-
- /**
- * See {@link com.android.systemui.statusbar.policy.DarkIconDispatcher#setIconsDarkArea}.
- * Sets the color that should be used to tint any icons in the notification area.
- *
- * @param tintAreas the areas in which to tint the icons, specified in screen coordinates
- * @param darkIntensity
- */
- public void onDarkChanged(ArrayList<Rect> tintAreas, float darkIntensity, int iconTint) {
- mTintAreas.clear();
- mTintAreas.addAll(tintAreas);
-
- if (DarkIconDispatcher.isInAreas(tintAreas, mNotificationIconArea)) {
- mIconTint = iconTint;
- }
-
- applyNotificationIconsTint();
- }
-
- protected boolean shouldShowNotificationIcon(NotificationEntry entry,
- boolean showAmbient, boolean showLowPriority, boolean hideDismissed,
- boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hidePulsing) {
- if (!showAmbient && mSectionStyleProvider.isMinimized(entry)) {
- return false;
- }
- if (hideCurrentMedia && entry.getKey().equals(mMediaManager.getMediaNotificationKey())) {
- return false;
- }
- if (!showLowPriority && mSectionStyleProvider.isSilent(entry)) {
- return false;
- }
- if (entry.isRowDismissed() && hideDismissed) {
- return false;
- }
- if (hideRepliedMessages && entry.isLastMessageFromReply()) {
- return false;
- }
- // showAmbient == show in shade but not shelf
- if (!showAmbient && entry.shouldSuppressStatusBar()) {
- return false;
- }
- if (hidePulsing && entry.showingPulsing()
- && (!mWakeUpCoordinator.getNotificationsFullyHidden()
- || !entry.isPulseSuppressed())) {
- return false;
- }
- if (mBubblesOptional.isPresent()
- && mBubblesOptional.get().isBubbleExpanded(entry.getKey())) {
- return false;
- }
- return true;
- }
-
- /**
- * Updates the notifications with the given list of notifications to display.
- */
- public void updateNotificationIcons(List<ListEntry> entries) {
- mNotificationEntries = entries;
- updateNotificationIcons();
- }
-
- private void updateNotificationIcons() {
- Trace.beginSection("NotificationIconAreaController.updateNotificationIcons");
- updateStatusBarIcons();
- updateShelfIcons();
- updateAodNotificationIcons();
-
- applyNotificationIconsTint();
- Trace.endSection();
- }
-
- private void updateShelfIcons() {
- if (mShelfIcons == null) {
- return;
- }
- updateIconsForLayout(entry -> entry.getIcons().getShelfIcon(), mShelfIcons,
- true /* showAmbient */,
- true /* showLowPriority */,
- false /* hideDismissed */,
- false /* hideRepliedMessages */,
- false /* hideCurrentMedia */,
- false /* hidePulsing */);
- }
-
- public void updateStatusBarIcons() {
- updateIconsForLayout(entry -> entry.getIcons().getStatusBarIcon(), mNotificationIcons,
- false /* showAmbient */,
- mShowLowPriority,
- true /* hideDismissed */,
- true /* hideRepliedMessages */,
- false /* hideCurrentMedia */,
- false /* hidePulsing */);
- }
-
- public void updateAodNotificationIcons() {
- if (mAodIcons == null) {
- return;
- }
- updateIconsForLayout(entry -> entry.getIcons().getAodIcon(), mAodIcons,
- false /* showAmbient */,
- true /* showLowPriority */,
- true /* hideDismissed */,
- true /* hideRepliedMessages */,
- true /* hideCurrentMedia */,
- mBypassController.getBypassEnabled() /* hidePulsing */);
- }
-
- @VisibleForTesting
- boolean shouldShouldLowPriorityIcons() {
- return mShowLowPriority;
- }
-
- /**
- * Updates the notification icons for a host layout. This will ensure that the notification
- * host layout will have the same icons like the ones in here.
- * @param function A function to look up an icon view based on an entry
- * @param hostLayout which layout should be updated
- * @param showAmbient should ambient notification icons be shown
- * @param showLowPriority should icons from silent notifications be shown
- * @param hideDismissed should dismissed icons be hidden
- * @param hideRepliedMessages should messages that have been replied to be hidden
- * @param hidePulsing should pulsing notifications be hidden
- */
- private void updateIconsForLayout(Function<NotificationEntry, StatusBarIconView> function,
- NotificationIconContainer hostLayout, boolean showAmbient, boolean showLowPriority,
- boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia,
- boolean hidePulsing) {
- ArrayList<StatusBarIconView> toShow = new ArrayList<>(mNotificationEntries.size());
- // Filter out ambient notifications and notification children.
- for (int i = 0; i < mNotificationEntries.size(); i++) {
- NotificationEntry entry = mNotificationEntries.get(i).getRepresentativeEntry();
- if (entry != null && entry.getRow() != null) {
- if (shouldShowNotificationIcon(entry, showAmbient, showLowPriority, hideDismissed,
- hideRepliedMessages, hideCurrentMedia, hidePulsing)) {
- StatusBarIconView iconView = function.apply(entry);
- if (iconView != null) {
- toShow.add(iconView);
- }
- }
- }
- }
-
- // In case we are changing the suppression of a group, the replacement shouldn't flicker
- // and it should just be replaced instead. We therefore look for notifications that were
- // just replaced by the child or vice-versa to suppress this.
-
- ArrayMap<String, ArrayList<StatusBarIcon>> replacingIcons = new ArrayMap<>();
- ArrayList<View> toRemove = new ArrayList<>();
- for (int i = 0; i < hostLayout.getChildCount(); i++) {
- View child = hostLayout.getChildAt(i);
- if (!(child instanceof StatusBarIconView)) {
- continue;
- }
- if (!toShow.contains(child)) {
- boolean iconWasReplaced = false;
- StatusBarIconView removedIcon = (StatusBarIconView) child;
- String removedGroupKey = removedIcon.getNotification().getGroupKey();
- for (int j = 0; j < toShow.size(); j++) {
- StatusBarIconView candidate = toShow.get(j);
- if (candidate.getSourceIcon().sameAs((removedIcon.getSourceIcon()))
- && candidate.getNotification().getGroupKey().equals(removedGroupKey)) {
- if (!iconWasReplaced) {
- iconWasReplaced = true;
- } else {
- iconWasReplaced = false;
- break;
- }
- }
- }
- if (iconWasReplaced) {
- ArrayList<StatusBarIcon> statusBarIcons = replacingIcons.get(removedGroupKey);
- if (statusBarIcons == null) {
- statusBarIcons = new ArrayList<>();
- replacingIcons.put(removedGroupKey, statusBarIcons);
- }
- statusBarIcons.add(removedIcon.getStatusBarIcon());
- }
- toRemove.add(removedIcon);
- }
- }
- // removing all duplicates
- ArrayList<String> duplicates = new ArrayList<>();
- for (String key : replacingIcons.keySet()) {
- ArrayList<StatusBarIcon> statusBarIcons = replacingIcons.get(key);
- if (statusBarIcons.size() != 1) {
- duplicates.add(key);
- }
- }
- replacingIcons.removeAll(duplicates);
- hostLayout.setReplacingIconsLegacy(replacingIcons);
-
- final int toRemoveCount = toRemove.size();
- for (int i = 0; i < toRemoveCount; i++) {
- hostLayout.removeView(toRemove.get(i));
- }
-
- final FrameLayout.LayoutParams params = generateIconLayoutParams();
- for (int i = 0; i < toShow.size(); i++) {
- StatusBarIconView v = toShow.get(i);
- // The view might still be transiently added if it was just removed and added again
- hostLayout.removeTransientView(v);
- if (v.getParent() == null) {
- if (hideDismissed) {
- v.setOnDismissListener(mUpdateStatusBarIcons);
- }
- hostLayout.addView(v, i, params);
- }
- }
-
- hostLayout.setChangingViewPositions(true);
- // Re-sort notification icons
- final int childCount = hostLayout.getChildCount();
- for (int i = 0; i < childCount; i++) {
- View actual = hostLayout.getChildAt(i);
- StatusBarIconView expected = toShow.get(i);
- if (actual == expected) {
- continue;
- }
- hostLayout.removeView(expected);
- hostLayout.addView(expected, i);
- }
- hostLayout.setChangingViewPositions(false);
- hostLayout.setReplacingIconsLegacy(null);
- }
-
- /**
- * Applies {@link #mIconTint} to the notification icons.
- */
- private void applyNotificationIconsTint() {
- for (int i = 0; i < mNotificationIcons.getChildCount(); i++) {
- final StatusBarIconView iv = (StatusBarIconView) mNotificationIcons.getChildAt(i);
- if (iv.getWidth() != 0) {
- updateTintForIcon(iv, mIconTint);
- } else {
- iv.executeOnLayout(() -> updateTintForIcon(iv, mIconTint));
- }
- }
-
- updateAodIconColors();
- }
-
- private void updateTintForIcon(StatusBarIconView v, int tint) {
- boolean isPreL = Boolean.TRUE.equals(v.getTag(R.id.icon_is_pre_L));
- int color = StatusBarIconView.NO_COLOR;
- boolean colorize = !isPreL || NotificationUtils.isGrayscale(v, mContrastColorUtil);
- if (colorize) {
- color = DarkIconDispatcher.getTint(mTintAreas, v, tint);
- }
- v.setStaticDrawableColor(color);
- v.setDecorColor(tint);
- }
-
- public void showIconIsolated(StatusBarIconView icon, boolean animated) {
- mNotificationIcons.showIconIsolatedLegacy(icon, animated);
- }
-
- public void setIsolatedIconLocation(@NotNull Rect iconDrawingRect, boolean requireStateUpdate) {
- mNotificationIcons.setIsolatedIconLocation(iconDrawingRect, requireStateUpdate);
- }
-
- @Override
- public void onDozingChanged(boolean isDozing) {
- if (mAodIcons == null) {
- return;
- }
- boolean animate = mDozeParameters.getAlwaysOn()
- && !mDozeParameters.getDisplayNeedsBlanking();
- mAodIcons.setDozing(isDozing, animate, 0);
- }
-
- public void setAnimationsEnabled(boolean enabled) {
- mAnimationsEnabled = enabled;
- updateAnimations();
- }
-
- @Override
- public void onStateChanged(int newState) {
- updateAodIconsVisibility(false /* animate */, false /* force */);
- updateAnimations();
- }
-
- private void updateAnimations() {
- boolean inShade = mStatusBarStateController.getState() == StatusBarState.SHADE;
- if (mAodIcons != null) {
- mAodIcons.setAnimationsEnabled(mAnimationsEnabled && !inShade);
- }
- mNotificationIcons.setAnimationsEnabled(mAnimationsEnabled && inShade);
- }
-
- public void onThemeChanged() {
- reloadAodColor();
- updateAodIconColors();
- }
-
- public int getHeight() {
- return mAodIcons == null ? 0 : mAodIcons.getHeight();
- }
-
- public void appearAodIcons() {
- if (mAodIcons == null) {
- return;
- }
- if (mScreenOffAnimationController.shouldAnimateAodIcons()) {
- if (!MigrateClocksToBlueprint.isEnabled()) {
- mAodIcons.setTranslationY(-mAodIconAppearTranslation);
- }
- mAodIcons.setAlpha(0);
- animateInAodIconTranslation();
- mAodIcons.animate()
- .alpha(1)
- .setInterpolator(Interpolators.LINEAR)
- .setDuration(AOD_ICONS_APPEAR_DURATION)
- .start();
- } else {
- mAodIcons.setAlpha(1.0f);
- if (!MigrateClocksToBlueprint.isEnabled()) {
- mAodIcons.setTranslationY(0);
- }
- }
- }
-
- private void animateInAodIconTranslation() {
- if (!MigrateClocksToBlueprint.isEnabled()) {
- mAodIcons.animate()
- .setInterpolator(Interpolators.DECELERATE_QUINT)
- .translationY(0)
- .setDuration(AOD_ICONS_APPEAR_DURATION)
- .start();
- }
- }
-
- private void reloadAodColor() {
- mAodIconTint = Utils.getColorAttrDefaultColor(mContext,
- R.attr.wallpaperTextColor, DEFAULT_AOD_ICON_COLOR);
- }
-
- private void updateAodIconColors() {
- if (mAodIcons != null) {
- for (int i = 0; i < mAodIcons.getChildCount(); i++) {
- final StatusBarIconView iv = (StatusBarIconView) mAodIcons.getChildAt(i);
- if (iv.getWidth() != 0) {
- updateTintForIcon(iv, mAodIconTint);
- } else {
- iv.executeOnLayout(() -> updateTintForIcon(iv, mAodIconTint));
- }
- }
- }
- }
-
- @Override
- public void onFullyHiddenChanged(boolean fullyHidden) {
- boolean animate = true;
- if (!mBypassController.getBypassEnabled()) {
- animate = mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking();
- if (!newAodTransition()) {
- // We only want the appear animations to happen when the notifications get fully
- // hidden, since otherwise the unhide animation overlaps
- animate &= fullyHidden;
- }
- }
- updateAodIconsVisibility(animate, false /* force */);
- updateAodNotificationIcons();
- updateAodIconColors();
- }
-
- @Override
- public void onPulseExpansionAmountChanged(boolean expandingChanged) {
- if (expandingChanged) {
- updateAodIconsVisibility(true /* animate */, false /* force */);
- }
- }
-
- private void updateAodIconsVisibility(boolean animate, boolean forceUpdate) {
- if (mAodIcons == null) {
- return;
- }
- boolean visible = mBypassController.getBypassEnabled()
- || mWakeUpCoordinator.getNotificationsFullyHidden();
-
- // Hide the AOD icons if we're not in the KEYGUARD state unless the screen off animation is
- // playing, in which case we want them to be visible since we're animating in the AOD UI and
- // will be switching to KEYGUARD shortly.
- if (mStatusBarStateController.getState() != StatusBarState.KEYGUARD
- && !mScreenOffAnimationController.shouldShowAodIconsWhenShade()) {
- visible = false;
- }
- if (visible && mWakeUpCoordinator.isPulseExpanding()
- && !mBypassController.getBypassEnabled()) {
- visible = false;
- }
- if (mAodIconsVisible != visible || forceUpdate) {
- mAodIconsVisible = visible;
- mAodIcons.animate().cancel();
- if (animate) {
- if (newAodTransition()) {
- // Let's make sure the icon are translated to 0, since we cancelled it above
- animateInAodIconTranslation();
- if (mAodIconsVisible) {
- CrossFadeHelper.fadeIn(mAodIcons);
- } else {
- CrossFadeHelper.fadeOut(mAodIcons);
- }
- } else {
- boolean wasFullyInvisible = mAodIcons.getVisibility() != View.VISIBLE;
- if (mAodIconsVisible) {
- if (wasFullyInvisible) {
- // No fading here, let's just appear the icons instead!
- mAodIcons.setVisibility(View.VISIBLE);
- mAodIcons.setAlpha(1.0f);
- appearAodIcons();
- } else {
- // Let's make sure the icon are translated to 0, since we cancelled it
- // above
- animateInAodIconTranslation();
- // We were fading out, let's fade in instead
- CrossFadeHelper.fadeIn(mAodIcons);
- }
- } else {
- // Let's make sure the icon are translated to 0, since we cancelled it above
- animateInAodIconTranslation();
- CrossFadeHelper.fadeOut(mAodIcons);
- }
- }
- } else {
- mAodIcons.setAlpha(1.0f);
- if (!MigrateClocksToBlueprint.isEnabled()) {
- mAodIcons.setTranslationY(0);
- }
- mAodIcons.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
- }
- }
- }
-
- @Override
- public List<String> demoCommands() {
- ArrayList<String> commands = new ArrayList<>();
- commands.add(DemoMode.COMMAND_NOTIFICATIONS);
- return commands;
- }
-
- @Override
- public void dispatchDemoCommand(String command, Bundle args) {
- if (mNotificationIconArea != null) {
- String visible = args.getString("visible");
- int vis = "false".equals(visible) ? View.INVISIBLE : View.VISIBLE;
- mNotificationIconArea.setVisibility(vis);
- }
- }
-
- @Override
- public void onDemoModeFinished() {
- if (mNotificationIconArea != null) {
- mNotificationIconArea.setVisibility(View.VISIBLE);
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.kt
deleted file mode 100644
index 4385a2e..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.statusbar.phone
-
-import android.content.Context
-import android.graphics.Rect
-import android.view.View
-import com.android.systemui.statusbar.StatusBarIconView
-import com.android.systemui.statusbar.notification.collection.ListEntry
-
-/**
- * A controller for the space in the status bar to the left of the system icons. This area is
- * normally reserved for notifications.
- */
-interface NotificationIconAreaController {
- /** Called by the Keyguard*ViewController whose view contains the aod icons. */
- fun setupAodIcons(aodIcons: NotificationIconContainer?)
- fun setShelfIcons(icons: NotificationIconContainer)
- fun onDensityOrFontScaleChanged(context: Context)
-
- /** Returns the view that represents the notification area. */
- fun getNotificationInnerAreaView(): View?
-
- /** Updates the notifications with the given list of notifications to display. */
- fun updateNotificationIcons(entries: List<@JvmSuppressWildcards ListEntry>)
- fun updateAodNotificationIcons()
- fun showIconIsolated(icon: StatusBarIconView?, animated: Boolean)
- fun setIsolatedIconLocation(iconDrawingRect: Rect, requireStateUpdate: Boolean)
- fun setAnimationsEnabled(enabled: Boolean)
- fun onThemeChanged()
- fun getHeight(): Int
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerModule.kt
deleted file mode 100644
index ba69370..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerModule.kt
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.statusbar.phone
-
-import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconAreaControllerViewBinderWrapperImpl
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
-import dagger.Module
-import dagger.Provides
-import javax.inject.Provider
-
-@Module
-object NotificationIconAreaControllerModule {
- @Provides
- fun provideNotificationIconAreaControllerImpl(
- legacyProvider: Provider<LegacyNotificationIconAreaControllerImpl>,
- newProvider: Provider<NotificationIconAreaControllerViewBinderWrapperImpl>,
- ): NotificationIconAreaController =
- if (NotificationIconContainerRefactor.isEnabled) {
- newProvider.get()
- } else {
- legacyProvider.get()
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java
index 8e3d678..ecd62bd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java
@@ -26,7 +26,6 @@
import android.graphics.Rect;
import android.graphics.drawable.Icon;
import android.util.AttributeSet;
-import android.util.MathUtils;
import android.util.Property;
import android.view.ContextThemeWrapper;
import android.view.View;
@@ -42,7 +41,6 @@
import com.android.settingslib.Utils;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.StatusBarIconView;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.statusbar.notification.stack.AnimationFilter;
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
import com.android.systemui.statusbar.notification.stack.ViewState;
@@ -243,7 +241,7 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int childCount = getChildCount();
- final int maxVisibleIcons = getMaxVisibleIcons(childCount);
+ final int maxVisibleIcons = mMaxIcons;
final int width = MeasureSpec.getSize(widthMeasureSpec);
final int childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED);
int totalWidth = (int) (getActualPaddingStart() + getActualPaddingEnd());
@@ -284,22 +282,13 @@
@Override
public String toString() {
- if (NotificationIconContainerRefactor.isEnabled()) {
- return super.toString()
- + " {"
- + " overrideIconColor=" + mOverrideIconColor
- + ", maxIcons=" + mMaxIcons
- + ", isStaticLayout=" + mIsStaticLayout
- + ", themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary)
- + " }";
- } else {
- return "NotificationIconContainer("
- + "dozing=" + mDozing + " onLockScreen=" + mOnLockScreen
- + " overrideIconColor=" + mOverrideIconColor
- + " speedBumpIndex=" + mSpeedBumpIndex
- + " themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary)
- + ')';
- }
+ return super.toString()
+ + " {"
+ + " overrideIconColor=" + mOverrideIconColor
+ + ", maxIcons=" + mMaxIcons
+ + ", isStaticLayout=" + mIsStaticLayout
+ + ", themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary)
+ + " }";
}
@VisibleForTesting
@@ -349,13 +338,8 @@
}
}
if (child instanceof StatusBarIconView) {
- if (NotificationIconContainerRefactor.isEnabled()) {
- if (!mChangingViewPositions) {
- ((StatusBarIconView) child).updateIconDimens();
- }
- } else {
+ if (!mChangingViewPositions) {
((StatusBarIconView) child).updateIconDimens();
- ((StatusBarIconView) child).setDozing(mDozing, false, 0);
}
}
}
@@ -367,23 +351,11 @@
StatusBarIconView iconView = (StatusBarIconView) child;
Icon sourceIcon = iconView.getSourceIcon();
String groupKey = iconView.getNotification().getGroupKey();
- if (NotificationIconContainerRefactor.isEnabled()) {
- if (mReplacingIcons == null) {
- return false;
- }
- StatusBarIcon replacedIcon = mReplacingIcons.get(groupKey);
- return replacedIcon != null && sourceIcon.sameAs(replacedIcon.icon);
- } else {
- if (mReplacingIconsLegacy == null) {
- return false;
- }
- ArrayList<StatusBarIcon> statusBarIcons = mReplacingIconsLegacy.get(groupKey);
- if (statusBarIcons != null) {
- StatusBarIcon replacedIcon = statusBarIcons.get(0);
- return sourceIcon.sameAs(replacedIcon.icon);
- }
+ if (mReplacingIcons == null) {
return false;
}
+ StatusBarIcon replacedIcon = mReplacingIcons.get(groupKey);
+ return replacedIcon != null && sourceIcon.sameAs(replacedIcon.icon);
}
@Override
@@ -468,24 +440,14 @@
if (numIcons == 0) {
return 0f;
}
- final float contentWidth;
- if (NotificationIconContainerRefactor.isEnabled()) {
- contentWidth = mIconSize * numIcons;
- } else {
- contentWidth = mIconSize * MathUtils.min(numIcons, mMaxIconsOnLockscreen + 1);
- }
+ final float contentWidth = mIconSize * numIcons;
return getActualPaddingStart() + contentWidth + getActualPaddingEnd();
}
@VisibleForTesting
boolean shouldForceOverflow(int i, int speedBumpIndex, float iconAppearAmount,
int maxVisibleIcons) {
- if (NotificationIconContainerRefactor.isEnabled()) {
- return i >= maxVisibleIcons && iconAppearAmount > 0.0f;
- } else {
- return speedBumpIndex != -1 && i >= speedBumpIndex
- && iconAppearAmount > 0.0f || i >= maxVisibleIcons;
- }
+ return i >= maxVisibleIcons && iconAppearAmount > 0.0f;
}
@VisibleForTesting
@@ -510,7 +472,7 @@
float translationX = getActualPaddingStart();
int firstOverflowIndex = -1;
int childCount = getChildCount();
- int maxVisibleIcons = getMaxVisibleIcons(childCount);
+ int maxVisibleIcons = mMaxIcons;
float layoutEnd = getLayoutEnd();
mVisualOverflowStart = 0;
mFirstVisibleIconState = null;
@@ -592,27 +554,15 @@
}
private float getDrawingScale(View view) {
- final boolean useIncreasedScale = NotificationIconContainerRefactor.isEnabled()
- ? mUseIncreasedIconScale
- : mOnLockScreen;
- return useIncreasedScale && view instanceof StatusBarIconView
+ return mUseIncreasedIconScale && view instanceof StatusBarIconView
? ((StatusBarIconView) view).getIconScaleIncreased()
: 1f;
}
public void setUseIncreasedIconScale(boolean useIncreasedIconScale) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
mUseIncreasedIconScale = useIncreasedIconScale;
}
- private int getMaxVisibleIcons(int childCount) {
- if (NotificationIconContainerRefactor.isEnabled()) {
- return mMaxIcons;
- } else {
- return mOnLockScreen ? mMaxIconsOnAod : mIsStaticLayout ? mMaxStaticIcons : childCount;
- }
- }
-
private float getLayoutEnd() {
return getActualWidth() - getActualPaddingEnd();
}
@@ -689,50 +639,11 @@
mChangingViewPositions = changingViewPositions;
}
- public void setDozing(boolean dozing, boolean animate, long delay) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- setDozing(dozing, animate, delay, /* endRunnable= */ null);
- }
-
- private void setDozing(boolean dozing, boolean animate, long delay,
- @Nullable Runnable endRunnable) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mDozing = dozing;
- mDisallowNextAnimation |= !animate;
- final int childCount = getChildCount();
- // Track all the child invocations of setDozing, invoking the top-level endRunnable once
- // they have all completed.
- final Runnable onChildCompleted = endRunnable == null ? null : new Runnable() {
- private int mPendingCallbacks = childCount;
-
- @Override
- public void run() {
- if (--mPendingCallbacks == 0) {
- endRunnable.run();
- }
- }
- };
- for (int i = 0; i < childCount; i++) {
- View view = getChildAt(i);
- if (view instanceof StatusBarIconView) {
- ((StatusBarIconView) view).setDozing(dozing, animate, delay, onChildCompleted);
- } else if (onChildCompleted != null) {
- onChildCompleted.run();
- }
- }
- }
-
public IconState getIconState(StatusBarIconView icon) {
return mIconStates.get(icon);
}
- public void setSpeedBumpIndex(int speedBumpIndex) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mSpeedBumpIndex = speedBumpIndex;
- }
-
public void setMaxIconsAmount(int maxIcons) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
mMaxIcons = maxIcons;
}
@@ -754,36 +665,18 @@
mAnimationsEnabled = enabled;
}
- public void setReplacingIconsLegacy(ArrayMap<String, ArrayList<StatusBarIcon>> replacingIcons) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mReplacingIconsLegacy = replacingIcons;
- }
-
public void setReplacingIcons(ArrayMap<String, StatusBarIcon> replacingIcons) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
mReplacingIcons = replacingIcons;
}
- @Deprecated
- public void showIconIsolatedLegacy(StatusBarIconView icon, boolean animated) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- if (animated) {
- mIsolatedIconForAnimation = icon != null ? icon : mIsolatedIcon;
- }
- mIsolatedIcon = icon;
- updateState();
- }
-
public void showIconIsolatedAnimated(StatusBarIconView icon,
@Nullable Runnable onAnimationEnd) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
mIsolatedIconForAnimation = icon != null ? icon : mIsolatedIcon;
mIsolatedIconAnimationEndRunnable = onAnimationEnd;
showIconIsolated(icon);
}
public void showIconIsolated(StatusBarIconView icon) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
mIsolatedIcon = icon;
updateState();
}
@@ -795,23 +688,7 @@
}
}
- /**
- * Set whether the device is on the lockscreen and which lockscreen mode the device is
- * configured to. Depending on these values, the layout of the AOD icons change.
- */
- public void setOnLockScreen(boolean onLockScreen) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mOnLockScreen = onLockScreen;
- }
-
- @Deprecated
- public void setInNotificationIconShelf(boolean inShelf) {
- NotificationIconContainerRefactor.assertInLegacyMode();
- mOverrideIconColor = inShelf;
- }
-
public void setOverrideIconColor(boolean override) {
- if (NotificationIconContainerRefactor.isUnexpectedlyInLegacyMode()) return;
mOverrideIconColor = override;
}
@@ -922,14 +799,9 @@
}
}
icon.setVisibleState(visibleState, animationsAllowed);
- if (NotificationIconContainerRefactor.isEnabled()) {
- if (mOverrideIconColor) {
- icon.setIconColor(mThemedTextColorPrimary,
- /* animate= */ needsCannedAnimation && animationsAllowed);
- }
- } else {
- icon.setIconColor(mOverrideIconColor ? mThemedTextColorPrimary : iconColor,
- needsCannedAnimation && animationsAllowed);
+ if (mOverrideIconColor) {
+ icon.setIconColor(mThemedTextColorPrimary,
+ /* animate= */ needsCannedAnimation && animationsAllowed);
}
if (animate) {
animateTo(icon, animationProperties);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
index 07c190d..5be4ba2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
@@ -59,8 +59,6 @@
import com.android.systemui.statusbar.events.SystemStatusAnimationCallback;
import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerStatusBarViewBinder;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
-import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.statusbar.phone.PhoneStatusBarView;
import com.android.systemui.statusbar.phone.StatusBarHideIconsForBouncerManager;
@@ -140,7 +138,6 @@
private final OngoingCallController mOngoingCallController;
private final SystemStatusAnimationScheduler mAnimationScheduler;
private final StatusBarLocationPublisher mLocationPublisher;
- private final NotificationIconAreaController mNotificationIconAreaController;
private final ShadeExpansionStateManager mShadeExpansionStateManager;
private final StatusBarIconController mStatusBarIconController;
private final CarrierConfigTracker mCarrierConfigTracker;
@@ -237,7 +234,6 @@
OngoingCallController ongoingCallController,
SystemStatusAnimationScheduler animationScheduler,
StatusBarLocationPublisher locationPublisher,
- NotificationIconAreaController notificationIconAreaController,
ShadeExpansionStateManager shadeExpansionStateManager,
StatusBarIconController statusBarIconController,
DarkIconManager.Factory darkIconManagerFactory,
@@ -262,7 +258,6 @@
mOngoingCallController = ongoingCallController;
mAnimationScheduler = animationScheduler;
mLocationPublisher = locationPublisher;
- mNotificationIconAreaController = notificationIconAreaController;
mShadeExpansionStateManager = shadeExpansionStateManager;
mStatusBarIconController = statusBarIconController;
mCollapsedStatusBarViewModel = collapsedStatusBarViewModel;
@@ -313,18 +308,14 @@
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mStatusBarWindowStateController.addListener(mStatusBarWindowStateListener);
- if (NotificationIconContainerRefactor.isEnabled()) {
- mDemoModeController.addCallback(mDemoModeCallback);
- }
+ mDemoModeController.addCallback(mDemoModeCallback);
}
@Override
public void onDestroy() {
super.onDestroy();
mStatusBarWindowStateController.removeListener(mStatusBarWindowStateListener);
- if (NotificationIconContainerRefactor.isEnabled()) {
- mDemoModeController.removeCallback(mDemoModeCallback);
- }
+ mDemoModeController.removeCallback(mDemoModeCallback);
}
@Override
@@ -471,11 +462,9 @@
mStartableStates.put(startable, Startable.State.STOPPED);
}
mDumpManager.unregisterDumpable(getClass().getSimpleName());
- if (NotificationIconContainerRefactor.isEnabled()) {
- if (mNicBindingDisposable != null) {
- mNicBindingDisposable.dispose();
- mNicBindingDisposable = null;
- }
+ if (mNicBindingDisposable != null) {
+ mNicBindingDisposable.dispose();
+ mNicBindingDisposable = null;
}
}
@@ -483,22 +472,12 @@
public void initNotificationIconArea() {
Trace.beginSection("CollapsedStatusBarFragment#initNotifIconArea");
ViewGroup notificationIconArea = mStatusBar.requireViewById(R.id.notification_icon_area);
- if (NotificationIconContainerRefactor.isEnabled()) {
- LayoutInflater.from(getContext())
- .inflate(R.layout.notification_icon_area, notificationIconArea, true);
- NotificationIconContainer notificationIcons =
- notificationIconArea.requireViewById(R.id.notificationIcons);
- mNotificationIconAreaInner = notificationIcons;
- mNicBindingDisposable = mNicViewBinder.bindWhileAttached(notificationIcons);
- } else {
- mNotificationIconAreaInner =
- mNotificationIconAreaController.getNotificationInnerAreaView();
- if (mNotificationIconAreaInner.getParent() != null) {
- ((ViewGroup) mNotificationIconAreaInner.getParent())
- .removeView(mNotificationIconAreaInner);
- }
- notificationIconArea.addView(mNotificationIconAreaInner);
- }
+ LayoutInflater.from(getContext())
+ .inflate(R.layout.notification_icon_area, notificationIconArea, true);
+ NotificationIconContainer notificationIcons =
+ notificationIconArea.requireViewById(R.id.notificationIcons);
+ mNotificationIconAreaInner = notificationIcons;
+ mNicBindingDisposable = mNicViewBinder.bindWhileAttached(notificationIcons);
updateNotificationIconAreaAndOngoingActivityChip(/* animate= */ false);
Trace.endSection();
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
index 319b615..2bb9e68 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
@@ -55,7 +55,6 @@
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController;
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerAlwaysOnDisplayViewBinder;
-import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.settings.SecureSettings;
@@ -78,8 +77,6 @@
@Mock
KeyguardSliceViewController mKeyguardSliceViewController;
@Mock
- NotificationIconAreaController mNotificationIconAreaController;
- @Mock
LockscreenSmartspaceController mSmartspaceController;
@Mock
@@ -176,7 +173,6 @@
mStatusBarStateController,
mClockRegistry,
mKeyguardSliceViewController,
- mNotificationIconAreaController,
mSmartspaceController,
mock(NotificationIconContainerAlwaysOnDisplayViewBinder.class),
mKeyguardUnlockAnimationController,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
index ef1c927..27a1bb5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
@@ -24,7 +24,6 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
import android.app.Notification;
import android.app.NotificationManager;
@@ -41,7 +40,6 @@
import com.android.systemui.statusbar.NotificationListener.NotificationHandler;
import com.android.systemui.statusbar.data.repository.NotificationListenerSettingsRepository;
import com.android.systemui.statusbar.domain.interactor.SilentNotificationStatusIconsVisibilityInteractor;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.time.FakeSystemClock;
@@ -149,30 +147,4 @@
verify(mNotificationHandler).onNotificationRankingUpdate(eq(ranking3));
verifyNoMoreInteractions(mNotificationHandler);
}
-
- @Test
- public void testOnConnectReadStatusBarSetting() {
- mSetFlagsRule.disableFlags(NotificationIconContainerRefactor.FLAG_NAME);
- NotificationListener.NotificationSettingsListener settingsListener =
- mock(NotificationListener.NotificationSettingsListener.class);
- mListener.addNotificationSettingsListener(settingsListener);
-
- when(mNotificationManager.shouldHideSilentStatusBarIcons()).thenReturn(true);
-
- mListener.onListenerConnected();
-
- verify(settingsListener).onStatusBarIconsBehaviorChanged(true);
- }
-
- @Test
- public void testOnStatusBarIconsBehaviorChanged() {
- mSetFlagsRule.disableFlags(NotificationIconContainerRefactor.FLAG_NAME);
- NotificationListener.NotificationSettingsListener settingsListener =
- mock(NotificationListener.NotificationSettingsListener.class);
- mListener.addNotificationSettingsListener(settingsListener);
-
- mListener.onSilentStatusBarIconsVisibilityChanged(true);
-
- verify(settingsListener).onStatusBarIconsBehaviorChanged(true);
- }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt
index c7513de..ad6aca1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt
@@ -34,10 +34,8 @@
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
import com.android.systemui.statusbar.notification.domain.interactor.RenderNotificationListInteractor
import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.notification.stack.BUCKET_ALERTING
import com.android.systemui.statusbar.notification.stack.BUCKET_SILENT
-import com.android.systemui.statusbar.phone.NotificationIconAreaController
import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController
import com.android.systemui.util.mockito.eq
import com.android.systemui.util.mockito.withArgCaptor
@@ -47,8 +45,8 @@
import org.mockito.Mock
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyZeroInteractions
-import org.mockito.MockitoAnnotations.initMocks
import org.mockito.Mockito.`when` as whenever
+import org.mockito.MockitoAnnotations.initMocks
@SmallTest
@RunWith(AndroidJUnit4::class)
@@ -61,10 +59,10 @@
@Mock private lateinit var pipeline: NotifPipeline
@Mock private lateinit var groupExpansionManagerImpl: GroupExpansionManagerImpl
- @Mock private lateinit var notificationIconAreaController: NotificationIconAreaController
@Mock private lateinit var renderListInteractor: RenderNotificationListInteractor
@Mock private lateinit var activeNotificationsInteractor: ActiveNotificationsInteractor
- @Mock private lateinit var sensitiveNotificationProtectionController:
+ @Mock
+ private lateinit var sensitiveNotificationProtectionController:
SensitiveNotificationProtectionController
@Mock private lateinit var stackController: NotifStackController
@Mock private lateinit var section: NotifSection
@@ -73,14 +71,12 @@
fun setUp() {
initMocks(this)
- whenever(sensitiveNotificationProtectionController.isSensitiveStateActive)
- .thenReturn(false)
+ whenever(sensitiveNotificationProtectionController.isSensitiveStateActive).thenReturn(false)
entry = NotificationEntryBuilder().setSection(section).build()
coordinator =
StackCoordinator(
groupExpansionManagerImpl,
- notificationIconAreaController,
renderListInteractor,
activeNotificationsInteractor,
sensitiveNotificationProtectionController,
@@ -92,15 +88,7 @@
}
@Test
- @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME)
- fun testUpdateNotificationIcons() {
- afterRenderListListener.onAfterRenderList(listOf(entry), stackController)
- verify(notificationIconAreaController).updateNotificationIcons(eq(listOf(entry)))
- }
-
- @Test
- @EnableFlags(NotificationIconContainerRefactor.FLAG_NAME)
- fun testSetRenderedListOnInteractor_iconContainerFlagOn() {
+ fun testSetRenderedListOnInteractor() {
afterRenderListListener.onAfterRenderList(listOf(entry), stackController)
verify(renderListInteractor).setRenderedList(eq(listOf(entry)))
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt
index c1f2cb77..e4945fc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt
@@ -1,6 +1,5 @@
package com.android.systemui.statusbar.notification.stack
-import android.platform.test.annotations.DisableFlags
import android.service.notification.StatusBarNotification
import android.testing.TestableLooper.RunWithLooper
import android.view.LayoutInflater
@@ -21,7 +20,6 @@
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.StackScrollAlgorithmState
import com.android.systemui.util.mockito.mock
import junit.framework.Assert.assertEquals
@@ -72,32 +70,6 @@
}
@Test
- @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME)
- fun testShadeWidth_BasedOnFractionToShade() {
- setFractionToShade(0f)
- setOnLockscreen(true)
-
- shelf.updateActualWidth(/* fractionToShade */ 0f, /* shortestWidth */ 10f)
- assertTrue(shelf.actualWidth == 10)
-
- shelf.updateActualWidth(/* fractionToShade */ 0.5f, /* shortestWidth */ 10f)
- assertTrue(shelf.actualWidth == 20)
-
- shelf.updateActualWidth(/* fractionToShade */ 1f, /* shortestWidth */ 10f)
- assertTrue(shelf.actualWidth == 30)
- }
-
- @Test
- @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME)
- fun testShelfIsLong_WhenNotOnLockscreen() {
- setFractionToShade(0f)
- setOnLockscreen(false)
-
- shelf.updateActualWidth(/* fraction */ 0f, /* shortestWidth */ 10f)
- assertTrue(shelf.actualWidth == 30)
- }
-
- @Test
fun testX_inViewForClick() {
val isXInView =
shelf.isXInView(/* localX */ 5f, /* slop */ 5f, /* left */ 0f, /* right */ 10f)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
index a6b2729..e9c16c2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
@@ -295,7 +295,6 @@
@Mock private Bubbles mBubbles;
@Mock private NoteTaskController mNoteTaskController;
@Mock private NotificationShadeWindowController mNotificationShadeWindowController;
- @Mock private NotificationIconAreaController mNotificationIconAreaController;
@Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
@Mock private Lazy<NotificationShadeWindowViewController>
mNotificationShadeWindowViewControllerLazy;
@@ -580,7 +579,6 @@
mDemoModeController,
mNotificationShadeDepthControllerLazy,
mStatusBarTouchableRegionManager,
- mNotificationIconAreaController,
mBrightnessSliderFactory,
mScreenOffAnimationController,
mWallpaperController,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
index 0d06b64..dd03ab3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
@@ -110,7 +110,6 @@
mNotificationRoundnessManager = mock(NotificationRoundnessManager.class);
when(mShadeViewController.getShadeHeadsUpTracker()).thenReturn(mShadeHeadsUpTracker);
mHeadsUpAppearanceController = new HeadsUpAppearanceController(
- mock(NotificationIconAreaController.class),
mHeadsUpManager,
mStatusbarStateController,
mPhoneStatusBarTransitions,
@@ -197,7 +196,6 @@
when(mStackScrollerController.getExpandedHeight()).thenReturn(expandedHeight);
HeadsUpAppearanceController newController = new HeadsUpAppearanceController(
- mock(NotificationIconAreaController.class),
mHeadsUpManager,
mStatusbarStateController,
mPhoneStatusBarTransitions,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
deleted file mode 100644
index 8dfbb37..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.statusbar.phone;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.platform.test.annotations.DisableFlags;
-import android.testing.TestableLooper;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.systemui.Flags;
-import com.android.systemui.SysuiTestCase;
-import com.android.systemui.demomode.DemoModeController;
-import com.android.systemui.flags.FeatureFlags;
-import com.android.systemui.plugins.DarkIconDispatcher;
-import com.android.systemui.plugins.statusbar.StatusBarStateController;
-import com.android.systemui.statusbar.NotificationListener;
-import com.android.systemui.statusbar.NotificationMediaManager;
-import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
-import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider;
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor;
-import com.android.systemui.statusbar.window.StatusBarWindowController;
-import com.android.wm.shell.bubbles.Bubbles;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import java.util.Optional;
-
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-@TestableLooper.RunWithLooper
-@DisableFlags(NotificationIconContainerRefactor.FLAG_NAME)
-public class LegacyNotificationIconAreaControllerImplTest extends SysuiTestCase {
-
- @Mock
- private NotificationListener mListener;
- @Mock
- StatusBarStateController mStatusBarStateController;
- @Mock
- NotificationWakeUpCoordinator mWakeUpCoordinator;
- @Mock
- KeyguardBypassController mKeyguardBypassController;
- @Mock
- NotificationMediaManager mNotificationMediaManager;
- @Mock
- DozeParameters mDozeParameters;
- @Mock
- SectionStyleProvider mSectionStyleProvider;
- @Mock
- DarkIconDispatcher mDarkIconDispatcher;
- @Mock
- StatusBarWindowController mStatusBarWindowController;
- @Mock
- ScreenOffAnimationController mScreenOffAnimationController;
- private LegacyNotificationIconAreaControllerImpl mController;
- @Mock
- private Bubbles mBubbles;
- @Mock private DemoModeController mDemoModeController;
- @Mock
- private NotificationIconContainer mAodIcons;
- @Mock
- private FeatureFlags mFeatureFlags;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- mController = new LegacyNotificationIconAreaControllerImpl(
- mContext,
- mStatusBarStateController,
- mWakeUpCoordinator,
- mKeyguardBypassController,
- mNotificationMediaManager,
- mListener,
- mDozeParameters,
- mSectionStyleProvider,
- Optional.of(mBubbles),
- mDemoModeController,
- mDarkIconDispatcher,
- mFeatureFlags,
- mStatusBarWindowController,
- mScreenOffAnimationController);
- }
-
- @Test
- public void testNotificationIcons_settingHideIcons() {
- mController.mSettingsListener.onStatusBarIconsBehaviorChanged(true);
-
- assertFalse(mController.shouldShouldLowPriorityIcons());
- }
-
- @Test
- public void testNotificationIcons_settingShowIcons() {
- mController.mSettingsListener.onStatusBarIconsBehaviorChanged(false);
-
- assertTrue(mController.shouldShouldLowPriorityIcons());
- }
-
- @Test
- @DisableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
- public void testAppearResetsTranslation() {
- mController.setupAodIcons(mAodIcons);
- when(mDozeParameters.shouldControlScreenOff()).thenReturn(false);
- mController.appearAodIcons();
- verify(mAodIcons).setTranslationY(0);
- verify(mAodIcons).setAlpha(1.0f);
- }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt
index 9d97e5a..15958ef 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt
@@ -23,7 +23,6 @@
import com.android.systemui.statusbar.StatusBarIconView
import com.android.systemui.statusbar.StatusBarIconView.STATE_DOT
import com.android.systemui.statusbar.StatusBarIconView.STATE_HIDDEN
-import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
import junit.framework.Assert.assertEquals
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
@@ -73,18 +72,6 @@
}
@Test
- fun calculateWidthFor_fiveIcons_widthForFourIcons() {
- mSetFlagsRule.disableFlags(NotificationIconContainerRefactor.FLAG_NAME)
- iconContainer.setActualPaddingStart(10f)
- iconContainer.setActualPaddingEnd(10f)
- iconContainer.setIconSize(10)
- assertEquals(
- /* expected= */ iconContainer.calculateWidthFor(/* numIcons= */ 5f),
- /* actual= */ 60f
- )
- }
-
- @Test
fun calculateIconXTranslations_shortShelfOneIcon_atCorrectXWithoutOverflowDot() {
iconContainer.setActualPaddingStart(10f)
iconContainer.setActualPaddingEnd(10f)
@@ -213,19 +200,6 @@
}
@Test
- fun shouldForceOverflow_appearingAboveSpeedBump_true() {
- mSetFlagsRule.disableFlags(NotificationIconContainerRefactor.FLAG_NAME)
- val forceOverflow =
- iconContainer.shouldForceOverflow(
- /* i= */ 1,
- /* speedBumpIndex= */ 0,
- /* iconAppearAmount= */ 1f,
- /* maxVisibleIcons= */ 5
- )
- assertTrue(forceOverflow)
- }
-
- @Test
fun shouldForceOverflow_moreThanMaxVisible_true() {
val forceOverflow =
iconContainer.shouldForceOverflow(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
index 58ad835..bea027f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
@@ -39,7 +39,6 @@
import android.provider.Settings;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
-import android.view.LayoutInflater;
import android.view.View;
import androidx.test.filters.SmallTest;
@@ -64,7 +63,6 @@
import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerStatusBarViewBinder;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
-import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.StatusBarHideIconsForBouncerManager;
import com.android.systemui.statusbar.phone.StatusBarLocationPublisher;
import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent;
@@ -95,7 +93,6 @@
@RunWithLooper(setAsMainLooper = true)
@SmallTest
public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
- private NotificationIconAreaController mMockNotificationAreaController;
private ShadeExpansionStateManager mShadeExpansionStateManager;
private OngoingCallController mOngoingCallController;
private SystemStatusAnimationScheduler mAnimationScheduler;
@@ -931,13 +928,11 @@
mCollapsedStatusBarViewModel = new FakeCollapsedStatusBarViewModel();
mCollapsedStatusBarViewBinder = new FakeCollapsedStatusBarViewBinder();
- setUpNotificationIconAreaController();
return new CollapsedStatusBarFragment(
mStatusBarFragmentComponentFactory,
mOngoingCallController,
mAnimationScheduler,
mLocationPublisher,
- mMockNotificationAreaController,
mShadeExpansionStateManager,
mStatusBarIconController,
mIconManagerFactory,
@@ -970,14 +965,6 @@
.thenReturn(mHeadsUpAppearanceController);
}
- private void setUpNotificationIconAreaController() {
- mMockNotificationAreaController = mock(NotificationIconAreaController.class);
- View notificationAreaInner =
- LayoutInflater.from(mContext).inflate(R.layout.notification_icon_area, null);
- when(mMockNotificationAreaController.getNotificationInnerAreaView())
- .thenReturn(notificationAreaInner);
- }
-
/**
* Configure mocks to return values consistent with the secure camera animating itself launched
* over the keyguard.
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinderKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinderKosmos.kt
index ee3216b..bc1363a 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinderKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinderKosmos.kt
@@ -29,22 +29,20 @@
import com.android.systemui.statusbar.notification.stack.ui.view.notificationStatsLogger
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.notificationListViewModel
import com.android.systemui.statusbar.notification.ui.viewbinder.headsUpNotificationViewBinder
-import com.android.systemui.statusbar.phone.notificationIconAreaController
import java.util.Optional
val Kosmos.notificationListViewBinder by Fixture {
NotificationListViewBinder(
- viewModel = notificationListViewModel,
backgroundDispatcher = testDispatcher,
+ hiderTracker = displaySwitchNotificationsHiderTracker,
configuration = configurationState,
falsingManager = falsingManager,
hunBinder = headsUpNotificationViewBinder,
- iconAreaController = notificationIconAreaController,
loggerOptional = Optional.of(notificationStatsLogger),
metricsLogger = metricsLogger,
- hiderTracker = displaySwitchNotificationsHiderTracker,
nicBinder = notificationIconContainerShelfViewBinder,
notificationActivityStarter = { notificationActivityStarter },
silentHeaderController = silentHeaderController,
+ viewModel = notificationListViewModel,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/DozeServiceHostKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/DozeServiceHostKosmos.kt
index 0b5a68e..4a6757d 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/DozeServiceHostKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/DozeServiceHostKosmos.kt
@@ -53,7 +53,6 @@
notificationShadeWindowController,
notificationWakeUpCoordinator,
authController,
- notificationIconAreaController,
shadeLockscreenInteractor,
dozeInteractor,
)
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerKosmos.kt
deleted file mode 100644
index d44e061..0000000
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerKosmos.kt
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.statusbar.phone
-
-import com.android.systemui.kosmos.Kosmos
-import com.android.systemui.kosmos.Kosmos.Fixture
-import com.android.systemui.util.mockito.mock
-
-var Kosmos.notificationIconAreaController by Fixture { mock<NotificationIconAreaController>() }