| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
package android.service.autofill.augmented; |
| 17 |
|
| 18 |
import android.annotation.NonNull; |
| 19 |
import android.content.ComponentName; |
| 20 |
import android.metrics.LogMaker; |
| 21 |
|
| 22 |
import com.android.internal.logging.MetricsLogger; |
| 23 |
import com.android.internal.logging.nano.MetricsProto.MetricsEvent; |
| 24 |
|
| 25 |
|
| 26 |
public final class Helper { |
| 27 |
|
| 28 |
private static final MetricsLogger sMetricsLogger = new MetricsLogger(); |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
public static void logResponse(int type, @NonNull String servicePackageName, |
| 34 |
@NonNull ComponentName componentName, int mSessionId, long durationMs) { |
| 35 |
|
| 36 |
final ComponentName sanitizedComponentName = |
| 37 |
new ComponentName(componentName.getPackageName(), ""); |
| 38 |
final LogMaker log = new LogMaker(MetricsEvent.AUTOFILL_AUGMENTED_RESPONSE) |
| 39 |
.setType(type) |
| 40 |
.setComponentName(sanitizedComponentName) |
| 41 |
.addTaggedData(MetricsEvent.FIELD_AUTOFILL_SESSION_ID, mSessionId) |
| 42 |
.addTaggedData(MetricsEvent.FIELD_AUTOFILL_SERVICE, servicePackageName) |
| 43 |
.addTaggedData(MetricsEvent.FIELD_AUTOFILL_DURATION, durationMs); |
| 44 |
sMetricsLogger.write(log); |
| 45 |
} |
| 46 |
|
| 47 |
private Helper() { |
| 48 |
throw new UnsupportedOperationException("contains only static methods"); |
| 49 |
} |
| 50 |
} |