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

Commit 1160317c authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "[Central Surfaces] Move NotificationClicker's wake to PowerInteractor." into udc-qpr-dev

parents 9b9d6d06 d2b0ad05
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -17,15 +17,14 @@ package com.android.systemui.statusbar.notification;

import android.app.Notification;
import android.os.PowerManager;
import android.os.SystemClock;
import android.service.notification.StatusBarNotification;
import android.util.Log;
import android.view.View;

import com.android.systemui.DejankUtils;
import com.android.systemui.power.domain.interactor.PowerInteractor;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.wm.shell.bubbles.Bubbles;

import java.util.Optional;
@@ -40,7 +39,7 @@ public final class NotificationClicker implements View.OnClickListener {
    private static final String TAG = "NotificationClicker";

    private final NotificationClickerLogger mLogger;
    private final Optional<CentralSurfaces> mCentralSurfacesOptional;
    private final PowerInteractor mPowerInteractor;
    private final Optional<Bubbles> mBubblesOptional;
    private final NotificationActivityStarter mNotificationActivityStarter;

@@ -54,11 +53,11 @@ public final class NotificationClicker implements View.OnClickListener {

    private NotificationClicker(
            NotificationClickerLogger logger,
            Optional<CentralSurfaces> centralSurfacesOptional,
            PowerInteractor powerInteractor,
            Optional<Bubbles> bubblesOptional,
            NotificationActivityStarter notificationActivityStarter) {
        mLogger = logger;
        mCentralSurfacesOptional = centralSurfacesOptional;
        mPowerInteractor = powerInteractor;
        mBubblesOptional = bubblesOptional;
        mNotificationActivityStarter = notificationActivityStarter;
    }
@@ -70,9 +69,7 @@ public final class NotificationClicker implements View.OnClickListener {
            return;
        }

        mCentralSurfacesOptional.ifPresent(centralSurfaces -> centralSurfaces.wakeUpIfDozing(
                SystemClock.uptimeMillis(), "NOTIFICATION_CLICK",
                PowerManager.WAKE_REASON_GESTURE));
        mPowerInteractor.wakeUpIfDozing("NOTIFICATION_CLICK", PowerManager.WAKE_REASON_GESTURE);

        final ExpandableNotificationRow row = (ExpandableNotificationRow) v;
        final NotificationEntry entry = row.getEntry();
@@ -131,21 +128,22 @@ public final class NotificationClicker implements View.OnClickListener {
    /** Daggerized builder for NotificationClicker. */
    public static class Builder {
        private final NotificationClickerLogger mLogger;
        private final PowerInteractor mPowerInteractor;

        @Inject
        public Builder(NotificationClickerLogger logger) {
        public Builder(NotificationClickerLogger logger, PowerInteractor powerInteractor) {
            mLogger = logger;
            mPowerInteractor = powerInteractor;
        }

        /** Builds an instance. */
        public NotificationClicker build(
                Optional<CentralSurfaces> centralSurfacesOptional,
                Optional<Bubbles> bubblesOptional,
                NotificationActivityStarter notificationActivityStarter
        ) {
            return new NotificationClicker(
                    mLogger,
                    centralSurfacesOptional,
                    mPowerInteractor,
                    bubblesOptional,
                    notificationActivityStarter);
        }
+0 −2
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import com.android.systemui.statusbar.NotificationPresenter
import com.android.systemui.statusbar.notification.NotificationActivityStarter
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,7 +31,6 @@ import com.android.systemui.statusbar.phone.CentralSurfaces
 */
interface NotificationsController {
    fun initialize(
        centralSurfaces: CentralSurfaces,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
+1 −5
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import com.android.systemui.statusbar.notification.logging.NotificationLogger
import com.android.systemui.statusbar.notification.logging.NotificationMemoryMonitor
import com.android.systemui.statusbar.notification.row.NotifBindPipelineInitializer
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
import com.android.systemui.statusbar.phone.CentralSurfaces
import com.android.wm.shell.bubbles.Bubbles
import dagger.Lazy
import java.util.Optional
@@ -78,7 +77,6 @@ class NotificationsControllerImpl @Inject constructor(
) : NotificationsController {

    override fun initialize(
        centralSurfaces: CentralSurfaces,
        presenter: NotificationPresenter,
        listContainer: NotificationListContainer,
        stackController: NotifStackController,
@@ -93,9 +91,7 @@ class NotificationsControllerImpl @Inject constructor(
        })

        notificationRowBinder.setNotificationClicker(
                clickerBuilder.build(
                    Optional.ofNullable(centralSurfaces), bubblesOptional,
                        notificationActivityStarter))
            clickerBuilder.build(bubblesOptional, notificationActivityStarter))
        notificationRowBinder.setUpWithPresenter(presenter, listContainer)
        headsUpViewBinder.setPresenter(presenter)
        notifBindPipelineInitializer.initialize()
+0 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import com.android.systemui.statusbar.NotificationPresenter
import com.android.systemui.statusbar.notification.NotificationActivityStarter
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,7 +33,6 @@ class NotificationsControllerStub @Inject constructor(
) : NotificationsController {

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