New Autofill field: FIELD_AUTOFILL_SESSION_ID

This field contains the autofill session id (Thank You, Captain Obvious!), which
is useful to correlate autofill metrics that are not logged on
AUTOFILL_REQUEST.

Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Test: manually run some test and watched
      'adb shell logcat -b events | grep sysui'. Example:
     [757,913,758,4,806,android.autofillservice.cts,871,android.autofillservice.cts.LoginActivity,914,2,915,2,1456,-2045861404

Fixes: 80093094

Merged-In: If4b1c9ab616b2ba580745096894997eb7edb3e34
Change-Id: If4b1c9ab616b2ba580745096894997eb7edb3e34
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index 5305c1a..7555fff 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -1900,8 +1900,11 @@
 
     private LogMaker newLog(int category) {
         final LogMaker log = new LogMaker(category)
-                .addTaggedData(MetricsEvent.FIELD_AUTOFILL_COMPAT_MODE,
-                        isCompatibilityModeEnabledLocked() ? 1 : 0);
+                .addTaggedData(MetricsEvent.FIELD_AUTOFILL_SESSION_ID, mSessionId);
+
+        if (isCompatibilityModeEnabledLocked()) {
+            log.addTaggedData(MetricsEvent.FIELD_AUTOFILL_COMPAT_MODE, 1);
+        }
         final AutofillClient client = getClient();
         if (client == null) {
             // Client should never be null here, but it doesn't hurt to check...