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

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

Merge "Log notification assistant importance whenever available."

parents 5435f523 605d61bc
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1291,14 +1291,12 @@ public final class NotificationRecord {
                lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_INITIAL,
                        stats.naturalImportance);
            }
            // Log Assistant override if it was itself overridden by System. Since System can't be
            // overridden, it never needs logging.
            if (mImportanceExplanationCode == MetricsEvent.IMPORTANCE_EXPLANATION_SYSTEM
                    && mAssistantImportance != IMPORTANCE_UNSPECIFIED) {
        }
        // Log Assistant override if present, whether or not importance calculation is complete.
        if (mAssistantImportance != IMPORTANCE_UNSPECIFIED) {
            lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST,
                        mAssistantImportance);
        }
        }
        return lm;
    }

+3 −2
Original line number Diff line number Diff line
@@ -477,8 +477,9 @@ public class NotificationRecordTest extends UiServiceTestCase {
        assertEquals(MetricsEvent.IMPORTANCE_EXPLANATION_APP,
                logMaker.getTaggedData(
                        MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_INITIAL_EXPLANATION));
        // This field is only populated if the assistant was itself overridden by the system.
        assertNull(logMaker.getTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST));
        // This field is populated whenever mImportanceExplanationCode is.
        assertEquals(IMPORTANCE_LOW,
                logMaker.getTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST));
    }

    @Test