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

Commit a6d5b0af authored by Ned Burns's avatar Ned Burns Committed by Android (Google) Code Review
Browse files

Merge changes I8b9e33b3,Ie2e979d2,I6d098f46

* changes:
  Move NotifEntry smart reply/actions to getters
  Move even MOAR NotificationEntry members to getters
  Move more NotificationEntry members to getters
parents 10e03940 5a9e3520
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -50,12 +50,12 @@ public class ForegroundServiceNotificationListener {
        notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
            @Override
            public void onPendingEntryAdded(NotificationEntry entry) {
                addNotification(entry.notification, entry.importance);
                addNotification(entry.notification, entry.getImportance());
            }

            @Override
            public void onPostEntryUpdated(NotificationEntry entry) {
                updateNotification(entry.notification, entry.importance);
                updateNotification(entry.notification, entry.getImportance());
            }

            @Override
+1 −1
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi

    void updateBubble(NotificationEntry notif, boolean suppressFlyout) {
        // If this is an interruptive notif, mark that it's interrupted
        if (notif.importance >= NotificationManager.IMPORTANCE_HIGH) {
        if (notif.getImportance() >= NotificationManager.IMPORTANCE_HIGH) {
            notif.setInterruption();
        }
        mBubbleData.notificationEntryUpdated(notif, suppressFlyout);
+8 −8
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@ import androidx.annotation.VisibleForTesting;

import com.android.systemui.statusbar.notification.collection.NotificationEntry;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -39,22 +37,24 @@ public class NotificationUiAdjustment {

    public final String key;
    public final List<Notification.Action> smartActions;
    public final CharSequence[] smartReplies;
    public final List<CharSequence> smartReplies;

    @VisibleForTesting
    NotificationUiAdjustment(
            String key, List<Notification.Action> smartActions, CharSequence[] smartReplies) {
            String key, List<Notification.Action> smartActions, List<CharSequence> smartReplies) {
        this.key = key;
        this.smartActions = smartActions == null
                ? Collections.emptyList()
                : new ArrayList<>(smartActions);
        this.smartReplies = smartReplies == null ? new CharSequence[0] : smartReplies.clone();
                : smartActions;
        this.smartReplies = smartReplies == null
                ? Collections.emptyList()
                : smartReplies;
    }

    public static NotificationUiAdjustment extractFromNotificationEntry(
            NotificationEntry entry) {
        return new NotificationUiAdjustment(
                entry.key, entry.systemGeneratedSmartActions, entry.systemGeneratedSmartReplies);
                entry.key, entry.getSmartActions(), entry.getSmartReplies());
    }

    public static boolean needReinflate(
@@ -66,7 +66,7 @@ public class NotificationUiAdjustment {
        if (areDifferent(oldAdjustment.smartActions, newAdjustment.smartActions)) {
            return true;
        }
        if (!Arrays.equals(oldAdjustment.smartReplies, newAdjustment.smartReplies)) {
        if (!newAdjustment.smartReplies.equals(oldAdjustment.smartReplies)) {
            return true;
        }
        return false;
+1 −1
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
            }

            row.showAppOpsIcons(entry.mActiveAppOps);
            row.setLastAudiblyAlertedMs(entry.lastAudiblyAlertedMs);
            row.setLastAudiblyAlertedMs(entry.getLastAudiblyAlertedMs());
        }

        Trace.beginSection("NotificationPresenter#onUpdateRowStates");
+1 −1
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ public class NotificationEntryManager implements
            NotificationUiAdjustment adjustment =
                    NotificationUiAdjustment.extractFromNotificationEntry(entry);
            oldAdjustments.put(entry.key, adjustment);
            oldImportances.put(entry.key, entry.importance);
            oldImportances.put(entry.key, entry.getImportance());
        }

        // Populate notification entries from the new rankings.
Loading