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

Commit 309cc9de authored by Steve Elliott's avatar Steve Elliott
Browse files

Eliminate StatusBarNotifActivityStarter.Builder

This CL adjusts the Dagger scoping for StatusBarNotifActivityStarter to
StatusBarScope, so that we don't need to use a Builder that was
previously scoped as SysUISingleton.

Test: mp droid, atest
Bug: 219939676
Change-Id: Iff2a298c19f89e234db2719fb0bc64e2b82c831b
parent e15d10f3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar;

import android.view.View;

import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
import com.android.systemui.statusbar.notification.row.ActivatableNotificationViewController;
import com.android.systemui.statusbar.notification.row.dagger.NotificationRowScope;
import com.android.systemui.statusbar.notification.stack.AmbientState;
@@ -25,7 +26,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll
import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.statusbar.phone.StatusBarNotificationPresenter;

import javax.inject.Inject;

@@ -114,8 +114,8 @@ public class NotificationShelfController {
        return mView.getIntrinsicHeight();
    }

    public void setOnActivatedListener(StatusBarNotificationPresenter presenter) {
        mView.setOnActivatedListener(presenter);
    public void setOnActivatedListener(ActivatableNotificationView.OnActivatedListener listener) {
        mView.setOnActivatedListener(listener);
    }

    public void setOnClickListener(View.OnClickListener onClickListener) {
+4 −1
Original line number Diff line number Diff line
@@ -8,12 +8,15 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone
import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent
import com.android.systemui.statusbar.policy.HeadsUpUtil
import javax.inject.Inject
import kotlin.math.ceil
import kotlin.math.max

/** A provider of [NotificationLaunchAnimatorController]. */
class NotificationLaunchAnimatorControllerProvider(
@StatusBarComponent.StatusBarScope
class NotificationLaunchAnimatorControllerProvider @Inject constructor(
    private val notificationShadeWindowViewController: NotificationShadeWindowViewController,
    private val notificationListContainer: NotificationListContainer,
    private val headsUpManager: HeadsUpManagerPhone,
+4 −2
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ import com.android.systemui.wmshell.BubblesManager;
import java.util.Optional;
import java.util.concurrent.Executor;

import javax.inject.Provider;

import dagger.Binds;
import dagger.Lazy;
import dagger.Module;
@@ -276,8 +278,8 @@ public interface NotificationsModule {
    @Provides
    static NotificationsController provideNotificationsController(
            Context context,
            Lazy<NotificationsControllerImpl> realController,
            Lazy<NotificationsControllerStub> stubController) {
            Provider<NotificationsControllerImpl> realController,
            Provider<NotificationsControllerStub> stubController) {
        if (context.getResources().getBoolean(R.bool.config_renderNotifications)) {
            return realController.get();
        } else {
+0 −5
Original line number Diff line number Diff line
@@ -23,11 +23,8 @@ 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 com.android.systemui.statusbar.phone.StatusBar
import com.android.wm.shell.bubbles.Bubbles
import java.io.FileDescriptor
import java.io.PrintWriter
import java.util.Optional

/**
 * The master controller for all notifications-related work
@@ -37,8 +34,6 @@ import java.util.Optional
 */
interface NotificationsController {
    fun initialize(
        statusBar: StatusBar,
        bubblesOptional: Optional<Bubbles>,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
+4 −4
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import javax.inject.Inject
 */
@SysUISingleton
class NotificationsControllerImpl @Inject constructor(
    private val statusBar: Lazy<StatusBar>,
    private val notifPipelineFlags: NotifPipelineFlags,
    private val notificationListener: NotificationListener,
    private val entryManager: NotificationEntryManager,
@@ -86,12 +87,11 @@ class NotificationsControllerImpl @Inject constructor(
    private val headsUpViewBinder: HeadsUpViewBinder,
    private val clickerBuilder: NotificationClicker.Builder,
    private val animatedImageNotificationManager: AnimatedImageNotificationManager,
    private val peopleSpaceWidgetManager: PeopleSpaceWidgetManager
    private val peopleSpaceWidgetManager: PeopleSpaceWidgetManager,
    private val bubblesOptional: Optional<Bubbles>,
) : NotificationsController {

    override fun initialize(
        statusBar: StatusBar,
        bubblesOptional: Optional<Bubbles>,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
@@ -109,7 +109,7 @@ class NotificationsControllerImpl @Inject constructor(

        notificationRowBinder.setNotificationClicker(
                clickerBuilder.build(
                        Optional.of(statusBar), bubblesOptional, notificationActivityStarter))
                        Optional.of(statusBar.get()), bubblesOptional, notificationActivityStarter))
        notificationRowBinder.setUpWithPresenter(
                presenter,
                listContainer,
Loading