Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8952d59 authored by Steve Elliott's avatar Steve Elliott Committed by Android (Google) Code Review
Browse files

Merge "Remove NotifEntryManager"

parents 998c3bc3 d4f52ca2
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -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);
+7 −33
Original line number Diff line number Diff line
@@ -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;

        // 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());
        mNotifPipeline = notifPipeline;
    }
        });

        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());
+0 −6
Original line number Diff line number Diff line
@@ -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);

+0 −5
Original line number Diff line number Diff line
@@ -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);
+0 −21
Original line number Diff line number Diff line
@@ -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)) {
Loading