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

Commit 919f5179 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove premature bubble collapse from NotificationClicker." into main

parents ac308c35 d8fb01d8
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -3338,13 +3338,6 @@ public class BubbleController implements ConfigurationChangeListener,
            return mCachedState.getBubbleWithShortcutId(shortcutId);
        }

        @Override
        public void collapseStack() {
            mMainExecutor.execute(() -> {
                BubbleController.this.collapseStack();
            });
        }

        @Override
        public void expandStackAndSelectBubble(BubbleEntry entry) {
            mMainExecutor.execute(() -> {
+0 −3
Original line number Diff line number Diff line
@@ -107,9 +107,6 @@ public interface Bubbles {
     */
    boolean isBubbleExpanded(String key);

    /** Tell the stack of bubbles to collapse. */
    void collapseStack();

    /**
     * Request the stack expand if needed, then select the specified Bubble as current.
     * If no bubble exists for this entry, one is created.
+2 −17
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.notification;

import android.app.Notification;
@@ -27,9 +28,6 @@ import com.android.systemui.statusbar.notification.collection.EntryAdapter;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.shared.NotificationBundleUi;
import com.android.wm.shell.bubbles.Bubbles;

import java.util.Optional;

import javax.inject.Inject;

@@ -42,7 +40,6 @@ public final class NotificationClicker implements View.OnClickListener {

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

    private ExpandableNotificationRow.OnDragSuccessListener mOnDragSuccessListener
@@ -63,11 +60,9 @@ public final class NotificationClicker implements View.OnClickListener {
    private NotificationClicker(
            NotificationClickerLogger logger,
            PowerInteractor powerInteractor,
            Optional<Bubbles> bubblesOptional,
            NotificationActivityStarter notificationActivityStarter) {
        mLogger = logger;
        mPowerInteractor = powerInteractor;
        mBubblesOptional = bubblesOptional;
        mNotificationActivityStarter = notificationActivityStarter;
    }

@@ -108,14 +103,8 @@ public final class NotificationClicker implements View.OnClickListener {
        DejankUtils.postAfterTraversal(() -> row.setJustClicked(false));

        if (NotificationBundleUi.isEnabled()) {
            if (!row.getEntryAdapter().isBubble() && mBubblesOptional.isPresent()) {
                mBubblesOptional.get().collapseStack();
            }
            row.getEntryAdapter().onEntryClicked(row);
        } else {
            if (!row.getEntryLegacy().isBubble() && mBubblesOptional.isPresent()) {
                mBubblesOptional.get().collapseStack();
            }
            mNotificationActivityStarter.onNotificationClicked(row.getEntryLegacy(), row);
        }
    }
@@ -163,14 +152,10 @@ public final class NotificationClicker implements View.OnClickListener {
        }

        /** Builds an instance. */
        public NotificationClicker build(
                Optional<Bubbles> bubblesOptional,
                NotificationActivityStarter notificationActivityStarter
        ) {
        public NotificationClicker build(NotificationActivityStarter notificationActivityStarter) {
            return new NotificationClicker(
                    mLogger,
                    mPowerInteractor,
                    bubblesOptional,
                    notificationActivityStarter);
        }
    }
+1 −3
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import com.android.systemui.statusbar.notification.logging.NotificationLogger
import com.android.systemui.statusbar.notification.row.NotifBindPipelineInitializer
import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor
import com.android.systemui.statusbar.notification.stack.NotificationListContainer
import com.android.wm.shell.bubbles.Bubbles
import dagger.Lazy
import java.util.Optional
import javax.inject.Inject
@@ -69,7 +68,6 @@ constructor(
    private val clickerBuilder: NotificationClicker.Builder,
    private val animatedImageNotificationManager: AnimatedImageNotificationManager,
    private val peopleSpaceWidgetManager: PeopleSpaceWidgetManager,
    private val bubblesOptional: Optional<Bubbles>,
) : NotificationsController {

    override fun initialize(
@@ -90,7 +88,7 @@ constructor(
            )

        notificationRowBinder.setNotificationClicker(
            clickerBuilder.build(bubblesOptional, notificationActivityStarter)
            clickerBuilder.build(notificationActivityStarter)
        )
        notificationRowBinder.setUpWithPresenter(presenter, listContainer)
        notifBindPipelineInitializer.initialize()