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

Commit 9afe7663 authored by Evan Laird's avatar Evan Laird
Browse files

Rename getters on NotificationEntry

Rename key(), sbn(), and ranking() as getKey(), getSbn(), and
getRanking(). This improves kotlin interop and is a lil more standard.

Test: atest SystemUITests
Change-Id: I8cb87a8b64940dc1f245f18ee010d60b08431789
parent 70fcec4e
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -212,13 +212,13 @@ public class NotificationEntryManager implements
            NotificationEntry entry = mPendingNotifications.get(key);
            entry.abortTask();
            mPendingNotifications.remove(key);
            mNotifLog.log(NotifEvent.INFLATION_ABORTED, entry.sbn(), null,
            mNotifLog.log(NotifEvent.INFLATION_ABORTED, entry.getSbn(), null,
                    "PendingNotification aborted. " + reason);
        }
        NotificationEntry addedEntry = mNotificationData.get(key);
        if (addedEntry != null) {
            addedEntry.abortTask();
            mNotifLog.log(NotifEvent.INFLATION_ABORTED, addedEntry.sbn(),
            mNotifLog.log(NotifEvent.INFLATION_ABORTED, addedEntry.getSbn(),
                    null, reason);
        }
    }
@@ -302,7 +302,7 @@ public class NotificationEntryManager implements
                        lifetimeExtended = true;
                        mNotifLog.log(
                                NotifEvent.LIFETIME_EXTENDED,
                                pendingEntry.sbn(),
                                pendingEntry.getSbn(),
                                "pendingEntry extendedBy=" + extender.toString());
                    }
                }
@@ -325,7 +325,7 @@ public class NotificationEntryManager implements
                        lifetimeExtended = true;
                        mNotifLog.log(
                                NotifEvent.LIFETIME_EXTENDED,
                                entry.sbn(),
                                entry.getSbn(),
                                "entry extendedBy=" + extender.toString());
                        break;
                    }
@@ -350,7 +350,7 @@ public class NotificationEntryManager implements
                Dependency.get(LeakDetector.class).trackGarbage(entry);
                removedByUser |= entryDismissed;

                mNotifLog.log(NotifEvent.NOTIF_REMOVED, entry.sbn(),
                mNotifLog.log(NotifEvent.NOTIF_REMOVED, entry.getSbn(),
                        "removedByUser=" + removedByUser);
                for (NotificationEntryListener listener : mNotificationEntryListeners) {
                    listener.onEntryRemoved(entry, visibility, removedByUser);
@@ -421,7 +421,7 @@ public class NotificationEntryManager implements

        abortExistingInflation(key, "addNotification");
        mPendingNotifications.put(key, entry);
        mNotifLog.log(NotifEvent.NOTIF_ADDED, entry.sbn());
        mNotifLog.log(NotifEvent.NOTIF_ADDED, entry.getSbn());
        for (NotificationEntryListener listener : mNotificationEntryListeners) {
            listener.onPendingEntryAdded(entry);
        }
@@ -453,7 +453,7 @@ public class NotificationEntryManager implements
        cancelLifetimeExtension(entry);

        mNotificationData.update(entry, ranking, notification, "updateNotificationInternal");
        mNotifLog.log(NotifEvent.NOTIF_UPDATED, entry.sbn(), entry.ranking());
        mNotifLog.log(NotifEvent.NOTIF_UPDATED, entry.getSbn(), entry.getRanking());
        for (NotificationEntryListener listener : mNotificationEntryListeners) {
            listener.onPreEntryUpdated(entry);
        }
@@ -538,7 +538,7 @@ public class NotificationEntryManager implements
        }
        for (NotificationEntry pendingNotification : mPendingNotifications.values()) {
            Ranking ranking = new Ranking();
            if (rankingMap.getRanking(pendingNotification.key(), ranking)) {
            if (rankingMap.getRanking(pendingNotification.getKey(), ranking)) {
                pendingNotification.setRanking(ranking);
            }
        }
+9 −9
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ public class NotifCollection {
        checkNotNull(stats);
        checkForReentrantCall();

        removeNotification(entry.key(), null, reason, stats);
        removeNotification(entry.getKey(), null, reason, stats);
    }

    private void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) {
@@ -244,16 +244,16 @@ public class NotifCollection {
        mAmDispatchingToOtherCode = false;

        if (!isLifetimeExtended(entry)) {
            mNotificationSet.remove(entry.key());
            mNotificationSet.remove(entry.getKey());

            if (dismissedByUserStats != null) {
                try {
                    mStatusBarService.onNotificationClear(
                            entry.sbn().getPackageName(),
                            entry.sbn().getTag(),
                            entry.sbn().getId(),
                            entry.sbn().getUser().getIdentifier(),
                            entry.sbn().getKey(),
                            entry.getSbn().getPackageName(),
                            entry.getSbn().getTag(),
                            entry.getSbn().getId(),
                            entry.getSbn().getUser().getIdentifier(),
                            entry.getSbn().getKey(),
                            dismissedByUserStats.dismissalSurface,
                            dismissedByUserStats.dismissalSentiment,
                            dismissedByUserStats.notificationVisibility);
@@ -275,7 +275,7 @@ public class NotifCollection {
    private void applyRanking(RankingMap rankingMap) {
        for (NotificationEntry entry : mNotificationSet.values()) {
            if (!isLifetimeExtended(entry)) {
                Ranking ranking = requireRanking(rankingMap, entry.key());
                Ranking ranking = requireRanking(rankingMap, entry.getKey());
                entry.setRanking(ranking);
            }
        }
@@ -305,7 +305,7 @@ public class NotifCollection {
        if (!isLifetimeExtended(entry)) {
            // TODO: This doesn't need to be undefined -- we can set either EXTENDER_EXPIRED or
            // save the original reason
            removeNotification(entry.key(), null, REASON_UNKNOWN, null);
            removeNotification(entry.getKey(), null, REASON_UNKNOWN, null);
        }
    }

+4 −4
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ public class NotificationData {
        }
        mGroupManager.onEntryAdded(entry);

        updateRankingAndSort(mRankingMap, "addEntry=" + entry.sbn());
        updateRankingAndSort(mRankingMap, "addEntry=" + entry.getSbn());
    }

    public NotificationEntry remove(String key, RankingMap ranking) {
@@ -194,7 +194,7 @@ public class NotificationData {
        }
        if (removed == null) return null;
        mGroupManager.onEntryRemoved(removed);
        updateRankingAndSort(ranking, "removeEntry=" + removed.sbn());
        updateRankingAndSort(ranking, "removeEntry=" + removed.getSbn());
        return removed;
    }

@@ -338,7 +338,7 @@ public class NotificationData {
    }

    private boolean isImportantMedia(NotificationEntry e) {
        int importance = e.ranking().getImportance();
        int importance = e.getRanking().getImportance();
        boolean media = e.key.equals(getMediaManager().getMediaNotificationKey())
                && importance > NotificationManager.IMPORTANCE_MIN;

@@ -346,7 +346,7 @@ public class NotificationData {
    }

    private boolean isSystemMax(NotificationEntry e) {
        int importance = e.ranking().getImportance();
        int importance = e.getRanking().getImportance();
        boolean sys = importance  >= NotificationManager.IMPORTANCE_HIGH
                && isSystemNotification(e.notification);

+3 −3
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ public final class NotificationEntry {
    }

    /** The key for this notification. Guaranteed to be immutable and unique */
    public String key() {
    public String getKey() {
        return key;
    }

@@ -189,7 +189,7 @@ public final class NotificationEntry {
     * The StatusBarNotification that represents one half of a NotificationEntry (the other half
     * being the Ranking). This object is swapped out whenever a notification is updated.
     */
    public StatusBarNotification sbn() {
    public StatusBarNotification getSbn() {
        return notification;
    }

@@ -211,7 +211,7 @@ public final class NotificationEntry {
     * StatusBarNotification). This object is swapped out whenever a the ranking is updated (which
     * generally occurs whenever anything changes in the notification list).
     */
    public Ranking ranking() {
    public Ranking getRanking() {
        return mRanking;
    }

+2 −2
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public class NotifLog extends SysuiLog {
     * @return true if successfully logged, else false
     */
    public boolean log(@NotifEvent.EventType int eventType, NotificationEntry entry) {
        return log(eventType, entry.sbn(), entry.ranking(), "");
        return log(eventType, entry.getSbn(), entry.getRanking(), "");
    }

    /**
@@ -120,6 +120,6 @@ public class NotifLog extends SysuiLog {
     */
    public boolean log(@NotifEvent.EventType int eventType, NotificationEntry entry,
            String msg) {
        return log(eventType, entry.sbn(), entry.ranking(), msg);
        return log(eventType, entry.getSbn(), entry.getRanking(), msg);
    }
}
Loading