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

Commit 59a9fc1a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I259a66fb,I861d2545

* changes:
  Fix inadvertently inverted notif count check
  Simplify StatusBarNotificationActivityStarter
parents bc5fd7fd ca8aad2f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3562,7 +3562,7 @@ public class NotificationPanelView extends PanelView implements

    private void updateShowEmptyShadeView() {
        boolean showEmptyShadeView =
                mBarState != StatusBarState.KEYGUARD && mEntryManager.hasActiveNotifications();
                mBarState != StatusBarState.KEYGUARD && !mEntryManager.hasActiveNotifications();
        showEmptyShadeView(showEmptyShadeView);
    }

+10 −16
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.text.TextUtils;
import android.util.EventLog;
import android.util.Log;
import android.view.RemoteAnimationAdapter;
import android.view.View;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.statusbar.IStatusBarService;
@@ -75,7 +76,7 @@ import com.android.systemui.statusbar.policy.KeyguardStateController;
 */
public class StatusBarNotificationActivityStarter implements NotificationActivityStarter {

    private static final String TAG = "NotificationClickHandler";
    private static final String TAG = "NotifActivityStarter";
    protected static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);

    private final AssistManager mAssistManager;
@@ -197,8 +198,6 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            return;
        }

        final String notificationKey = sbn.getKey();

        boolean isActivityIntent = intent != null && intent.isActivity() && !isBubble;
        final boolean afterKeyguardGone = isActivityIntent
                && mActivityIntentHelper.wouldLaunchResolverActivity(intent.getIntent(),
@@ -209,7 +208,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                mLockscreenUserManager.getCurrentUserId());
        ActivityStarter.OnDismissAction postKeyguardAction =
                () -> handleNotificationClickAfterKeyguardDismissed(
                        sbn, row, controller, intent, notificationKey,
                        sbn, row, controller, intent,
                        isActivityIntent, wasOccluded, showOverLockscreen);
        if (showOverLockscreen) {
            mIsCollapsingToShowActivityOverLockscreen = true;
@@ -225,12 +224,11 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            ExpandableNotificationRow row,
            RemoteInputController controller,
            PendingIntent intent,
            String notificationKey,
            boolean isActivityIntent,
            boolean wasOccluded,
            boolean showOverLockscreen) {
        // TODO: Some of this code may be able to move to NotificationEntryManager.
        if (mHeadsUpManager != null && mHeadsUpManager.isAlerting(notificationKey)) {
        if (mHeadsUpManager != null && mHeadsUpManager.isAlerting(sbn.getKey())) {
            // Release the HUN notification to the shade.

            if (mPresenter.isPresenterFullyCollapsed()) {
@@ -252,7 +250,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
        }
        final StatusBarNotification parentToCancelFinal = parentToCancel;
        final Runnable runnable = () -> handleNotificationClickAfterPanelCollapsed(
                sbn, row, controller, intent, notificationKey,
                sbn, row, controller, intent,
                isActivityIntent, wasOccluded, parentToCancelFinal);

        if (showOverLockscreen) {
@@ -273,10 +271,10 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            ExpandableNotificationRow row,
            RemoteInputController controller,
            PendingIntent intent,
            String notificationKey,
            boolean isActivityIntent,
            boolean wasOccluded,
            StatusBarNotification parentToCancelFinal) {
        String notificationKey = sbn.getKey();
        try {
            // The intent we are sending is for the application, which
            // won't have permission to immediately start an activity after
@@ -310,7 +308,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
        if (!TextUtils.isEmpty(entry.remoteInputText)) {
            remoteInputText = entry.remoteInputText;
        }
        if (!TextUtils.isEmpty(remoteInputText) && !controller.isSpinning(entry.getKey())) {
        if (!TextUtils.isEmpty(remoteInputText) && !controller.isSpinning(notificationKey)) {
            fillInIntent = new Intent().putExtra(Notification.EXTRA_REMOTE_INPUT_DRAFT,
                    remoteInputText.toString());
        }
@@ -326,14 +324,10 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            collapseOnMainThread();
        }

        //TODO(b/144306683): prove that this `activeEntry` is the same as `entry` above and simplify
        // this call stack
        NotificationEntry activeEntry =
                mEntryManager.getActiveNotificationUnfiltered(notificationKey);
        final int count = mEntryManager.getActiveNotificationsCount();
        final int rank = activeEntry != null ? activeEntry.getRanking().getRank() : 0;
        final int rank = entry.getRanking().getRank();
        NotificationVisibility.NotificationLocation location =
                NotificationLogger.getNotificationLocation(activeEntry);
                NotificationLogger.getNotificationLocation(entry);
        final NotificationVisibility nv = NotificationVisibility.obtain(notificationKey,
                rank, count, true, location);
        try {
@@ -365,7 +359,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
    }

    private void startNotificationIntent(PendingIntent intent, Intent fillInIntent,
            ExpandableNotificationRow row, boolean wasOccluded, boolean isActivityIntent) {
            View row, boolean wasOccluded, boolean isActivityIntent) {
        RemoteAnimationAdapter adapter = mActivityLaunchAnimator.getLaunchAnimation(row,
                wasOccluded);
        try {