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

Commit df399f52 authored by Ben Lin's avatar Ben Lin Committed by Julia Tuttle
Browse files

Move CentralSurface into initialize().

Not all devices have CentralSurface, so moving off injection into
initialize parameter.

Cherry-picked from ag/18698975.

Bug: 243819288
Test: build
Change-Id: I2debf1f857b397924ddb29b24ea6863421ac3304
parent 26c1fd79
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ 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.CentralSurfaces

/**
 * The master controller for all notifications-related work
@@ -32,6 +33,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain
 */
interface NotificationsController {
    fun initialize(
        centralSurfaces: CentralSurfaces,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
+3 −3
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ import javax.inject.Inject
 */
@SysUISingleton
class NotificationsControllerImpl @Inject constructor(
    private val centralSurfaces: Lazy<CentralSurfaces>,
    private val notificationListener: NotificationListener,
    private val commonNotifCollection: Lazy<CommonNotifCollection>,
    private val notifPipeline: Lazy<NotifPipeline>,
@@ -76,6 +75,7 @@ class NotificationsControllerImpl @Inject constructor(
) : NotificationsController {

    override fun initialize(
        centralSurfaces: CentralSurfaces,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
@@ -92,8 +92,8 @@ class NotificationsControllerImpl @Inject constructor(

        notificationRowBinder.setNotificationClicker(
                clickerBuilder.build(
                    Optional.of(
                        centralSurfaces.get()), bubblesOptional, notificationActivityStarter))
                    Optional.ofNullable(centralSurfaces), bubblesOptional,
                        notificationActivityStarter))
        notificationRowBinder.setUpWithPresenter(
                presenter,
                listContainer,
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ 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.CentralSurfaces
import javax.inject.Inject

/**
@@ -34,6 +35,7 @@ class NotificationsControllerStub @Inject constructor(
) : NotificationsController {

    override fun initialize(
        centralSurfaces: CentralSurfaces,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
+1 −0
Original line number Diff line number Diff line
@@ -1421,6 +1421,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        mStackScrollerController.setNotificationActivityStarter(mNotificationActivityStarter);
        mGutsManager.setNotificationActivityStarter(mNotificationActivityStarter);
        mNotificationsController.initialize(
                this,
                mPresenter,
                mNotifListContainer,
                mStackScrollerController.getNotifStackController(),