summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Han <kevhan@google.com> 2020-03-10 16:05:07 -0700
committer Kevin Han <kevhan@google.com> 2020-04-10 17:25:56 -0700
commit3742322d040fb4a7c48eab7c9b3635a94a7e1e0c (patch)
tree5a0e2c6631a519006373906711d65837e47d748a
parent661a6fdd56e21f8ce98699ce033cf898112eb9d5 (diff)
Clean up NotificationRowBinderImpl
Clean up a few things in NotificationRowBinderImpl *Remove a bunch of dead parameters and methodsd *Split logic into three main helper methods 1) bindRow - called once when row is made 2) updateRow - called to update row view state whenever the notification is updated 3) inflateContentViews - called to initiate row content inflation whenever notification is updated *Try to move other logic to appropriate places -Mainly move targetSdk resolution to be right after setting the sbn instead of after the row is inflated. This also makes icons neater to manage since we can immediately set the tag Bug: 145749521 Test: atest SystemUITests Change-Id: Id59a28c0fbbe1df5ffc4ec8eef58d760b8c6df05
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt56
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java94
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionListener.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifEvent.kt10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt24
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/TestableNotificationEntryManager.kt9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java4
12 files changed, 139 insertions, 95 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
index 9324b14bf211..eb97169d2483 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
@@ -558,6 +558,10 @@ public class NotificationEntryManager implements
ranking,
mFgsFeatureController.isForegroundServiceDismissalEnabled(),
SystemClock.uptimeMillis());
+ for (NotifCollectionListener listener : mNotifCollectionListeners) {
+ listener.onEntryBind(entry, notification);
+ }
+ mAllNotifications.add(entry);
mLeakDetector.trackInstance(entry);
@@ -612,7 +616,9 @@ public class NotificationEntryManager implements
updateRankingAndSort(ranking, "updateNotificationInternal");
StatusBarNotification oldSbn = entry.getSbn();
entry.setSbn(notification);
- mGroupManager.onEntryUpdated(entry, oldSbn);
+ for (NotifCollectionListener listener : mNotifCollectionListeners) {
+ listener.onEntryBind(entry, notification);
+ } mGroupManager.onEntryUpdated(entry, oldSbn);
mLogger.logNotifUpdated(entry.getKey());
for (NotificationEntryListener listener : mNotificationEntryListeners) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java
index 365862bef871..a3621b6cabf6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java
@@ -65,6 +65,7 @@ import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.notification.collection.coalescer.CoalescedEvent;
import com.android.systemui.statusbar.notification.collection.coalescer.GroupCoalescer;
import com.android.systemui.statusbar.notification.collection.coalescer.GroupCoalescer.BatchableNotificationHandler;
+import com.android.systemui.statusbar.notification.collection.notifcollection.BindEntryEvent;
import com.android.systemui.statusbar.notification.collection.notifcollection.CleanUpEntryEvent;
import com.android.systemui.statusbar.notification.collection.notifcollection.CollectionReadyForBuildListener;
import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats;
@@ -389,6 +390,7 @@ public class NotifCollection implements Dumpable {
if (entry == null) {
// A new notification!
entry = new NotificationEntry(sbn, ranking, SystemClock.uptimeMillis());
+ mEventQueue.add(new BindEntryEvent(entry, sbn));
mNotificationSet.put(sbn.getKey(), entry);
mLogger.logNotifPosted(sbn.getKey());
@@ -409,6 +411,7 @@ public class NotifCollection implements Dumpable {
entry.mCancellationReason = REASON_NOT_CANCELED;
entry.setSbn(sbn);
+ mEventQueue.add(new BindEntryEvent(entry, sbn));
mLogger.logNotifUpdated(sbn.getKey());
mEventQueue.add(new EntryUpdatedEvent(entry));
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
index 68ec34e90760..749c3e4c9d0d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
@@ -408,15 +408,6 @@ public final class NotificationEntry extends ListEntry {
return wasBubble != isBubble();
}
- /**
- * Resets the notification entry to be re-used.
- */
- public void reset() {
- if (row != null) {
- row.reset();
- }
- }
-
@NotificationSectionsManager.PriorityBucket
public int getBucket() {
return mBucket;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt
new file mode 100644
index 000000000000..1c1b2bb087f0
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt
@@ -0,0 +1,56 @@
+/*
+ * 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.notification.collection
+
+import android.content.Context
+import android.content.pm.PackageManager
+import android.service.notification.StatusBarNotification
+import android.util.Log
+import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection
+import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener
+import com.android.systemui.statusbar.phone.StatusBar
+import javax.inject.Inject
+import javax.inject.Singleton
+
+@Singleton
+class TargetSdkResolver @Inject constructor(
+ private val context: Context,
+ private val collection: CommonNotifCollection
+) {
+ init {
+ collection.addCollectionListener(object : NotifCollectionListener {
+ override fun onEntryBind(entry: NotificationEntry, sbn: StatusBarNotification) {
+ entry.targetSdk = resolveNotificationSdk(sbn)
+ }
+ })
+ }
+
+ private fun resolveNotificationSdk(sbn: StatusBarNotification): Int {
+ val pmUser = StatusBar.getPackageManagerForUser(context, sbn.user.identifier)
+ var targetSdk = 0
+ // Extract target SDK version.
+ try {
+ val info = pmUser.getApplicationInfo(sbn.packageName, 0)
+ targetSdk = info.targetSdkVersion
+ } catch (ex: PackageManager.NameNotFoundException) {
+ Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.packageName, ex)
+ }
+ return targetSdk
+ }
+
+ private val TAG = "TargetSdkResolver"
+} \ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java
index 32f1822804f8..74cf7511aec7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java
@@ -16,13 +16,11 @@
package com.android.systemui.statusbar.notification.collection.inflation;
+import static java.util.Objects.requireNonNull;
+
import android.annotation.Nullable;
import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
import android.os.Build;
-import android.service.notification.StatusBarNotification;
-import android.util.Log;
import android.view.ViewGroup;
import com.android.internal.util.NotificationMessagingUtil;
@@ -44,9 +42,6 @@ import com.android.systemui.statusbar.notification.row.RowContentBindStage;
import com.android.systemui.statusbar.notification.row.RowInflaterTask;
import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
-import com.android.systemui.statusbar.phone.StatusBar;
-
-import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Provider;
@@ -128,14 +123,13 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
public void inflateViews(NotificationEntry entry, Runnable onDismissRunnable)
throws InflationException {
ViewGroup parent = mListContainer.getViewParentForNotification(entry);
- PackageManager pmUser = StatusBar.getPackageManagerForUser(mContext,
- entry.getSbn().getUser().getIdentifier());
- final StatusBarNotification sbn = entry.getSbn();
if (entry.rowExists()) {
mIconManager.updateIcons(entry);
- entry.reset();
- updateNotification(entry, pmUser, sbn, entry.getRow());
+ ExpandableNotificationRow row = entry.getRow();
+ row.reset();
+ updateRow(entry, row);
+ inflateContentViews(entry, row);
entry.getRowController().setOnDismissRunnable(onDismissRunnable);
} else {
mIconManager.createIcons(entry);
@@ -155,21 +149,27 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
component.getExpandableNotificationRowController();
rowController.init();
entry.setRowController(rowController);
- bindRow(entry, pmUser, sbn, row);
- updateNotification(entry, pmUser, sbn, row);
+ bindRow(entry, row);
+ updateRow(entry, row);
+ inflateContentViews(entry, row);
});
}
}
- //TODO: This method associates a row with an entry, but eventually needs to not do that
- private void bindRow(NotificationEntry entry, PackageManager pmUser,
- StatusBarNotification sbn, ExpandableNotificationRow row) {
+ /**
+ * Bind row to various controllers and managers. This is only called when the row is first
+ * created.
+ *
+ * TODO: This method associates a row with an entry, but eventually needs to not do that
+ */
+ private void bindRow(NotificationEntry entry, ExpandableNotificationRow row) {
mListContainer.bindRow(row);
mNotificationRemoteInputManager.bindRow(row);
+ row.setOnActivatedListener(mPresenter);
entry.setRow(row);
row.setEntry(entry);
mNotifBindPipeline.manageRow(entry, row);
- mBindRowCallback.onBindRow(entry, pmUser, sbn, row);
+ mBindRowCallback.onBindRow(row);
}
/**
@@ -184,11 +184,10 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
NotificationUiAdjustment newAdjustment) {
if (NotificationUiAdjustment.needReinflate(oldAdjustment, newAdjustment)) {
if (entry.rowExists()) {
- entry.reset();
- PackageManager pmUser = StatusBar.getPackageManagerForUser(
- mContext,
- entry.getSbn().getUser().getIdentifier());
- updateNotification(entry, pmUser, entry.getSbn(), entry.getRow());
+ ExpandableNotificationRow row = entry.getRow();
+ row.reset();
+ updateRow(entry, row);
+ inflateContentViews(entry, row);
} else {
// Once the RowInflaterTask is done, it will pick up the updated entry, so
// no-op here.
@@ -202,59 +201,52 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
}
}
- private void updateNotification(
+ /**
+ * Update row after the notification has updated.
+ *
+ * @param entry notification that has updated
+ */
+ private void updateRow(
NotificationEntry entry,
- PackageManager pmUser,
- StatusBarNotification sbn,
ExpandableNotificationRow row) {
-
- // Extract target SDK version.
- try {
- ApplicationInfo info = pmUser.getApplicationInfo(sbn.getPackageName(), 0);
- entry.targetSdk = info.targetSdkVersion;
- } catch (PackageManager.NameNotFoundException ex) {
- Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex);
- }
row.setLegacy(entry.targetSdk >= Build.VERSION_CODES.GINGERBREAD
&& entry.targetSdk < Build.VERSION_CODES.LOLLIPOP);
- // TODO: should this be happening somewhere else?
- mIconManager.updateIconTags(entry, entry.targetSdk);
-
- row.setOnActivatedListener(mPresenter);
+ // bind the click event to the content area
+ requireNonNull(mNotificationClicker).register(row, entry.getSbn());
+ }
+ /**
+ * Inflate the row's basic content views.
+ */
+ private void inflateContentViews(
+ NotificationEntry entry,
+ ExpandableNotificationRow row) {
final boolean useIncreasedCollapsedHeight =
- mMessagingUtil.isImportantMessaging(sbn, entry.getImportance());
+ mMessagingUtil.isImportantMessaging(entry.getSbn(), entry.getImportance());
final boolean isLowPriority = entry.isAmbient();
RowContentBindParams params = mRowContentBindStage.getStageParams(entry);
params.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight);
params.setUseLowPriority(entry.isAmbient());
- //TODO: Replace this API with RowContentBindParams directly
+ // TODO: Replace this API with RowContentBindParams directly. Also move to a separate
+ // redaction controller.
row.setNeedsRedaction(mNotificationLockscreenUserManager.needsRedaction(entry));
+
params.rebindAllContentViews();
mRowContentBindStage.requestRebind(entry, en -> {
row.setUsesIncreasedCollapsedHeight(useIncreasedCollapsedHeight);
row.setIsLowPriority(isLowPriority);
mInflationCallback.onAsyncInflationFinished(en);
});
-
- // bind the click event to the content area
- Objects.requireNonNull(mNotificationClicker).register(row, sbn);
}
/** Callback for when a row is bound to an entry. */
public interface BindRowCallback {
/**
- * Called when a new notification and row is created.
- *
- * @param entry entry for the notification
- * @param pmUser package manager for user
- * @param sbn notification
- * @param row row for the notification
+ * Called when a new row is created and bound to a notification.
*/
- void onBindRow(NotificationEntry entry, PackageManager pmUser,
- StatusBarNotification sbn, ExpandableNotificationRow row);
+ void onBindRow(ExpandableNotificationRow row);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionListener.java
index 41ca52d5a626..59f119e987b4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionListener.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionListener.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification.collection.notifcollection;
import android.service.notification.NotificationListenerService;
+import android.service.notification.StatusBarNotification;
import com.android.systemui.statusbar.notification.collection.NotifCollection.CancellationReason;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -25,6 +26,15 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
* Listener interface for {@link NotificationEntry} events.
*/
public interface NotifCollectionListener {
+
+ /**
+ * Called when the entry is having a new status bar notification bound to it. This should
+ * be used to initialize any derivative state on the entry that needs to update when the
+ * notification is updated.
+ */
+ default void onEntryBind(NotificationEntry entry, StatusBarNotification sbn) {
+ }
+
/**
* Called whenever a new {@link NotificationEntry} is initialized. This should be used for
* initializing any decorated state tied to the notification.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifEvent.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifEvent.kt
index 2ef0368061ba..2810b891373f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifEvent.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifEvent.kt
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification.collection.notifcollection
import android.service.notification.NotificationListenerService.RankingMap
+import android.service.notification.StatusBarNotification
import com.android.systemui.statusbar.notification.collection.NotifCollection
import com.android.systemui.statusbar.notification.collection.NotificationEntry
@@ -37,6 +38,15 @@ sealed class NotifEvent {
abstract fun dispatchToListener(listener: NotifCollectionListener)
}
+data class BindEntryEvent(
+ val entry: NotificationEntry,
+ val sbn: StatusBarNotification
+) : NotifEvent() {
+ override fun dispatchToListener(listener: NotifCollectionListener) {
+ listener.onEntryBind(entry, sbn)
+ }
+}
+
data class InitEntryEvent(
val entry: NotificationEntry
) : NotifEvent() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
index da8ad2da5c87..08be4f872415 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
@@ -172,18 +172,6 @@ class IconManager @Inject constructor(
}
}
- /**
- * Updates tags on the icon views to match the posting app's target SDK level
- *
- * Note that this method MUST be called after both [createIcons] and [updateIcons].
- */
- fun updateIconTags(entry: NotificationEntry, targetSdk: Int) {
- setTagOnIconViews(
- entry.icons,
- R.id.icon_is_pre_L,
- targetSdk < Build.VERSION_CODES.LOLLIPOP)
- }
-
private fun updateIconsSafe(entry: NotificationEntry) {
try {
updateIcons(entry)
@@ -259,6 +247,7 @@ class IconManager @Inject constructor(
iconView: StatusBarIconView
) {
iconView.setShowsConversation(showsConversation(entry, iconView, iconDescriptor))
+ iconView.setTag(R.id.icon_is_pre_L, entry.targetSdk < Build.VERSION_CODES.LOLLIPOP)
if (!iconView.set(iconDescriptor)) {
throw InflationException("Couldn't create icon $iconDescriptor")
}
@@ -326,20 +315,13 @@ class IconManager @Inject constructor(
val usedInSensitiveContext =
iconView === entry.icons.shelfIcon || iconView === entry.icons.aodIcon
val isSmallIcon = iconDescriptor.icon.equals(entry.sbn.notification.smallIcon)
- return isImportantConversation(entry) && !isSmallIcon
- && (!usedInSensitiveContext || !entry.isSensitive)
+ return isImportantConversation(entry) && !isSmallIcon &&
+ (!usedInSensitiveContext || !entry.isSensitive)
}
private fun isImportantConversation(entry: NotificationEntry): Boolean {
return entry.ranking.channel != null && entry.ranking.channel.isImportantConversation
}
-
- private fun setTagOnIconViews(icons: IconPack, key: Int, tag: Any) {
- icons.statusBarIcon?.setTag(key, tag)
- icons.shelfIcon?.setTag(key, tag)
- icons.aodIcon?.setTag(key, tag)
- icons.centeredIcon?.setTag(key, tag)
- }
}
private const val TAG = "IconManager" \ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
index 8b3d06b97882..f8d9c4648ac9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
@@ -60,7 +60,6 @@ public class ExpandableNotificationRowController {
private final HeadsUpManager mHeadsUpManager;
private final ExpandableNotificationRow.OnExpandClickListener mOnExpandClickListener;
private final StatusBarStateController mStatusBarStateController;
- private final NotificationRowContentBinder.InflationCallback mInflationCallback;
private final ExpandableNotificationRow.ExpansionLogger mExpansionLogger =
this::logNotificationExpansion;
@@ -82,7 +81,6 @@ public class ExpandableNotificationRowController {
NotificationLogger notificationLogger, HeadsUpManager headsUpManager,
ExpandableNotificationRow.OnExpandClickListener onExpandClickListener,
StatusBarStateController statusBarStateController,
- NotificationRowContentBinder.InflationCallback inflationCallback,
NotificationGutsManager notificationGutsManager,
@Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) boolean allowLongPress,
@DismissRunnable Runnable onDismissRunnable, FalsingManager falsingManager,
@@ -101,7 +99,6 @@ public class ExpandableNotificationRowController {
mHeadsUpManager = headsUpManager;
mOnExpandClickListener = onExpandClickListener;
mStatusBarStateController = statusBarStateController;
- mInflationCallback = inflationCallback;
mNotificationGutsManager = notificationGutsManager;
mOnDismissRunnable = onDismissRunnable;
mOnAppOpsClickListener = mNotificationGutsManager::openGuts;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java
index 79cea91b8612..aecbb9097c7a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java
@@ -22,7 +22,6 @@ import static com.android.systemui.statusbar.phone.StatusBar.SPEW;
import android.annotation.Nullable;
import android.app.KeyguardManager;
import android.content.Context;
-import android.content.pm.PackageManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.service.notification.StatusBarNotification;
@@ -355,8 +354,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter,
}
@Override
- public void onBindRow(NotificationEntry entry, PackageManager pmUser,
- StatusBarNotification sbn, ExpandableNotificationRow row) {
+ public void onBindRow(ExpandableNotificationRow row) {
row.setAboveShelfChangedListener(mAboveShelfObserver);
row.setSecureStateProvider(mKeyguardStateController::canDismissLockScreen);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/TestableNotificationEntryManager.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/TestableNotificationEntryManager.kt
index d522f903c83a..698cae4d8bc1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/TestableNotificationEntryManager.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/TestableNotificationEntryManager.kt
@@ -24,6 +24,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationRankin
import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinder
import com.android.systemui.statusbar.phone.NotificationGroupManager
import com.android.systemui.util.leak.LeakDetector
+import dagger.Lazy
import java.util.concurrent.CountDownLatch
/**
@@ -35,12 +36,12 @@ class TestableNotificationEntryManager(
rm: NotificationRankingManager,
ke: KeyguardEnvironment,
ff: FeatureFlags,
- rb: dagger.Lazy<NotificationRowBinder>,
- notificationRemoteInputManagerLazy: dagger.Lazy<NotificationRemoteInputManager>,
+ rb: Lazy<NotificationRowBinder>,
+ notificationRemoteInputManagerLazy: Lazy<NotificationRemoteInputManager>,
leakDetector: LeakDetector,
fgsFeatureController: ForegroundServiceDismissalFeatureController
-) : NotificationEntryManager(logger, gm, rm, ke, ff, rb,
- notificationRemoteInputManagerLazy, leakDetector, fgsFeatureController) {
+) : NotificationEntryManager(logger, gm, rm, ke, ff, rb, notificationRemoteInputManagerLazy,
+ leakDetector, fgsFeatureController) {
public var countDownLatch: CountDownLatch = CountDownLatch(1)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java
index 1c6e5a36bd8a..774b5eddc686 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java
@@ -23,7 +23,6 @@ import static com.android.systemui.statusbar.notification.row.NotificationRowCon
import static junit.framework.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
@@ -243,7 +242,6 @@ public class NotificationEntryManagerInflationTest extends SysuiTestCase {
mHeadsUpManager,
mPresenter,
mStatusBarStateController,
- mEntryManager,
mGutsManager,
true,
null,
@@ -330,7 +328,7 @@ public class NotificationEntryManagerInflationTest extends SysuiTestCase {
assertNotNull(entry.getRow().getPrivateLayout().getContractedChild());
// THEN inflation callbacks are called
- verify(mBindCallback).onBindRow(eq(entry), any(), eq(mSbn), any());
+ verify(mBindCallback).onBindRow(entry.getRow());
verify(mEntryListener, never()).onInflationError(any(), any());
verify(mEntryListener).onEntryInflated(entry);
verify(mEntryListener).onNotificationAdded(entry);