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

Commit 605d61bc authored by Will Brockman's avatar Will Brockman
Browse files

Log notification assistant importance whenever available.

To monitor the assistant's decisions we need to capture the importance
whether or not it was not used, and in particular for
user-importance-locked channels.

Bug: 129530634
Test: atest NotificationRecordTest
Change-Id: Ie6e2f61e8d305d613814e01917838ed5e1e8244f
parent 8449f6d4
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1290,14 +1290,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