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

Commit 7b771168 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

TRON log important auto-fill events

Example log from
android.autofillservice.cts.LoginActivityTest#testAutoFill#testAutoFillOneDatasetAndSave
(translated from numbers of human readable string):

AUTOFILL_SESSION_STARTED
   package=android.autofillservice.cts
AUTOFILL_REQUEST
   type=TYPE_SUCCESS
   package=android.autofillservice.cts
   FIELD_AUTOFILL_SERVICE=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_DATASETS=1
AUTOFILL_FILL_UI
   type=TYPE_ACTION
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_DATASETS=1
   FIELD_AUTOFILL_FILTERTEXT_LEN=0
AUTOFILL_DATASET_APPLIED
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_VALUES=2
   FIELD_AUTOFILL_NUM_VIEWS_FILLED=2
AUTOFILL_SAVE_UI
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_IDS=2
AUTOFILL_DATA_SAVE_REQUEST
   type=TYPE_SUCCESS
   package=android.autofillservice.cts
   FIELD_AUTOFILL_SERVICE=android.autofillservice.cts
AUTOFILL_SESSION_FINISHED
   package=android.autofillservice.cts

Test: Ran auto-fill tests and looked at event log.
Change-Id: I58aaa58e4435e7d04c8cd91878411943d3eb13de
parent 7e5407ec
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45076,8 +45076,8 @@ package android.view {
    method public void addTouchables(java.util.ArrayList<android.view.View>);
    method public android.view.ViewPropertyAnimator animate();
    method public void announceForAccessibility(java.lang.CharSequence);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofillVirtual(int, android.view.autofill.AutofillValue);
    method public boolean autofill(android.view.autofill.AutofillValue);
    method public boolean autofillVirtual(int, android.view.autofill.AutofillValue);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
+2 −2
Original line number Diff line number Diff line
@@ -48539,8 +48539,8 @@ package android.view {
    method public void addTouchables(java.util.ArrayList<android.view.View>);
    method public android.view.ViewPropertyAnimator animate();
    method public void announceForAccessibility(java.lang.CharSequence);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofillVirtual(int, android.view.autofill.AutofillValue);
    method public boolean autofill(android.view.autofill.AutofillValue);
    method public boolean autofillVirtual(int, android.view.autofill.AutofillValue);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
+2 −2
Original line number Diff line number Diff line
@@ -45436,8 +45436,8 @@ package android.view {
    method public void addTouchables(java.util.ArrayList<android.view.View>);
    method public android.view.ViewPropertyAnimator animate();
    method public void announceForAccessibility(java.lang.CharSequence);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofillVirtual(int, android.view.autofill.AutofillValue);
    method public boolean autofill(android.view.autofill.AutofillValue);
    method public boolean autofillVirtual(int, android.view.autofill.AutofillValue);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
+18 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.metrics.LogMaker;
import android.view.autofill.AutofillId;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
@@ -23,6 +24,8 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.app.ToolbarActionBar;
import com.android.internal.app.WindowDecorActionBar;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.policy.PhoneWindow;

import android.annotation.CallSuper;
@@ -765,6 +768,7 @@ public class Activity extends ContextThemeWrapper
    /*package*/ Configuration mCurrentConfig;
    private SearchManager mSearchManager;
    private MenuInflater mMenuInflater;
    private final MetricsLogger mMetricsLogger = new MetricsLogger();

    static final class NonConfigurationInstances {
        Object activity;
@@ -7188,6 +7192,8 @@ public class Activity extends ContextThemeWrapper
    public void autofill(List<AutofillId> ids, List<AutofillValue> values) {
        final View root = getWindow().getDecorView();
        final int itemCount = ids.size();
        int numApplied = 0;

        for (int i = 0; i < itemCount; i++) {
            final AutofillId id = ids.get(i);
            final AutofillValue value = values.get(i);
@@ -7197,12 +7203,22 @@ public class Activity extends ContextThemeWrapper
                Log.w(TAG, "autofill(): no View with id " + viewId);
                continue;
            }
            final boolean wasApplied;
            if (id.isVirtual()) {
                view.autofillVirtual(id.getVirtualChildId(), value);
                wasApplied = view.autofillVirtual(id.getVirtualChildId(), value);
            } else {
                view.autofill(value);
                wasApplied = view.autofill(value);
            }

            if (wasApplied) {
                numApplied++;
            }
        }

        LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED);
        log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount);
        log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, numApplied);
        mMetricsLogger.write(log);
    }

    /** @hide */
+8 −2
Original line number Diff line number Diff line
@@ -7445,8 +7445,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * </pre>
     *
     * @param value value to be autofilled.
     *
     * @return {@code true} if the view was successfully autofilled, {@code false} otherwise
     */
    public void autofill(@SuppressWarnings("unused") AutofillValue value) {
    public boolean autofill(@SuppressWarnings("unused") AutofillValue value) {
        return false;
    }
    /**
@@ -7457,9 +7460,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *
     * @param value value to be autofilled.
     * @param virtualId id identifying the virtual child inside the custom view.
     *
     * @return {@code true} if the view was successfully autofilled, {@code false} otherwise
     */
    public void autofillVirtual(@SuppressWarnings("unused") int virtualId,
    public boolean autofillVirtual(@SuppressWarnings("unused") int virtualId,
            @SuppressWarnings("unused") AutofillValue value) {
        return false;
    }
    /**
Loading