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

Commit 933f80a1 authored by Will Brockman's avatar Will Brockman
Browse files

Remove Tron logging in NotificationRecord.applyAdjustments().

It turns out to be not all that useful for analysis, and it is fairly
high-bandwidth, because it happens every time a notification is
updated.

Bug: 127834982
Test: atest frameworks/base/services/tests/uiservicestests/src/com/android/server/notification
Change-Id: I1cd142d7e06512e4453e09d99f16d5814c47fa4c
parent 49c1069c
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -637,25 +637,17 @@ public final class NotificationRecord {
                    final ArrayList<String> people =
                            adjustment.getSignals().getStringArrayList(Adjustment.KEY_PEOPLE);
                    setPeopleOverride(people);
                    MetricsLogger.action(getAdjustmentLogMaker()
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_PEOPLE, people.size()));
                }
                if (signals.containsKey(Adjustment.KEY_SNOOZE_CRITERIA)) {
                    final ArrayList<SnoozeCriterion> snoozeCriterionList =
                            adjustment.getSignals().getParcelableArrayList(
                                    Adjustment.KEY_SNOOZE_CRITERIA);
                    setSnoozeCriteria(snoozeCriterionList);
                    MetricsLogger.action(getAdjustmentLogMaker()
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_SNOOZE_CRITERIA,
                                    snoozeCriterionList.size()));
                }
                if (signals.containsKey(Adjustment.KEY_GROUP_KEY)) {
                    final String groupOverrideKey =
                            adjustment.getSignals().getString(Adjustment.KEY_GROUP_KEY);
                    setOverrideGroupKey(groupOverrideKey);
                    MetricsLogger.action(getAdjustmentLogMaker()
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_GROUP_KEY,
                                    groupOverrideKey));
                }
                if (signals.containsKey(Adjustment.KEY_USER_SENTIMENT)) {
                    // Only allow user sentiment update from assistant if user hasn't already
@@ -664,32 +656,20 @@ public final class NotificationRecord {
                            && (getChannel().getUserLockedFields() & USER_LOCKED_IMPORTANCE) == 0) {
                        setUserSentiment(adjustment.getSignals().getInt(
                                Adjustment.KEY_USER_SENTIMENT, USER_SENTIMENT_NEUTRAL));
                        MetricsLogger.action(getAdjustmentLogMaker()
                                .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_USER_SENTIMENT,
                                        getUserSentiment()));
                    }
                }
                if (signals.containsKey(Adjustment.KEY_CONTEXTUAL_ACTIONS)) {
                    setSystemGeneratedSmartActions(
                            signals.getParcelableArrayList(Adjustment.KEY_CONTEXTUAL_ACTIONS));
                    MetricsLogger.action(getAdjustmentLogMaker()
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_SMART_ACTIONS,
                                    getSystemGeneratedSmartActions().size()));
                }
                if (signals.containsKey(Adjustment.KEY_TEXT_REPLIES)) {
                    setSmartReplies(signals.getCharSequenceArrayList(Adjustment.KEY_TEXT_REPLIES));
                    MetricsLogger.action(getAdjustmentLogMaker()
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_SMART_REPLIES,
                                    getSmartReplies().size()));
                }
                if (signals.containsKey(Adjustment.KEY_IMPORTANCE)) {
                    int importance = signals.getInt(Adjustment.KEY_IMPORTANCE);
                    importance = Math.max(IMPORTANCE_UNSPECIFIED, importance);
                    importance = Math.min(IMPORTANCE_HIGH, importance);
                    setAssistantImportance(importance);
                    MetricsLogger.action(getAdjustmentLogMaker()
                            .addTaggedData(MetricsEvent.ADJUSTMENT_KEY_IMPORTANCE,
                                    importance));
                }
            }
            // We have now gotten all the information out of the adjustments and can forget them.
@@ -1280,12 +1260,6 @@ public final class NotificationRecord {
        return getLogMaker().setCategory(MetricsEvent.NOTIFICATION_ITEM);
    }

    public LogMaker getAdjustmentLogMaker() {
        return getLogMaker()
                .setCategory(MetricsEvent.NOTIFICATION_ITEM)
                .setType(MetricsEvent.TYPE_NOTIFICATION_ASSISTANT_ADJUSTMENT);
    }

    @VisibleForTesting
    static final class Light {
        public final int color;