Merge "Remove NotifEntryManager" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9e53673684
@@ -85,8 +85,6 @@ import com.android.systemui.statusbar.SmartReplyController;
|
||||
import com.android.systemui.statusbar.VibratorHelper;
|
||||
import com.android.systemui.statusbar.events.PrivacyDotViewController;
|
||||
import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager.KeyguardEnvironment;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
|
||||
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
|
||||
@@ -301,7 +299,6 @@ public class Dependency {
|
||||
@Inject Lazy<IStatusBarService> mIStatusBarService;
|
||||
@Inject Lazy<DisplayMetrics> mDisplayMetrics;
|
||||
@Inject Lazy<LockscreenGestureLogger> mLockscreenGestureLogger;
|
||||
@Inject Lazy<KeyguardEnvironment> mKeyguardEnvironment;
|
||||
@Inject Lazy<ShadeController> mShadeController;
|
||||
@Inject Lazy<NotificationRemoteInputManager.Callback> mNotificationRemoteInputManagerCallback;
|
||||
@Inject Lazy<AppOpsController> mAppOpsController;
|
||||
@@ -318,10 +315,8 @@ public class Dependency {
|
||||
@Inject Lazy<KeyguardDismissUtil> mKeyguardDismissUtil;
|
||||
@Inject Lazy<SmartReplyController> mSmartReplyController;
|
||||
@Inject Lazy<RemoteInputQuickSettingsDisabler> mRemoteInputQuickSettingsDisabler;
|
||||
@Inject Lazy<NotificationEntryManager> mNotificationEntryManager;
|
||||
@Inject Lazy<SensorPrivacyManager> mSensorPrivacyManager;
|
||||
@Inject Lazy<AutoHideController> mAutoHideController;
|
||||
@Inject Lazy<ForegroundServiceNotificationListener> mForegroundServiceNotificationListener;
|
||||
@Inject Lazy<PrivacyItemController> mPrivacyItemController;
|
||||
@Inject @Background Lazy<Looper> mBgLooper;
|
||||
@Inject @Background Lazy<Handler> mBgHandler;
|
||||
@@ -503,7 +498,6 @@ public class Dependency {
|
||||
|
||||
mProviders.put(LockscreenGestureLogger.class, mLockscreenGestureLogger::get);
|
||||
|
||||
mProviders.put(KeyguardEnvironment.class, mKeyguardEnvironment::get);
|
||||
mProviders.put(ShadeController.class, mShadeController::get);
|
||||
|
||||
mProviders.put(NotificationRemoteInputManager.Callback.class,
|
||||
@@ -530,9 +524,6 @@ public class Dependency {
|
||||
mProviders.put(SmartReplyController.class, mSmartReplyController::get);
|
||||
mProviders.put(RemoteInputQuickSettingsDisabler.class,
|
||||
mRemoteInputQuickSettingsDisabler::get);
|
||||
mProviders.put(NotificationEntryManager.class, mNotificationEntryManager::get);
|
||||
mProviders.put(ForegroundServiceNotificationListener.class,
|
||||
mForegroundServiceNotificationListener::get);
|
||||
mProviders.put(ClockManager.class, mClockManager::get);
|
||||
mProviders.put(PrivacyItemController.class, mPrivacyItemController::get);
|
||||
mProviders.put(ActivityManagerWrapper.class, mActivityManagerWrapper::get);
|
||||
|
||||
@@ -23,14 +23,10 @@ import android.os.Bundle;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.statusbar.NotificationVisibility;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener;
|
||||
import com.android.systemui.util.time.SystemClock;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -43,42 +39,20 @@ public class ForegroundServiceNotificationListener {
|
||||
|
||||
private final Context mContext;
|
||||
private final ForegroundServiceController mForegroundServiceController;
|
||||
private final NotificationEntryManager mEntryManager;
|
||||
private final NotifPipeline mNotifPipeline;
|
||||
|
||||
@Inject
|
||||
public ForegroundServiceNotificationListener(Context context,
|
||||
ForegroundServiceController foregroundServiceController,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
NotifPipeline notifPipeline,
|
||||
SystemClock systemClock) {
|
||||
NotifPipeline notifPipeline) {
|
||||
mContext = context;
|
||||
mForegroundServiceController = foregroundServiceController;
|
||||
mNotifPipeline = notifPipeline;
|
||||
}
|
||||
|
||||
// TODO: (b/145659174) remove mEntryManager when moving to NewNotifPipeline. Replaced by
|
||||
// ForegroundCoordinator
|
||||
mEntryManager = notificationEntryManager;
|
||||
mEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
|
||||
@Override
|
||||
public void onPendingEntryAdded(NotificationEntry entry) {
|
||||
addNotification(entry, entry.getImportance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreEntryUpdated(NotificationEntry entry) {
|
||||
updateNotification(entry, entry.getImportance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntryRemoved(
|
||||
NotificationEntry entry,
|
||||
NotificationVisibility visibility,
|
||||
boolean removedByUser,
|
||||
int reason) {
|
||||
removeNotification(entry.getSbn());
|
||||
}
|
||||
});
|
||||
|
||||
notifPipeline.addCollectionListener(new NotifCollectionListener() {
|
||||
/** Initializes this listener by connecting it to the notification pipeline. */
|
||||
public void init() {
|
||||
mNotifPipeline.addCollectionListener(new NotifCollectionListener() {
|
||||
@Override
|
||||
public void onEntryAdded(NotificationEntry entry) {
|
||||
addNotification(entry, entry.getImportance());
|
||||
|
||||
@@ -54,13 +54,11 @@ import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.dagger.StartCentralSurfacesModule;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.provider.VisualStabilityProvider;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
|
||||
import com.android.systemui.statusbar.phone.DozeServiceHost;
|
||||
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
|
||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
|
||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||
import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
@@ -169,10 +167,6 @@ public abstract class ReferenceSystemUIModule {
|
||||
@Binds
|
||||
abstract DockManager bindDockManager(DockManagerImpl dockManager);
|
||||
|
||||
@Binds
|
||||
abstract NotificationEntryManager.KeyguardEnvironment bindKeyguardEnvironment(
|
||||
KeyguardEnvironmentImpl keyguardEnvironment);
|
||||
|
||||
@Binds
|
||||
abstract ShadeController provideShadeController(ShadeControllerImpl shadeController);
|
||||
|
||||
|
||||
@@ -161,7 +161,6 @@ import com.android.systemui.statusbar.events.PrivacyDotViewController;
|
||||
import com.android.systemui.statusbar.notification.AnimatableProperty;
|
||||
import com.android.systemui.statusbar.notification.ConversationNotificationManager;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||
import com.android.systemui.statusbar.notification.PropertyAnimator;
|
||||
import com.android.systemui.statusbar.notification.ViewGroupFadeHelper;
|
||||
@@ -518,7 +517,6 @@ public final class NotificationPanelViewController extends PanelViewController {
|
||||
}
|
||||
}).setCustomInterpolator(
|
||||
mPanelAlphaAnimator.getProperty(), Interpolators.ALPHA_IN);
|
||||
private final NotificationEntryManager mEntryManager;
|
||||
|
||||
private final CommandQueue mCommandQueue;
|
||||
private final UserManager mUserManager;
|
||||
@@ -709,7 +707,6 @@ public final class NotificationPanelViewController extends PanelViewController {
|
||||
DynamicPrivacyController dynamicPrivacyController,
|
||||
KeyguardBypassController bypassController, FalsingManager falsingManager,
|
||||
FalsingCollector falsingCollector,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
KeyguardStateController keyguardStateController,
|
||||
StatusBarStateController statusBarStateController,
|
||||
StatusBarWindowStateController statusBarWindowStateController,
|
||||
@@ -867,7 +864,6 @@ public final class NotificationPanelViewController extends PanelViewController {
|
||||
});
|
||||
mBottomAreaShadeAlphaAnimator.setDuration(160);
|
||||
mBottomAreaShadeAlphaAnimator.setInterpolator(Interpolators.ALPHA_OUT);
|
||||
mEntryManager = notificationEntryManager;
|
||||
mConversationNotificationManager = conversationNotificationManager;
|
||||
mAuthController = authController;
|
||||
mLockIconViewController = lockIconViewController;
|
||||
@@ -4729,7 +4725,6 @@ public final class NotificationPanelViewController extends PanelViewController {
|
||||
public void showAodUi() {
|
||||
setDozing(true /* dozing */, false /* animate */);
|
||||
mStatusBarStateController.setUpcomingState(KEYGUARD);
|
||||
mEntryManager.updateNotifications("showAodUi");
|
||||
mStatusBarStateListener.onStateChanged(KEYGUARD);
|
||||
mStatusBarStateListener.onDozeAmountChanged(1f, 1f);
|
||||
setExpandedFraction(1f);
|
||||
|
||||
@@ -51,7 +51,6 @@ import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider;
|
||||
@@ -85,9 +84,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
private final SecureSettings mSecureSettings;
|
||||
private final Object mLock = new Object();
|
||||
|
||||
// Lazy
|
||||
private NotificationEntryManager mEntryManager;
|
||||
|
||||
private final Lazy<NotificationVisibilityProvider> mVisibilityProviderLazy;
|
||||
private final Lazy<CommonNotifCollection> mCommonNotifCollectionLazy;
|
||||
private final DevicePolicyManager mDevicePolicyManager;
|
||||
@@ -119,7 +115,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
isCurrentProfile(getSendingUserId())) {
|
||||
mUsersAllowingPrivateNotifications.clear();
|
||||
updateLockscreenNotificationSetting();
|
||||
getEntryManager().updateNotifications("ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED");
|
||||
// TODO(b/231976036): Consolidate pipeline invalidations related to this event
|
||||
// notifyNotificationStateChanged();
|
||||
}
|
||||
@@ -140,10 +135,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
|
||||
updateLockscreenNotificationSetting();
|
||||
updatePublicMode();
|
||||
// The filtering needs to happen before the update call below in order to
|
||||
// make sure
|
||||
// the presenter has the updated notifications from the new user
|
||||
getEntryManager().reapplyFilterAndSort("user switched");
|
||||
mPresenter.onUserSwitched(mCurrentUserId);
|
||||
|
||||
for (UserChangedListener listener : mListeners) {
|
||||
@@ -200,13 +191,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
protected ContentObserver mSettingsObserver;
|
||||
private boolean mHideSilentNotificationsOnLockscreen;
|
||||
|
||||
private NotificationEntryManager getEntryManager() {
|
||||
if (mEntryManager == null) {
|
||||
mEntryManager = Dependency.get(NotificationEntryManager.class);
|
||||
}
|
||||
return mEntryManager;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public NotificationLockscreenUserManagerImpl(Context context,
|
||||
BroadcastDispatcher broadcastDispatcher,
|
||||
@@ -253,8 +237,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
mUsersAllowingNotifications.clear();
|
||||
// ... and refresh all the notifications
|
||||
updateLockscreenNotificationSetting();
|
||||
getEntryManager().updateNotifications("LOCK_SCREEN_SHOW_NOTIFICATIONS,"
|
||||
+ " or LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS change");
|
||||
notifyNotificationStateChanged();
|
||||
}
|
||||
};
|
||||
@@ -264,8 +246,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
public void onChange(boolean selfChange) {
|
||||
updateLockscreenNotificationSetting();
|
||||
if (mDeviceProvisionedController.isDeviceProvisioned()) {
|
||||
getEntryManager().updateNotifications("LOCK_SCREEN_ALLOW_REMOTE_INPUT"
|
||||
+ " or ZEN_MODE change");
|
||||
// TODO(b/231976036): Consolidate pipeline invalidations related to this event
|
||||
// notifyNotificationStateChanged();
|
||||
}
|
||||
@@ -596,7 +576,6 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
setLockscreenPublicMode(isProfilePublic, userId);
|
||||
mUsersWithSeparateWorkChallenge.put(userId, needsSeparateChallenge);
|
||||
}
|
||||
getEntryManager().updateNotifications("NotificationLockscreenUserManager.updatePublicMode");
|
||||
// TODO(b/234738798): Migrate KeyguardNotificationVisibilityProvider to use this listener
|
||||
if (!mLockscreenPublicMode.equals(oldPublicModes)
|
||||
|| !mUsersWithSeparateWorkChallenge.equals(oldWorkChallenges)) {
|
||||
|
||||
@@ -53,8 +53,6 @@ import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule;
|
||||
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry.EditedSuggestionInfo;
|
||||
import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider;
|
||||
@@ -256,7 +254,6 @@ public class NotificationRemoteInputManager implements Dumpable {
|
||||
NotificationLockscreenUserManager lockscreenUserManager,
|
||||
SmartReplyController smartReplyController,
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
|
||||
StatusBarStateController statusBarStateController,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
@@ -279,25 +276,6 @@ public class NotificationRemoteInputManager implements Dumpable {
|
||||
mClickNotifier = clickNotifier;
|
||||
|
||||
dumpManager.registerDumpable(this);
|
||||
|
||||
notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
|
||||
@Override
|
||||
public void onPreEntryUpdated(NotificationEntry entry) {
|
||||
// Mark smart replies as sent whenever a notification is updated - otherwise the
|
||||
// smart replies are never marked as sent.
|
||||
mSmartReplyController.stopSending(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntryRemoved(
|
||||
@Nullable NotificationEntry entry,
|
||||
NotificationVisibility visibility,
|
||||
boolean removedByUser,
|
||||
int reason) {
|
||||
// We're removing the notification, the smart controller can forget about it.
|
||||
mSmartReplyController.stopSending(entry);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Add a listener for various remote input events. Works with NEW pipeline only. */
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.systemui.statusbar.dagger;
|
||||
|
||||
import android.app.IActivityManager;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.RemoteException;
|
||||
import android.service.dreams.IDreamManager;
|
||||
import android.util.Log;
|
||||
@@ -42,14 +41,12 @@ import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.RemoteInputNotificationRebuilder;
|
||||
import com.android.systemui.statusbar.SmartReplyController;
|
||||
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.commandline.CommandRegistry;
|
||||
import com.android.systemui.statusbar.gesture.SwipeStatusBarAwayGestureHandler;
|
||||
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection;
|
||||
@@ -99,11 +96,8 @@ public interface CentralSurfacesDependenciesModule {
|
||||
NotificationLockscreenUserManager lockscreenUserManager,
|
||||
SmartReplyController smartReplyController,
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
RemoteInputNotificationRebuilder rebuilder,
|
||||
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
|
||||
StatusBarStateController statusBarStateController,
|
||||
Handler mainHandler,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
NotificationClickNotifier clickNotifier,
|
||||
ActionClickLogger actionClickLogger,
|
||||
@@ -114,7 +108,6 @@ public interface CentralSurfacesDependenciesModule {
|
||||
lockscreenUserManager,
|
||||
smartReplyController,
|
||||
visibilityProvider,
|
||||
notificationEntryManager,
|
||||
centralSurfacesOptionalLazy,
|
||||
statusBarStateController,
|
||||
remoteInputUriController,
|
||||
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 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;
|
||||
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener;
|
||||
import com.android.systemui.statusbar.notification.dagger.NotificationsModule;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* NotificationEntryManager is responsible for the adding, removing, and updating of
|
||||
* {@link NotificationEntry}s. It also handles tasks such as their inflation and their interaction
|
||||
* with other Notification.*Manager objects.
|
||||
*
|
||||
* We track notification entries through this lifecycle:
|
||||
* 1. Pending
|
||||
* 2. Active
|
||||
* 3. Sorted / filtered (visible)
|
||||
*
|
||||
* Every entry spends some amount of time in the pending state, while it is being inflated. Once
|
||||
* inflated, an entry moves into the active state, where it _could_ potentially be shown to the
|
||||
* user. After an entry makes its way into the active state, we sort and filter the entire set to
|
||||
* repopulate the visible set.
|
||||
*/
|
||||
public class NotificationEntryManager {
|
||||
|
||||
private final NotificationEntryManagerLogger mLogger;
|
||||
|
||||
/** Pending notifications are ones awaiting inflation */
|
||||
@VisibleForTesting
|
||||
protected final HashMap<String, NotificationEntry> mPendingNotifications = new HashMap<>();
|
||||
/**
|
||||
* Active notifications have been inflated / prepared and could become visible, but may get
|
||||
* filtered out if for instance they are not for the current user
|
||||
*/
|
||||
private final ArrayMap<String, NotificationEntry> mActiveNotifications = new ArrayMap<>();
|
||||
/** This is the list of "active notifications for this user in this context" */
|
||||
@VisibleForTesting
|
||||
protected final ArrayList<NotificationEntry> mSortedAndFiltered = new ArrayList<>();
|
||||
private final List<NotifCollectionListener> mNotifCollectionListeners = new ArrayList<>();
|
||||
private final List<NotificationEntryListener> mNotificationEntryListeners = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Injected constructor. See {@link NotificationsModule}.
|
||||
*/
|
||||
public NotificationEntryManager(NotificationEntryManagerLogger logger) {
|
||||
mLogger = logger;
|
||||
}
|
||||
|
||||
/** Adds a {@link NotificationEntryListener}. */
|
||||
public void addNotificationEntryListener(NotificationEntryListener listener) {
|
||||
mNotificationEntryListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a {@link NotificationEntryListener} previously registered via
|
||||
* {@link #addNotificationEntryListener(NotificationEntryListener)}.
|
||||
*/
|
||||
public void removeNotificationEntryListener(NotificationEntryListener listener) {
|
||||
mNotificationEntryListeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the notifications
|
||||
* @param reason why the notifications are updating
|
||||
*/
|
||||
public void updateNotifications(String reason) {
|
||||
mLogger.logUseWhileNewPipelineActive("updateNotifications", reason);
|
||||
}
|
||||
|
||||
/*
|
||||
* -----
|
||||
* Annexed from NotificationData below:
|
||||
* Some of these methods may be redundant but require some reworking to remove. For now
|
||||
* we'll try to keep the behavior the same and can simplify these interfaces in another pass
|
||||
*/
|
||||
|
||||
/** Resorts / filters the current notification set with the current RankingMap */
|
||||
public void reapplyFilterAndSort(String reason) {
|
||||
mLogger.logUseWhileNewPipelineActive("reapplyFilterAndSort", reason);
|
||||
}
|
||||
|
||||
/** dump the current active notification list. Called from CentralSurfaces */
|
||||
public void dump(PrintWriter pw, String indent) {
|
||||
pw.println("NotificationEntryManager (Legacy)");
|
||||
int filteredLen = mSortedAndFiltered.size();
|
||||
pw.print(indent);
|
||||
pw.println("active notifications: " + filteredLen);
|
||||
int active;
|
||||
for (active = 0; active < filteredLen; active++) {
|
||||
NotificationEntry e = mSortedAndFiltered.get(active);
|
||||
dumpEntry(pw, indent, active, e);
|
||||
}
|
||||
synchronized (mActiveNotifications) {
|
||||
int totalLen = mActiveNotifications.size();
|
||||
pw.print(indent);
|
||||
pw.println("inactive notifications: " + (totalLen - active));
|
||||
int inactiveCount = 0;
|
||||
for (int i = 0; i < totalLen; i++) {
|
||||
NotificationEntry entry = mActiveNotifications.valueAt(i);
|
||||
if (!mSortedAndFiltered.contains(entry)) {
|
||||
dumpEntry(pw, indent, inactiveCount, entry);
|
||||
inactiveCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dumpEntry(PrintWriter pw, String indent, int i, NotificationEntry e) {
|
||||
pw.print(indent);
|
||||
pw.println(" [" + i + "] key=" + e.getKey() + " icon=" + e.getIcons().getStatusBarIcon());
|
||||
StatusBarNotification n = e.getSbn();
|
||||
pw.print(indent);
|
||||
pw.println(" pkg=" + n.getPackageName() + " id=" + n.getId() + " importance="
|
||||
+ e.getRanking().getImportance());
|
||||
pw.print(indent);
|
||||
pw.println(" notification=" + n.getNotification());
|
||||
}
|
||||
|
||||
public void addCollectionListener(@NonNull NotifCollectionListener listener) {
|
||||
mNotifCollectionListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeCollectionListener(@NonNull NotifCollectionListener listener) {
|
||||
mNotifCollectionListeners.remove(listener);
|
||||
}
|
||||
|
||||
/*
|
||||
* End annexation
|
||||
* -----
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Provides access to keyguard state and user settings dependent data.
|
||||
*/
|
||||
public interface KeyguardEnvironment {
|
||||
/** true if the device is provisioned (should always be true in practice) */
|
||||
boolean isDeviceProvisioned();
|
||||
/** true if the notification is for the current profiles */
|
||||
boolean isNotificationForCurrentProfiles(StatusBarNotification sbn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used when a notification is removed and it doesn't have a reason that maps to one of the
|
||||
* reasons defined in NotificationListenerService
|
||||
* (e.g. {@link NotificationListenerService#REASON_CANCEL})
|
||||
*/
|
||||
public static final int UNDEFINED_DISMISS_REASON = 0;
|
||||
}
|
||||
@@ -1,124 +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.notification
|
||||
|
||||
import com.android.systemui.log.LogBuffer
|
||||
import com.android.systemui.log.LogLevel
|
||||
import com.android.systemui.log.LogLevel.DEBUG
|
||||
import com.android.systemui.log.LogLevel.INFO
|
||||
import com.android.systemui.log.LogLevel.WARNING
|
||||
import com.android.systemui.log.LogMessage
|
||||
import com.android.systemui.log.dagger.NotificationLog
|
||||
import com.android.systemui.util.Compile
|
||||
import javax.inject.Inject
|
||||
|
||||
/** Logger for [NotificationEntryManager]. */
|
||||
class NotificationEntryManagerLogger @Inject constructor(
|
||||
notifPipelineFlags: NotifPipelineFlags,
|
||||
@NotificationLog private val buffer: LogBuffer
|
||||
) {
|
||||
private val devLoggingEnabled by lazy { notifPipelineFlags.isDevLoggingEnabled() }
|
||||
|
||||
private inline fun devLog(
|
||||
level: LogLevel,
|
||||
initializer: LogMessage.() -> Unit,
|
||||
noinline printer: LogMessage.() -> String
|
||||
) {
|
||||
if (Compile.IS_DEBUG && devLoggingEnabled) buffer.log(TAG, level, initializer, printer)
|
||||
}
|
||||
|
||||
fun logNotifAdded(key: String) {
|
||||
devLog(INFO, {
|
||||
str1 = key
|
||||
}, {
|
||||
"NOTIF ADDED $str1"
|
||||
})
|
||||
}
|
||||
|
||||
fun logNotifUpdated(key: String) {
|
||||
devLog(INFO, {
|
||||
str1 = key
|
||||
}, {
|
||||
"NOTIF UPDATED $str1"
|
||||
})
|
||||
}
|
||||
|
||||
fun logInflationAborted(key: String, status: String, reason: String) {
|
||||
devLog(DEBUG, {
|
||||
str1 = key
|
||||
str2 = status
|
||||
str3 = reason
|
||||
}, {
|
||||
"NOTIF INFLATION ABORTED $str1 notifStatus=$str2 reason=$str3"
|
||||
})
|
||||
}
|
||||
|
||||
fun logNotifInflated(key: String, isNew: Boolean) {
|
||||
devLog(DEBUG, {
|
||||
str1 = key
|
||||
bool1 = isNew
|
||||
}, {
|
||||
"NOTIF INFLATED $str1 isNew=$bool1}"
|
||||
})
|
||||
}
|
||||
|
||||
fun logRemovalIntercepted(key: String) {
|
||||
devLog(INFO, {
|
||||
str1 = key
|
||||
}, {
|
||||
"NOTIF REMOVE INTERCEPTED for $str1"
|
||||
})
|
||||
}
|
||||
|
||||
fun logLifetimeExtended(key: String, extenderName: String, status: String) {
|
||||
devLog(INFO, {
|
||||
str1 = key
|
||||
str2 = extenderName
|
||||
str3 = status
|
||||
}, {
|
||||
"NOTIF LIFETIME EXTENDED $str1 extender=$str2 status=$str3"
|
||||
})
|
||||
}
|
||||
|
||||
fun logNotifRemoved(key: String, removedByUser: Boolean) {
|
||||
devLog(INFO, {
|
||||
str1 = key
|
||||
bool1 = removedByUser
|
||||
}, {
|
||||
"NOTIF REMOVED $str1 removedByUser=$bool1"
|
||||
})
|
||||
}
|
||||
|
||||
fun logFilterAndSort(reason: String) {
|
||||
devLog(INFO, {
|
||||
str1 = reason
|
||||
}, {
|
||||
"FILTER AND SORT reason=$str1"
|
||||
})
|
||||
}
|
||||
|
||||
fun logUseWhileNewPipelineActive(method: String, reason: String) {
|
||||
buffer.log(TAG, WARNING, {
|
||||
str1 = method
|
||||
str2 = reason
|
||||
}, {
|
||||
"While running New Pipeline: $str1(reason=$str2)"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private const val TAG = "NotificationEntryMgr"
|
||||
@@ -20,11 +20,9 @@ import android.app.smartspace.SmartspaceTarget
|
||||
import android.os.Parcelable
|
||||
import com.android.systemui.dagger.qualifiers.Main
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
||||
import com.android.systemui.statusbar.StatusBarState
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||
import com.android.systemui.statusbar.notification.collection.coordinator.dagger.CoordinatorScope
|
||||
@@ -44,14 +42,10 @@ import javax.inject.Inject
|
||||
* In addition, notifications that have recently alerted aren't filtered. Tracking this in a way
|
||||
* that involves the fewest pipeline invalidations requires some unfortunately complex logic.
|
||||
*/
|
||||
// This class is a singleton so that the same instance can be accessed by both the old and new
|
||||
// pipelines
|
||||
@CoordinatorScope
|
||||
class SmartspaceDedupingCoordinator @Inject constructor(
|
||||
private val statusBarStateController: SysuiStatusBarStateController,
|
||||
private val smartspaceController: LockscreenSmartspaceController,
|
||||
private val notificationEntryManager: NotificationEntryManager,
|
||||
private val notificationLockscreenUserManager: NotificationLockscreenUserManager,
|
||||
private val notifPipeline: NotifPipeline,
|
||||
@Main private val executor: DelayableExecutor,
|
||||
private val clock: SystemClock
|
||||
@@ -132,7 +126,6 @@ class SmartspaceDedupingCoordinator @Inject constructor(
|
||||
|
||||
if (changed) {
|
||||
filter.invalidateList("onNewSmartspaceTargets")
|
||||
notificationEntryManager.updateNotifications("Smartspace targets changed")
|
||||
}
|
||||
|
||||
trackedSmartspaceTargets = newMap
|
||||
@@ -169,7 +162,6 @@ class SmartspaceDedupingCoordinator @Inject constructor(
|
||||
target.cancelTimeoutRunnable = null
|
||||
target.shouldFilter = true
|
||||
filter.invalidateList("updateAlertException: ${entry.logKey}")
|
||||
notificationEntryManager.updateNotifications("deduping timeout expired")
|
||||
}, alertExceptionExpires - now)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,11 @@ package com.android.systemui.statusbar.notification.collection.inflation;
|
||||
import android.annotation.NonNull;
|
||||
|
||||
import com.android.systemui.statusbar.notification.InflationException;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder;
|
||||
|
||||
/**
|
||||
* Used by the {@link NotificationEntryManager}. When notifications are added or updated, the binder
|
||||
* Used by the {@link NotifInflater}. When notifications are added or updated, the binder
|
||||
* is asked to (re)inflate and prepare their views. This inflation must occur off the main thread.
|
||||
*/
|
||||
public interface NotificationRowBinder {
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.notification.collection.notifcollection;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
|
||||
@@ -29,9 +28,8 @@ import java.util.Collection;
|
||||
* A notification collection that manages the list of {@link NotificationEntry}s that will be
|
||||
* rendered.
|
||||
*
|
||||
* TODO: (b/145659174) Once we fully switch off {@link NotificationEntryManager} to
|
||||
* {@link NotifPipeline}, we probably won't need this, but having it for now makes it easy to
|
||||
* switch between the two.
|
||||
* TODO: (b/145659174) Once we fully migrate to {@link NotifPipeline}, we probably won't need this,
|
||||
* but having it for now makes it easy to switch between the two.
|
||||
*/
|
||||
public interface CommonNotifCollection {
|
||||
/**
|
||||
|
||||
@@ -36,8 +36,6 @@ import com.android.systemui.shade.NotifPanelEventsModule;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManagerLogger;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifInflaterImpl;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStoreImpl;
|
||||
@@ -106,14 +104,6 @@ public interface NotificationsModule {
|
||||
@Binds
|
||||
StackScrollAlgorithm.BypassController bindBypassController(KeyguardBypassController impl);
|
||||
|
||||
/** Provides an instance of {@link NotificationEntryManager} */
|
||||
@SysUISingleton
|
||||
@Provides
|
||||
static NotificationEntryManager provideNotificationEntryManager(
|
||||
NotificationEntryManagerLogger logger) {
|
||||
return new NotificationEntryManager(logger);
|
||||
}
|
||||
|
||||
/** Provides an instance of {@link NotificationGutsManager} */
|
||||
@SysUISingleton
|
||||
@Provides
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.android.systemui.statusbar.notification.NotificationActivityStarter
|
||||
import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl
|
||||
import com.android.systemui.statusbar.notification.collection.render.NotifStackController
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
|
||||
import java.io.PrintWriter
|
||||
|
||||
/**
|
||||
* The master controller for all notifications-related work
|
||||
@@ -40,9 +39,7 @@ interface NotificationsController {
|
||||
bindRowCallback: NotificationRowBinderImpl.BindRowCallback
|
||||
)
|
||||
|
||||
fun requestNotificationUpdate(reason: String)
|
||||
fun resetUserExpandedStates()
|
||||
fun setNotificationSnoozed(sbn: StatusBarNotification, snoozeOption: SnoozeOption)
|
||||
fun getActiveNotificationsCount(): Int
|
||||
fun dump(pw: PrintWriter, args: Array<String>, dumpTruck: Boolean)
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.systemui.statusbar.notification.init
|
||||
|
||||
import android.service.notification.StatusBarNotification
|
||||
import com.android.systemui.ForegroundServiceNotificationListener
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.people.widget.PeopleSpaceWidgetManager
|
||||
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption
|
||||
@@ -25,7 +26,6 @@ import com.android.systemui.statusbar.NotificationPresenter
|
||||
import com.android.systemui.statusbar.notification.AnimatedImageNotificationManager
|
||||
import com.android.systemui.statusbar.notification.NotificationActivityStarter
|
||||
import com.android.systemui.statusbar.notification.NotificationClicker
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||
@@ -41,7 +41,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain
|
||||
import com.android.systemui.statusbar.phone.CentralSurfaces
|
||||
import com.android.wm.shell.bubbles.Bubbles
|
||||
import dagger.Lazy
|
||||
import java.io.PrintWriter
|
||||
import java.util.Optional
|
||||
import javax.inject.Inject
|
||||
|
||||
@@ -56,7 +55,6 @@ import javax.inject.Inject
|
||||
class NotificationsControllerImpl @Inject constructor(
|
||||
private val centralSurfaces: Lazy<CentralSurfaces>,
|
||||
private val notificationListener: NotificationListener,
|
||||
private val entryManager: NotificationEntryManager,
|
||||
private val commonNotifCollection: Lazy<CommonNotifCollection>,
|
||||
private val notifPipeline: Lazy<NotifPipeline>,
|
||||
private val notifLiveDataStore: NotifLiveDataStore,
|
||||
@@ -69,6 +67,7 @@ class NotificationsControllerImpl @Inject constructor(
|
||||
private val animatedImageNotificationManager: AnimatedImageNotificationManager,
|
||||
private val peopleSpaceWidgetManager: PeopleSpaceWidgetManager,
|
||||
private val bubblesOptional: Optional<Bubbles>,
|
||||
private val fgsNotifListener: ForegroundServiceNotificationListener,
|
||||
) : NotificationsController {
|
||||
|
||||
override fun initialize(
|
||||
@@ -107,24 +106,11 @@ class NotificationsControllerImpl @Inject constructor(
|
||||
targetSdkResolver.initialize(notifPipeline.get())
|
||||
|
||||
peopleSpaceWidgetManager.attach(notificationListener)
|
||||
}
|
||||
|
||||
override fun dump(
|
||||
pw: PrintWriter,
|
||||
args: Array<String>,
|
||||
dumpTruck: Boolean
|
||||
) {
|
||||
if (dumpTruck) {
|
||||
entryManager.dump(pw, " ")
|
||||
}
|
||||
fgsNotifListener.init()
|
||||
}
|
||||
|
||||
// TODO: Convert all functions below this line into listeners instead of public methods
|
||||
|
||||
override fun requestNotificationUpdate(reason: String) {
|
||||
entryManager.updateNotifications(reason)
|
||||
}
|
||||
|
||||
override fun resetUserExpandedStates() {
|
||||
// TODO: this is a view thing that should be done through the views, but that means doing it
|
||||
// both when this event is fired and any time a row is attached.
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.android.systemui.statusbar.notification.NotificationActivityStarter
|
||||
import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl
|
||||
import com.android.systemui.statusbar.notification.collection.render.NotifStackController
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
|
||||
import java.io.PrintWriter
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
@@ -46,9 +45,6 @@ class NotificationsControllerStub @Inject constructor(
|
||||
notificationListener.registerAsSystemService()
|
||||
}
|
||||
|
||||
override fun requestNotificationUpdate(reason: String) {
|
||||
}
|
||||
|
||||
override fun resetUserExpandedStates() {
|
||||
}
|
||||
|
||||
@@ -58,14 +54,4 @@ class NotificationsControllerStub @Inject constructor(
|
||||
override fun getActiveNotificationsCount(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun dump(
|
||||
pw: PrintWriter,
|
||||
args: Array<String>,
|
||||
dumpTruck: Boolean
|
||||
) {
|
||||
pw.println()
|
||||
pw.println("Notification handling disabled")
|
||||
pw.println()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,6 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.LaunchAnimationParameters;
|
||||
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
@@ -155,7 +154,6 @@ public class NotificationStackScrollLayoutController {
|
||||
private final ScrimController mScrimController;
|
||||
private final NotifPipeline mNotifPipeline;
|
||||
private final NotifCollection mNotifCollection;
|
||||
private final NotificationEntryManager mNotificationEntryManager;
|
||||
private final UiEventLogger mUiEventLogger;
|
||||
private final NotificationRemoteInputManager mRemoteInputManager;
|
||||
private final ShadeController mShadeController;
|
||||
@@ -307,7 +305,6 @@ public class NotificationStackScrollLayoutController {
|
||||
mView.updateSensitiveness(mStatusBarStateController.goingToFullShade(),
|
||||
mLockscreenUserManager.isAnyProfilePublicMode());
|
||||
mView.onStatePostChange(mStatusBarStateController.fromShadeLocked());
|
||||
mNotificationEntryManager.updateNotifications("CentralSurfaces state changed");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -634,7 +631,6 @@ public class NotificationStackScrollLayoutController {
|
||||
@SilentHeader SectionHeaderController silentHeaderController,
|
||||
NotifPipeline notifPipeline,
|
||||
NotifCollection notifCollection,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
LockscreenShadeTransitionController lockscreenShadeTransitionController,
|
||||
ShadeTransitionController shadeTransitionController,
|
||||
UiEventLogger uiEventLogger,
|
||||
@@ -676,7 +672,6 @@ public class NotificationStackScrollLayoutController {
|
||||
mSilentHeaderController = silentHeaderController;
|
||||
mNotifPipeline = notifPipeline;
|
||||
mNotifCollection = notifCollection;
|
||||
mNotificationEntryManager = notificationEntryManager;
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mRemoteInputManager = remoteInputManager;
|
||||
mShadeController = shadeController;
|
||||
|
||||
@@ -225,8 +225,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn
|
||||
|
||||
boolean isShadeDisabled();
|
||||
|
||||
void requestNotificationUpdate(String reason);
|
||||
|
||||
void requestFaceAuth(boolean userInitiatedRequest);
|
||||
|
||||
@Override
|
||||
|
||||
@@ -203,7 +203,6 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.core.StatusBarInitializer;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorControllerProvider;
|
||||
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||
import com.android.systemui.statusbar.notification.init.NotificationsController;
|
||||
@@ -508,7 +507,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
|
||||
private boolean mExpandedVisible;
|
||||
|
||||
protected final NotificationEntryManager mEntryManager;
|
||||
private final NotificationGutsManager mGutsManager;
|
||||
private final NotificationLogger mNotificationLogger;
|
||||
private final PanelExpansionStateManager mPanelExpansionStateManager;
|
||||
@@ -681,7 +679,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
FalsingManager falsingManager,
|
||||
FalsingCollector falsingCollector,
|
||||
BroadcastDispatcher broadcastDispatcher,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
NotificationGutsManager notificationGutsManager,
|
||||
NotificationLogger notificationLogger,
|
||||
NotificationInterruptStateProvider notificationInterruptStateProvider,
|
||||
@@ -768,7 +765,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
mFalsingCollector = falsingCollector;
|
||||
mFalsingManager = falsingManager;
|
||||
mBroadcastDispatcher = broadcastDispatcher;
|
||||
mEntryManager = notificationEntryManager;
|
||||
mGutsManager = notificationGutsManager;
|
||||
mNotificationLogger = notificationLogger;
|
||||
mNotificationInterruptStateProvider = notificationInterruptStateProvider;
|
||||
@@ -839,11 +835,8 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
|
||||
mPanelExpansionStateManager.addExpansionListener(this::onPanelExpansionChanged);
|
||||
|
||||
mBubbleExpandListener =
|
||||
(isExpanding, key) -> mContext.getMainExecutor().execute(() -> {
|
||||
mNotificationsController.requestNotificationUpdate("onBubbleExpandChanged");
|
||||
updateScrimController();
|
||||
});
|
||||
mBubbleExpandListener = (isExpanding, key) ->
|
||||
mContext.getMainExecutor().execute(this::updateScrimController);
|
||||
|
||||
mActivityIntentHelper = new ActivityIntentHelper(mContext);
|
||||
mActivityLaunchAnimator = activityLaunchAnimator;
|
||||
@@ -1615,15 +1608,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
return (mDisabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a notification update
|
||||
* @param reason why we're requesting a notification update
|
||||
*/
|
||||
@Override
|
||||
public void requestNotificationUpdate(String reason) {
|
||||
mNotificationsController.requestNotificationUpdate(reason);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks {@link KeyguardUpdateMonitor} to run face auth.
|
||||
*/
|
||||
@@ -2328,8 +2312,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
mStatusBarKeyguardViewManager.dump(pw);
|
||||
}
|
||||
|
||||
mNotificationsController.dump(pw, args, DUMPTRUCK);
|
||||
|
||||
if (DEBUG_GESTURES) {
|
||||
pw.print(" status bar gestures: ");
|
||||
mGestureRec.dump(pw, args);
|
||||
@@ -4233,14 +4215,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
maybeEscalateHeadsUp();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: (b/145659174) remove when moving to NewNotifPipeline. Replaced by
|
||||
// KeyguardCoordinator
|
||||
@Override
|
||||
public void onStrongAuthStateChanged(int userId) {
|
||||
super.onStrongAuthStateChanged(userId);
|
||||
mNotificationsController.requestNotificationUpdate("onStrongAuthStateChanged");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4429,7 +4403,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
|
||||
updateQsExpansionEnabled();
|
||||
mKeyguardViewMediator.setDozing(mDozing);
|
||||
|
||||
mNotificationsController.requestNotificationUpdate("onDozingChanged");
|
||||
updateDozingState();
|
||||
mDozeServiceHost.updateDozing();
|
||||
updateScrimController();
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 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.statusbar.phone.CentralSurfaces.DEBUG;
|
||||
import static com.android.systemui.statusbar.phone.CentralSurfaces.MULTIUSER_DEBUG;
|
||||
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager.KeyguardEnvironment;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@SysUISingleton
|
||||
public class KeyguardEnvironmentImpl implements KeyguardEnvironment {
|
||||
|
||||
private static final String TAG = "KeyguardEnvironmentImpl";
|
||||
|
||||
private final NotificationLockscreenUserManager mLockscreenUserManager;
|
||||
private final DeviceProvisionedController mDeviceProvisionedController;
|
||||
|
||||
@Inject
|
||||
public KeyguardEnvironmentImpl(
|
||||
NotificationLockscreenUserManager notificationLockscreenUserManager,
|
||||
DeviceProvisionedController deviceProvisionedController) {
|
||||
mLockscreenUserManager = notificationLockscreenUserManager;
|
||||
mDeviceProvisionedController = deviceProvisionedController;
|
||||
}
|
||||
|
||||
@Override // NotificationEntryManager.KeyguardEnvironment
|
||||
public boolean isDeviceProvisioned() {
|
||||
return mDeviceProvisionedController.isDeviceProvisioned();
|
||||
}
|
||||
|
||||
@Override // NotificationEntryManager.KeyguardEnvironment
|
||||
public boolean isNotificationForCurrentProfiles(StatusBarNotification n) {
|
||||
final int notificationUserId = n.getUserId();
|
||||
if (DEBUG && MULTIUSER_DEBUG) {
|
||||
Log.v(TAG, String.format("%s: current userid: %d, notification userid: %d", n,
|
||||
mLockscreenUserManager.getCurrentUserId(), notificationUserId));
|
||||
}
|
||||
return mLockscreenUserManager.isCurrentProfile(notificationUserId);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,6 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener
|
||||
|
||||
@Override
|
||||
public void onHeadsUpStateChanged(NotificationEntry entry, boolean isHeadsUp) {
|
||||
mNotificationsController.requestNotificationUpdate("onHeadsUpStateChanged");
|
||||
if (mStatusBarStateController.isDozing() && isHeadsUp) {
|
||||
entry.setPulseSuppressed(false);
|
||||
mDozeServiceHost.fireNotificationPulse(entry);
|
||||
|
||||
@@ -33,8 +33,6 @@ import android.view.accessibility.AccessibilityManager;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.ForegroundServiceNotificationListener;
|
||||
import com.android.systemui.InitController;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
@@ -184,10 +182,6 @@ class StatusBarNotificationPresenter implements NotificationPresenter,
|
||||
mMediaManager.setUpWithPresenter(this);
|
||||
mGutsManager.setUpWithPresenter(
|
||||
this, mNotifListContainer, mOnSettingsClickListener);
|
||||
// ForegroundServiceNotificationListener adds its listener in its constructor
|
||||
// but we need to request it here in order for it to be instantiated.
|
||||
// TODO: figure out how to do this correctly once Dependency.get() is gone.
|
||||
Dependency.get(ForegroundServiceNotificationListener.class);
|
||||
|
||||
onUserSwitched(mLockscreenUserManager.getCurrentUserId());
|
||||
});
|
||||
|
||||
@@ -56,13 +56,11 @@ import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.provider.VisualStabilityProvider;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
|
||||
import com.android.systemui.statusbar.phone.DozeServiceHost;
|
||||
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
|
||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
|
||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||
import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
@@ -151,10 +149,6 @@ public abstract class TvSystemUIModule {
|
||||
@Binds
|
||||
abstract DockManager bindDockManager(DockManagerImpl dockManager);
|
||||
|
||||
@Binds
|
||||
abstract NotificationEntryManager.KeyguardEnvironment bindKeyguardEnvironment(
|
||||
KeyguardEnvironmentImpl keyguardEnvironment);
|
||||
|
||||
@Binds
|
||||
abstract ShadeController provideShadeController(ShadeControllerImpl shadeController);
|
||||
|
||||
|
||||
@@ -57,11 +57,9 @@ import com.android.systemui.shared.system.QuickStepContract;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.notification.NotificationChannelHelper;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.coordinator.BubbleCoordinator;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener;
|
||||
@@ -460,11 +458,6 @@ public class BubblesManager {
|
||||
mBubbles.onNotificationChannelModified(pkg, user, channel, modificationType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the DismissedByUserStats used by {@link NotificationEntryManager}.
|
||||
* Will not be necessary when using the new notification pipeline's {@link NotifCollection}.
|
||||
* Instead, this is taken care of by {@link BubbleCoordinator}.
|
||||
*/
|
||||
private DismissedByUserStats getDismissedByUserStats(
|
||||
NotificationEntry entry,
|
||||
boolean isVisible) {
|
||||
|
||||
@@ -44,12 +44,10 @@ import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.internal.messages.nano.SystemMessageProto;
|
||||
import com.android.systemui.appops.AppOpsController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
|
||||
import com.android.systemui.util.time.FakeSystemClock;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -64,9 +62,7 @@ import org.mockito.MockitoAnnotations;
|
||||
public class ForegroundServiceControllerTest extends SysuiTestCase {
|
||||
private ForegroundServiceController mFsc;
|
||||
private ForegroundServiceNotificationListener mListener;
|
||||
private NotificationEntryListener mEntryListener;
|
||||
private final FakeSystemClock mClock = new FakeSystemClock();
|
||||
@Mock private NotificationEntryManager mEntryManager;
|
||||
private NotifCollectionListener mCollectionListener;
|
||||
@Mock private AppOpsController mAppOpsController;
|
||||
@Mock private Handler mMainHandler;
|
||||
@Mock private NotifPipeline mNotifPipeline;
|
||||
@@ -79,12 +75,13 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mFsc = new ForegroundServiceController(mAppOpsController, mMainHandler);
|
||||
mListener = new ForegroundServiceNotificationListener(
|
||||
mContext, mFsc, mEntryManager, mNotifPipeline, mClock);
|
||||
ArgumentCaptor<NotificationEntryListener> entryListenerCaptor =
|
||||
ArgumentCaptor.forClass(NotificationEntryListener.class);
|
||||
verify(mEntryManager).addNotificationEntryListener(
|
||||
mContext, mFsc, mNotifPipeline);
|
||||
mListener.init();
|
||||
ArgumentCaptor<NotifCollectionListener> entryListenerCaptor =
|
||||
ArgumentCaptor.forClass(NotifCollectionListener.class);
|
||||
verify(mNotifPipeline).addCollectionListener(
|
||||
entryListenerCaptor.capture());
|
||||
mEntryListener = entryListenerCaptor.getValue();
|
||||
mCollectionListener = entryListenerCaptor.getValue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -449,7 +446,7 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
|
||||
|
||||
private NotificationEntry addFgEntry() {
|
||||
NotificationEntry entry = createFgEntry();
|
||||
mEntryListener.onPendingEntryAdded(entry);
|
||||
mCollectionListener.onEntryAdded(entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -461,12 +458,10 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
|
||||
}
|
||||
|
||||
private void entryRemoved(StatusBarNotification notification) {
|
||||
mEntryListener.onEntryRemoved(
|
||||
mCollectionListener.onEntryRemoved(
|
||||
new NotificationEntryBuilder()
|
||||
.setSbn(notification)
|
||||
.build(),
|
||||
null,
|
||||
false,
|
||||
REASON_APP_CANCEL);
|
||||
}
|
||||
|
||||
@@ -475,7 +470,7 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
|
||||
.setSbn(notification)
|
||||
.setImportance(importance)
|
||||
.build();
|
||||
mEntryListener.onPendingEntryAdded(entry);
|
||||
mCollectionListener.onEntryAdded(entry);
|
||||
}
|
||||
|
||||
private void entryUpdated(StatusBarNotification notification, int importance) {
|
||||
@@ -483,7 +478,7 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
|
||||
.setSbn(notification)
|
||||
.setImportance(importance)
|
||||
.build();
|
||||
mEntryListener.onPreEntryUpdated(entry);
|
||||
mCollectionListener.onEntryUpdated(entry);
|
||||
}
|
||||
|
||||
@UserIdInt private static final int USERID_ONE = 10; // UserManagerService.MIN_USER_ID;
|
||||
|
||||
@@ -124,7 +124,6 @@ import com.android.systemui.statusbar.VibratorHelper;
|
||||
import com.android.systemui.statusbar.events.PrivacyDotViewController;
|
||||
import com.android.systemui.statusbar.notification.ConversationNotificationManager;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||
import com.android.systemui.statusbar.notification.row.ExpandableView;
|
||||
import com.android.systemui.statusbar.notification.row.ExpandableView.OnHeightChangedListener;
|
||||
@@ -229,8 +228,6 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private DynamicPrivacyController mDynamicPrivacyController;
|
||||
@Mock
|
||||
private NotificationEntryManager mNotificationEntryManager;
|
||||
@Mock
|
||||
private StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
|
||||
@Mock
|
||||
private KeyguardStateController mKeyguardStateController;
|
||||
@@ -517,7 +514,6 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
mFeatureFlags,
|
||||
coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController,
|
||||
mFalsingManager, new FalsingCollectorFake(),
|
||||
mNotificationEntryManager,
|
||||
mKeyguardStateController,
|
||||
mStatusBarStateController,
|
||||
mStatusBarWindowStateController,
|
||||
|
||||
@@ -28,12 +28,9 @@ import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.shade.ShadeController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
|
||||
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
|
||||
import com.android.systemui.statusbar.notification.row.NotificationGutsManager.OnSettingsClickListener;
|
||||
import com.android.systemui.statusbar.notification.row.NotificationInfo.CheckSaveListener;
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -54,10 +51,8 @@ import org.mockito.MockitoAnnotations;
|
||||
public class NonPhoneDependencyTest extends SysuiTestCase {
|
||||
@Mock private NotificationPresenter mPresenter;
|
||||
@Mock private NotificationListContainer mListContainer;
|
||||
@Mock private NotificationEntryListener mEntryListener;
|
||||
@Mock private RemoteInputController.Delegate mDelegate;
|
||||
@Mock private NotificationRemoteInputManager.Callback mRemoteInputManagerCallback;
|
||||
@Mock private CheckSaveListener mCheckSaveListener;
|
||||
@Mock private OnSettingsClickListener mOnSettingsClickListener;
|
||||
|
||||
@Before
|
||||
@@ -72,7 +67,6 @@ public class NonPhoneDependencyTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void testNotificationManagementCodeHasNoDependencyOnStatusBarWindowManager() {
|
||||
mDependency.injectMockDependency(ShadeController.class);
|
||||
NotificationEntryManager entryManager = Dependency.get(NotificationEntryManager.class);
|
||||
NotificationGutsManager gutsManager = Dependency.get(NotificationGutsManager.class);
|
||||
NotificationLogger notificationLogger = Dependency.get(NotificationLogger.class);
|
||||
NotificationMediaManager mediaManager = Dependency.get(NotificationMediaManager.class);
|
||||
@@ -80,7 +74,6 @@ public class NonPhoneDependencyTest extends SysuiTestCase {
|
||||
Dependency.get(NotificationRemoteInputManager.class);
|
||||
NotificationLockscreenUserManager lockscreenUserManager =
|
||||
Dependency.get(NotificationLockscreenUserManager.class);
|
||||
entryManager.addNotificationEntryListener(mEntryListener);
|
||||
gutsManager.setUpWithPresenter(mPresenter, mListContainer,
|
||||
mOnSettingsClickListener);
|
||||
notificationLogger.setUpWithContainer(mListContainer);
|
||||
|
||||
@@ -21,7 +21,6 @@ import static android.content.Intent.ACTION_USER_SWITCHED;
|
||||
import static junit.framework.Assert.assertFalse;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.clearInvocations;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
@@ -54,7 +53,6 @@ import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager.NotificationStateChangedListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection;
|
||||
@@ -84,8 +82,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private NotificationVisibilityProvider mVisibilityProvider;
|
||||
@Mock
|
||||
private NotificationEntryManager mEntryManager;
|
||||
@Mock
|
||||
private CommonNotifCollection mNotifCollection;
|
||||
@Mock
|
||||
private DevicePolicyManager mDevicePolicyManager;
|
||||
@@ -114,7 +110,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mDependency.injectTestDependency(NotificationEntryManager.class, mEntryManager);
|
||||
|
||||
int currentUserId = ActivityManager.getCurrentUser();
|
||||
mSettings = new FakeSettings();
|
||||
@@ -148,12 +143,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
|
||||
mLockscreenUserManager.setUpWithPresenter(mPresenter);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLockScreenShowNotificationsChangeUpdatesNotifications() {
|
||||
mLockscreenUserManager.getLockscreenSettingsObserverForTest().onChange(false);
|
||||
verify(mEntryManager, times(1)).updateNotifications(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLockScreenShowNotificationsFalse() {
|
||||
mSettings.putInt(Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0);
|
||||
@@ -296,13 +285,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
|
||||
assertTrue(mLockscreenUserManager.needsRedaction(mSecondaryUserNotif));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSettingsObserverUpdatesNotifications() {
|
||||
when(mDeviceProvisionedController.isDeviceProvisioned()).thenReturn(true);
|
||||
mLockscreenUserManager.getSettingsObserverForTest().onChange(false);
|
||||
verify(mEntryManager, times(1)).updateNotifications(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testActionUserSwitchedCallsOnUserSwitched() {
|
||||
Intent intent = new Intent()
|
||||
|
||||
@@ -23,8 +23,6 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
import android.os.UserHandle;
|
||||
import android.testing.AndroidTestingRunner;
|
||||
@@ -36,7 +34,6 @@ import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
|
||||
import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider;
|
||||
@@ -70,7 +67,6 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase {
|
||||
@Mock private StatusBarStateController mStateController;
|
||||
@Mock private RemoteInputUriController mRemoteInputUriController;
|
||||
@Mock private NotificationClickNotifier mClickNotifier;
|
||||
@Mock private NotificationEntryManager mEntryManager;
|
||||
@Mock private NotificationLockscreenUserManager mLockscreenUserManager;
|
||||
|
||||
private TestableNotificationRemoteInputManager mRemoteInputManager;
|
||||
@@ -85,11 +81,8 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase {
|
||||
mLockscreenUserManager,
|
||||
mSmartReplyController,
|
||||
mVisibilityProvider,
|
||||
mEntryManager,
|
||||
mock(RemoteInputNotificationRebuilder.class),
|
||||
() -> Optional.of(mock(CentralSurfaces.class)),
|
||||
mStateController,
|
||||
Handler.createAsync(Looper.myLooper()),
|
||||
mRemoteInputUriController,
|
||||
mClickNotifier,
|
||||
mock(ActionClickLogger.class),
|
||||
@@ -145,11 +138,8 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase {
|
||||
NotificationLockscreenUserManager lockscreenUserManager,
|
||||
SmartReplyController smartReplyController,
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
RemoteInputNotificationRebuilder rebuilder,
|
||||
Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
|
||||
StatusBarStateController statusBarStateController,
|
||||
Handler mainHandler,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
NotificationClickNotifier clickNotifier,
|
||||
ActionClickLogger actionClickLogger,
|
||||
@@ -160,7 +150,6 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase {
|
||||
lockscreenUserManager,
|
||||
smartReplyController,
|
||||
visibilityProvider,
|
||||
notificationEntryManager,
|
||||
centralSurfacesOptionalLazy,
|
||||
statusBarStateController,
|
||||
remoteInputUriController,
|
||||
|
||||
@@ -23,11 +23,9 @@ import androidx.test.filters.SmallTest
|
||||
import com.android.systemui.SysuiTestCase
|
||||
import com.android.systemui.plugins.BcSmartspaceDataPlugin.SmartspaceTargetListener
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
||||
import com.android.systemui.statusbar.StatusBarState
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
|
||||
@@ -46,7 +44,6 @@ import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.anyString
|
||||
import org.mockito.Mockito.clearInvocations
|
||||
import org.mockito.Mockito.never
|
||||
import org.mockito.Mockito.verify
|
||||
@@ -61,10 +58,6 @@ class SmartspaceDedupingCoordinatorTest : SysuiTestCase() {
|
||||
@Mock
|
||||
private lateinit var smartspaceController: LockscreenSmartspaceController
|
||||
@Mock
|
||||
private lateinit var notificationEntryManager: NotificationEntryManager
|
||||
@Mock
|
||||
private lateinit var notificationLockscreenUserManager: NotificationLockscreenUserManager
|
||||
@Mock
|
||||
private lateinit var notifPipeline: NotifPipeline
|
||||
@Mock
|
||||
private lateinit var pluggableListener: Pluggable.PluggableListener<NotifFilter>
|
||||
@@ -99,12 +92,10 @@ class SmartspaceDedupingCoordinatorTest : SysuiTestCase() {
|
||||
deduper = SmartspaceDedupingCoordinator(
|
||||
statusBarStateController,
|
||||
smartspaceController,
|
||||
notificationEntryManager,
|
||||
notificationLockscreenUserManager,
|
||||
notifPipeline,
|
||||
executor,
|
||||
clock
|
||||
)
|
||||
)
|
||||
|
||||
// Attach the deduper and capture the listeners/filters that it registers
|
||||
deduper.attach(notifPipeline)
|
||||
@@ -352,7 +343,6 @@ class SmartspaceDedupingCoordinatorTest : SysuiTestCase() {
|
||||
// THEN the new pipeline is invalidated (but the old one isn't because it's not
|
||||
// necessary) because the notif should no longer be filtered out
|
||||
verify(pluggableListener).onPluggableInvalidated(eq(filter), any())
|
||||
verify(notificationEntryManager, never()).updateNotifications(anyString())
|
||||
assertFalse(filter.shouldFilterOut(entry2HasNotRecentlyAlerted, now))
|
||||
}
|
||||
|
||||
@@ -390,7 +380,6 @@ class SmartspaceDedupingCoordinatorTest : SysuiTestCase() {
|
||||
|
||||
private fun verifyPipelinesInvalidated() {
|
||||
verify(pluggableListener).onPluggableInvalidated(eq(filter), any())
|
||||
verify(notificationEntryManager).updateNotifications(anyString())
|
||||
}
|
||||
|
||||
private fun assertExecutorIsClear() {
|
||||
@@ -399,12 +388,10 @@ class SmartspaceDedupingCoordinatorTest : SysuiTestCase() {
|
||||
|
||||
private fun verifyPipelinesNotInvalidated() {
|
||||
verify(pluggableListener, never()).onPluggableInvalidated(eq(filter), any())
|
||||
verify(notificationEntryManager, never()).updateNotifications(anyString())
|
||||
}
|
||||
|
||||
private fun clearPipelineInvocations() {
|
||||
clearInvocations(pluggableListener)
|
||||
clearInvocations(notificationEntryManager)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
||||
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveData;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
@@ -85,11 +83,9 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
@Mock private NotificationLogger.ExpansionStateLogger mExpansionStateLogger;
|
||||
|
||||
// Dependency mocks:
|
||||
@Mock private NotifPipelineFlags mNotifPipelineFlags;
|
||||
@Mock private NotifLiveDataStore mNotifLiveDataStore;
|
||||
@Mock private NotifLiveData<List<NotificationEntry>> mActiveNotifEntries;
|
||||
@Mock private NotificationVisibilityProvider mVisibilityProvider;
|
||||
@Mock private NotificationEntryManager mEntryManager;
|
||||
@Mock private NotifPipeline mNotifPipeline;
|
||||
@Mock private NotificationListener mListener;
|
||||
|
||||
@@ -118,17 +114,14 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
mLogger = new TestableNotificationLogger(
|
||||
mListener,
|
||||
mUiBgExecutor,
|
||||
mNotifPipelineFlags,
|
||||
mNotifLiveDataStore,
|
||||
mVisibilityProvider,
|
||||
mEntryManager,
|
||||
mNotifPipeline,
|
||||
mock(StatusBarStateControllerImpl.class),
|
||||
mBarService,
|
||||
mExpansionStateLogger
|
||||
);
|
||||
mLogger.setUpWithContainer(mListContainer);
|
||||
verify(mEntryManager, never()).addNotificationEntryListener(any());
|
||||
verify(mNotifPipeline).addCollectionListener(any());
|
||||
}
|
||||
|
||||
@@ -266,10 +259,8 @@ public class NotificationLoggerTest extends SysuiTestCase {
|
||||
|
||||
TestableNotificationLogger(NotificationListener notificationListener,
|
||||
Executor uiBgExecutor,
|
||||
NotifPipelineFlags notifPipelineFlags,
|
||||
NotifLiveDataStore notifLiveDataStore,
|
||||
NotificationVisibilityProvider visibilityProvider,
|
||||
NotificationEntryManager entryManager,
|
||||
NotifPipeline notifPipeline,
|
||||
StatusBarStateControllerImpl statusBarStateController,
|
||||
IStatusBarService barService,
|
||||
|
||||
@@ -57,7 +57,6 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
|
||||
|
||||
@@ -83,8 +82,6 @@ public class FeedbackInfoTest extends SysuiTestCase {
|
||||
mock(AssistantFeedbackController.class);
|
||||
private StatusBarNotification mSbn;
|
||||
|
||||
@Mock
|
||||
private NotificationEntryManager mNotificationEntryManager;
|
||||
@Mock
|
||||
private IStatusBarService mStatusBarService;
|
||||
@Mock
|
||||
@@ -94,7 +91,6 @@ public class FeedbackInfoTest extends SysuiTestCase {
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
mDependency.injectTestDependency(NotificationEntryManager.class, mNotificationEntryManager);
|
||||
mDependency.injectTestDependency(IStatusBarService.class, mStatusBarService);
|
||||
mDependency.injectTestDependency(NotificationGutsManager.class, mNotificationGutsManager);
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||
import com.android.systemui.statusbar.RemoteInputController;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager;
|
||||
@@ -119,7 +118,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
|
||||
@Mock private SectionHeaderController mSilentHeaderController;
|
||||
@Mock private NotifPipeline mNotifPipeline;
|
||||
@Mock private NotifCollection mNotifCollection;
|
||||
@Mock private NotificationEntryManager mEntryManager;
|
||||
@Mock private UiEventLogger mUiEventLogger;
|
||||
@Mock private LockscreenShadeTransitionController mLockscreenShadeTransitionController;
|
||||
@Mock private NotificationRemoteInputManager mRemoteInputManager;
|
||||
@@ -168,7 +166,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
|
||||
mSilentHeaderController,
|
||||
mNotifPipeline,
|
||||
mNotifCollection,
|
||||
mEntryManager,
|
||||
mLockscreenShadeTransitionController,
|
||||
mShadeTransitionController,
|
||||
mUiEventLogger,
|
||||
|
||||
@@ -127,7 +127,6 @@ import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
@@ -223,7 +222,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
@Mock private NotificationShadeWindowView mNotificationShadeWindowView;
|
||||
@Mock private BroadcastDispatcher mBroadcastDispatcher;
|
||||
@Mock private AssistManager mAssistManager;
|
||||
@Mock private NotificationEntryManager mNotificationEntryManager;
|
||||
@Mock private NotificationGutsManager mNotificationGutsManager;
|
||||
@Mock private NotificationMediaManager mNotificationMediaManager;
|
||||
@Mock private NavigationBarController mNavigationBarController;
|
||||
@@ -397,7 +395,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
|
||||
new FalsingManagerFake(),
|
||||
new FalsingCollectorFake(),
|
||||
mBroadcastDispatcher,
|
||||
mNotificationEntryManager,
|
||||
mNotificationGutsManager,
|
||||
notificationLogger,
|
||||
mNotificationInterruptStateProvider,
|
||||
|
||||
@@ -66,7 +66,6 @@ import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.NotificationPresenter;
|
||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorControllerProvider;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
@@ -102,8 +101,6 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private AssistManager mAssistManager;
|
||||
@Mock
|
||||
private NotificationEntryManager mEntryManager;
|
||||
@Mock
|
||||
private ActivityStarter mActivityStarter;
|
||||
@Mock
|
||||
private NotificationClickNotifier mClickNotifier;
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.android.systemui.statusbar.ActionClickLogger;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager;
|
||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
@@ -55,7 +54,6 @@ import org.mockito.MockitoAnnotations;
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@TestableLooper.RunWithLooper
|
||||
public class StatusBarRemoteInputCallbackTest extends SysuiTestCase {
|
||||
@Mock private NotificationEntryManager mEntryManager;
|
||||
@Mock private DeviceProvisionedController mDeviceProvisionedController;
|
||||
@Mock private com.android.systemui.shade.ShadeController mShadeController;
|
||||
@Mock private NotificationLockscreenUserManager mNotificationLockscreenUserManager;
|
||||
@@ -71,7 +69,6 @@ public class StatusBarRemoteInputCallbackTest extends SysuiTestCase {
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mDependency.injectTestDependency(NotificationEntryManager.class, mEntryManager);
|
||||
mDependency.injectTestDependency(DeviceProvisionedController.class,
|
||||
mDeviceProvisionedController);
|
||||
mDependency.injectTestDependency(ShadeController.class, mShadeController);
|
||||
|
||||
Reference in New Issue
Block a user