Loading core/java/android/view/autofill/AutofillManager.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,7 @@ import android.view.View; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import java.io.PrintWriter; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.Retention; Loading Loading @@ -1245,10 +1245,10 @@ public final class AutofillManager { } } } } final LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED); final LogMaker log = new LogMaker(MetricsEvent.AUTOFILL_DATASET_APPLIED) log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount); .setPackageName(mContext.getPackageName()) log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount) numApplied); .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, numApplied); mMetricsLogger.write(log); mMetricsLogger.write(log); } } } } Loading proto/src/metrics_constants.proto +76 −0 Original line number Original line Diff line number Diff line Loading @@ -4451,6 +4451,82 @@ message MetricsEvent { // OS: O MR // OS: O MR FIELD_SELECTION_SMART_RANGE = 1123; FIELD_SELECTION_SMART_RANGE = 1123; // The value of an autofillable and savable view was reset // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_PREVIOUS_LENGTH: the previous length of the value AUTOFILL_VALUE_RESET = 1124; // Tag of AUTOFILL_VALUE_RESET // OS: O MR FIELD_AUTOFILL_PREVIOUS_LENGTH = 1125; // An autofill dataset authentification succeeded // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request AUTOFILL_DATASET_AUTHENTICATED = 1126; // An autofill service provided an invalid dataset authentification // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request AUTOFILL_INVALID_DATASET_AUTHENTICATION = 1127; // An autofill service provided an invalid authentification extra // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request AUTOFILL_INVALID_AUTHENTICATION = 1128; // An autofill service used a custom description (using RemoteViews) in the Save affordance // Package: Package of app that is autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_CUSTOM_DESCRIPTION = 1129; // FIELD - Type of save object passed by the service when the Save UI is shown // OS: O MR FIELD_AUTOFILL_SAVE_TYPE = 1130; // An autofill service used a custom subtitle (String) in the Save affordance // Package: Package of app that is autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_CUSTOM_SUBTITLE = 1131; // User tapped a link in the custom description of the Save affordance provided by an autofill service // Package: Package of app that is autofilled // OS: O MR // Type TYPE_UNKNOWN: The link was not properly set by the service // Type TYPE_OPEN: The link launched an activity // Type TYPE_FAILURE: The link could not launc an activity // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_LINK_TAPPED = 1132; // Result of the validation on save when an autofill service provided a validator // Package: Package of app that is autofilled // OS: O MR // Type TYPE_FAILURE: The validation could not be performed due to an error // Type TYPE_SUCCESS: The validation passed // Type TYPE_DISMISS: The validation failed // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_VALIDATION = 1133; // Result of an operation in the autofill save affordance after the user tapped a link in the custom description // provided by the autofill service // Package: Package of app that is autofilled // OS: O MR // Type TYPE_OPEN: The save affordance was restored // Type TYPE_DISMISS: The save affordcance was destroyed // Type TYPE_FAILURE: An invalid opperation was reported by the app's AutofillManager AUTOFILL_PENDING_SAVE_UI_OPERATION = 1134; // ---- End O-MR1 Constants, all O-MR1 constants go above this line ---- // ---- End O-MR1 Constants, all O-MR1 constants go above this line ---- // Add new aosp constants above this line. // Add new aosp constants above this line. Loading services/autofill/java/com/android/server/autofill/AutofillManagerService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -650,7 +650,7 @@ public final class AutofillManagerService extends SystemService { synchronized (mLock) { synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service == null) return false; if (service == null) return false; return Objects.equals(packageName, service.getPackageName()); return Objects.equals(packageName, service.getServicePackageName()); } } } } Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -146,8 +146,9 @@ final class AutofillManagerServiceImpl { updateLocked(disabled); updateLocked(disabled); } } @Nullable CharSequence getServiceName() { CharSequence getServiceName() { final String packageName = getPackageName(); final String packageName = getServicePackageName(); if (packageName == null) { if (packageName == null) { return null; return null; } } Loading @@ -162,7 +163,8 @@ final class AutofillManagerServiceImpl { } } } } String getPackageName() { @Nullable String getServicePackageName() { final ComponentName serviceComponent = getServiceComponentName(); final ComponentName serviceComponent = getServiceComponentName(); if (serviceComponent != null) { if (serviceComponent != null) { return serviceComponent.getPackageName(); return serviceComponent.getPackageName(); Loading services/autofill/java/com/android/server/autofill/Helper.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.autofill; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.metrics.LogMaker; import android.os.Bundle; import android.os.Bundle; import android.service.autofill.Dataset; import android.service.autofill.Dataset; import android.util.ArrayMap; import android.util.ArrayMap; Loading @@ -25,6 +26,8 @@ import android.util.ArraySet; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; import android.view.autofill.AutofillValue; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import java.util.ArrayList; import java.util.ArrayList; import java.util.Arrays; import java.util.Arrays; import java.util.Objects; import java.util.Objects; Loading Loading @@ -99,4 +102,14 @@ public final class Helper { } } return fields; return fields; } } @NonNull public static LogMaker newLogMaker(int category, String packageName, String servicePackageName) { final LogMaker log = new LogMaker(category).setPackageName(packageName); if (servicePackageName != null) { log.addTaggedData(MetricsEvent.FIELD_AUTOFILL_SERVICE, servicePackageName); } return log; } } } Loading
core/java/android/view/autofill/AutofillManager.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,7 @@ import android.view.View; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import java.io.PrintWriter; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.Retention; Loading Loading @@ -1245,10 +1245,10 @@ public final class AutofillManager { } } } } final LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED); final LogMaker log = new LogMaker(MetricsEvent.AUTOFILL_DATASET_APPLIED) log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount); .setPackageName(mContext.getPackageName()) log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount) numApplied); .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, numApplied); mMetricsLogger.write(log); mMetricsLogger.write(log); } } } } Loading
proto/src/metrics_constants.proto +76 −0 Original line number Original line Diff line number Diff line Loading @@ -4451,6 +4451,82 @@ message MetricsEvent { // OS: O MR // OS: O MR FIELD_SELECTION_SMART_RANGE = 1123; FIELD_SELECTION_SMART_RANGE = 1123; // The value of an autofillable and savable view was reset // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_PREVIOUS_LENGTH: the previous length of the value AUTOFILL_VALUE_RESET = 1124; // Tag of AUTOFILL_VALUE_RESET // OS: O MR FIELD_AUTOFILL_PREVIOUS_LENGTH = 1125; // An autofill dataset authentification succeeded // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request AUTOFILL_DATASET_AUTHENTICATED = 1126; // An autofill service provided an invalid dataset authentification // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request AUTOFILL_INVALID_DATASET_AUTHENTICATION = 1127; // An autofill service provided an invalid authentification extra // Package: Package of app that was autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request AUTOFILL_INVALID_AUTHENTICATION = 1128; // An autofill service used a custom description (using RemoteViews) in the Save affordance // Package: Package of app that is autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_CUSTOM_DESCRIPTION = 1129; // FIELD - Type of save object passed by the service when the Save UI is shown // OS: O MR FIELD_AUTOFILL_SAVE_TYPE = 1130; // An autofill service used a custom subtitle (String) in the Save affordance // Package: Package of app that is autofilled // OS: O MR // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_CUSTOM_SUBTITLE = 1131; // User tapped a link in the custom description of the Save affordance provided by an autofill service // Package: Package of app that is autofilled // OS: O MR // Type TYPE_UNKNOWN: The link was not properly set by the service // Type TYPE_OPEN: The link launched an activity // Type TYPE_FAILURE: The link could not launc an activity // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_LINK_TAPPED = 1132; // Result of the validation on save when an autofill service provided a validator // Package: Package of app that is autofilled // OS: O MR // Type TYPE_FAILURE: The validation could not be performed due to an error // Type TYPE_SUCCESS: The validation passed // Type TYPE_DISMISS: The validation failed // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Tag FIELD_AUTOFILL_SAVE_TYPE: Type of save object passed by the service AUTOFILL_SAVE_VALIDATION = 1133; // Result of an operation in the autofill save affordance after the user tapped a link in the custom description // provided by the autofill service // Package: Package of app that is autofilled // OS: O MR // Type TYPE_OPEN: The save affordance was restored // Type TYPE_DISMISS: The save affordcance was destroyed // Type TYPE_FAILURE: An invalid opperation was reported by the app's AutofillManager AUTOFILL_PENDING_SAVE_UI_OPERATION = 1134; // ---- End O-MR1 Constants, all O-MR1 constants go above this line ---- // ---- End O-MR1 Constants, all O-MR1 constants go above this line ---- // Add new aosp constants above this line. // Add new aosp constants above this line. Loading
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -650,7 +650,7 @@ public final class AutofillManagerService extends SystemService { synchronized (mLock) { synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service == null) return false; if (service == null) return false; return Objects.equals(packageName, service.getPackageName()); return Objects.equals(packageName, service.getServicePackageName()); } } } } Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -146,8 +146,9 @@ final class AutofillManagerServiceImpl { updateLocked(disabled); updateLocked(disabled); } } @Nullable CharSequence getServiceName() { CharSequence getServiceName() { final String packageName = getPackageName(); final String packageName = getServicePackageName(); if (packageName == null) { if (packageName == null) { return null; return null; } } Loading @@ -162,7 +163,8 @@ final class AutofillManagerServiceImpl { } } } } String getPackageName() { @Nullable String getServicePackageName() { final ComponentName serviceComponent = getServiceComponentName(); final ComponentName serviceComponent = getServiceComponentName(); if (serviceComponent != null) { if (serviceComponent != null) { return serviceComponent.getPackageName(); return serviceComponent.getPackageName(); Loading
services/autofill/java/com/android/server/autofill/Helper.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.autofill; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.metrics.LogMaker; import android.os.Bundle; import android.os.Bundle; import android.service.autofill.Dataset; import android.service.autofill.Dataset; import android.util.ArrayMap; import android.util.ArrayMap; Loading @@ -25,6 +26,8 @@ import android.util.ArraySet; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; import android.view.autofill.AutofillValue; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import java.util.ArrayList; import java.util.ArrayList; import java.util.Arrays; import java.util.Arrays; import java.util.Objects; import java.util.Objects; Loading Loading @@ -99,4 +102,14 @@ public final class Helper { } } return fields; return fields; } } @NonNull public static LogMaker newLogMaker(int category, String packageName, String servicePackageName) { final LogMaker log = new LogMaker(category).setPackageName(packageName); if (servicePackageName != null) { log.addTaggedData(MetricsEvent.FIELD_AUTOFILL_SERVICE, servicePackageName); } return log; } } }