Loading services/credentials/java/com/android/server/credentials/ClearRequestSession.java +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public final class ClearRequestSession extends RequestSession<ClearCredentialSta public void onFinalResponseReceived( ComponentName componentName, Void response) { mRequestSessionMetric.collectUiResponseData(/*uiReturned=*/ true, System.nanoTime()); mRequestSessionMetric.updateMetricsOnResponseReceived(mProviders, componentName, isPrimaryProviderViaProviderInfo(componentName)); respondToClientWithResponseAndFinish(null); Loading services/credentials/java/com/android/server/credentials/CreateRequestSession.java +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public final class CreateRequestSession extends RequestSession<CreateCredentialR RequestInfo.TYPE_CREATE, callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); mRequestSessionMetric.collectCreateFlowInitialMetricInfo( /*origin=*/request.getOrigin() != null); /*origin=*/request.getOrigin() != null, request); mPrimaryProviders = primaryProviders; } Loading services/credentials/java/com/android/server/credentials/CredentialManagerUi.java +0 −5 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.os.IBinder; import android.os.Looper; import android.os.ResultReceiver; import android.service.credentials.CredentialProviderInfoFactory; import android.util.Log; import android.util.Slog; import java.util.ArrayList; Loading Loading @@ -72,7 +71,6 @@ public class CredentialManagerUi { }; private void handleUiResult(int resultCode, Bundle resultData) { Log.i("reemademo", "handleUiResult with resultCOde: " + resultCode); switch (resultCode) { case UserSelectionDialogResult.RESULT_CODE_DIALOG_COMPLETE_WITH_SELECTION: Loading @@ -86,13 +84,11 @@ public class CredentialManagerUi { } break; case UserSelectionDialogResult.RESULT_CODE_DIALOG_USER_CANCELED: Log.i("reemademo", "RESULT_CODE_DIALOG_USER_CANCELED"); mStatus = UiStatus.TERMINATED; mCallbacks.onUiCancellation(/* isUserCancellation= */ true); break; case UserSelectionDialogResult.RESULT_CODE_CANCELED_AND_LAUNCHED_SETTINGS: Log.i("reemademo", "RESULT_CODE_CANCELED_AND_LAUNCHED_SETTINGS"); mStatus = UiStatus.TERMINATED; mCallbacks.onUiCancellation(/* isUserCancellation= */ false); Loading @@ -102,7 +98,6 @@ public class CredentialManagerUi { mCallbacks.onUiSelectorInvocationFailure(); break; default: Log.i("reemademo", "Unknown error code returned from the UI"); mStatus = UiStatus.IN_PROGRESS; mCallbacks.onUiSelectorInvocationFailure(); break; Loading services/credentials/java/com/android/server/credentials/GetRequestSession.java +1 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,7 @@ public class GetRequestSession extends RequestSession<GetCredentialRequest, public void onFinalResponseReceived(ComponentName componentName, @Nullable GetCredentialResponse response) { Slog.i(TAG, "onFinalResponseReceived from: " + componentName.flattenToString()); mRequestSessionMetric.collectUiResponseData(/*uiReturned=*/ true, System.nanoTime()); mRequestSessionMetric.updateMetricsOnResponseReceived(mProviders, componentName, isPrimaryProviderViaProviderInfo(componentName)); if (response != null) { Loading services/credentials/java/com/android/server/credentials/MetricUtilities.java +19 −22 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import java.util.Map; /** * For all future metric additions, this will contain their names for local usage after importing * from {@link com.android.internal.util.FrameworkStatsLog}. * TODO(b/271135048) - Emit all atoms, including all V4 atoms (specifically the rest of track 1). */ public class MetricUtilities { private static final boolean LOG_FLAG = true; Loading Loading @@ -101,7 +100,9 @@ public class MetricUtilities { */ protected static int getMetricTimestampDifferenceMicroseconds(long t2, long t1) { if (t2 - t1 > Integer.MAX_VALUE) { throw new ArithmeticException("Input timestamps are too far apart and unsupported"); Slog.i(TAG, "Input timestamps are too far apart and unsupported, " + "falling back to default int"); return DEFAULT_INT_32; } if (t2 < t1) { Slog.i(TAG, "The timestamps aren't in expected order, falling back to default int"); Loading Loading @@ -229,7 +230,7 @@ public class MetricUtilities { authenticationMetric.isAuthReturned() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during candidate get metric logging: " + e); Slog.w(TAG, "Unexpected error during candidate auth metric logging: " + e); } } Loading @@ -252,7 +253,6 @@ public class MetricUtilities { } var sessions = providers.values(); for (var session : sessions) { try { var metric = session.getProviderSessionMetric() .getCandidatePhasePerProviderMetric(); FrameworkStatsLog.write( Loading @@ -265,9 +265,6 @@ public class MetricUtilities { /* per_classtype_counts */ metric.getResponseCollective().getUniqueResponseCounts() ); } catch (Exception e) { Slog.w(TAG, "Unexpected exception during get metric logging" + e); } } } catch (Exception e) { Slog.w(TAG, "Unexpected error during candidate get metric logging: " + e); Loading Loading @@ -399,7 +396,7 @@ public class MetricUtilities { /* caller_uid */ callingUid, /* api_status */ apiStatus.getMetricCode()); } catch (Exception e) { Slog.w(TAG, "Unexpected error during metric logging: " + e); Slog.w(TAG, "Unexpected error during simple v2 metric logging: " + e); } } Loading Loading @@ -505,7 +502,7 @@ public class MetricUtilities { candidateAggregateMetric.isAuthReturned() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during metric logging: " + e); Slog.w(TAG, "Unexpected error during total candidate metric logging: " + e); } } Loading Loading @@ -570,7 +567,7 @@ public class MetricUtilities { /* primary_indicated */ finalPhaseMetric.isPrimary() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during metric logging: " + e); Slog.w(TAG, "Unexpected error during final no uid metric logging: " + e); } } Loading Loading
services/credentials/java/com/android/server/credentials/ClearRequestSession.java +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public final class ClearRequestSession extends RequestSession<ClearCredentialSta public void onFinalResponseReceived( ComponentName componentName, Void response) { mRequestSessionMetric.collectUiResponseData(/*uiReturned=*/ true, System.nanoTime()); mRequestSessionMetric.updateMetricsOnResponseReceived(mProviders, componentName, isPrimaryProviderViaProviderInfo(componentName)); respondToClientWithResponseAndFinish(null); Loading
services/credentials/java/com/android/server/credentials/CreateRequestSession.java +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public final class CreateRequestSession extends RequestSession<CreateCredentialR RequestInfo.TYPE_CREATE, callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); mRequestSessionMetric.collectCreateFlowInitialMetricInfo( /*origin=*/request.getOrigin() != null); /*origin=*/request.getOrigin() != null, request); mPrimaryProviders = primaryProviders; } Loading
services/credentials/java/com/android/server/credentials/CredentialManagerUi.java +0 −5 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.os.IBinder; import android.os.Looper; import android.os.ResultReceiver; import android.service.credentials.CredentialProviderInfoFactory; import android.util.Log; import android.util.Slog; import java.util.ArrayList; Loading Loading @@ -72,7 +71,6 @@ public class CredentialManagerUi { }; private void handleUiResult(int resultCode, Bundle resultData) { Log.i("reemademo", "handleUiResult with resultCOde: " + resultCode); switch (resultCode) { case UserSelectionDialogResult.RESULT_CODE_DIALOG_COMPLETE_WITH_SELECTION: Loading @@ -86,13 +84,11 @@ public class CredentialManagerUi { } break; case UserSelectionDialogResult.RESULT_CODE_DIALOG_USER_CANCELED: Log.i("reemademo", "RESULT_CODE_DIALOG_USER_CANCELED"); mStatus = UiStatus.TERMINATED; mCallbacks.onUiCancellation(/* isUserCancellation= */ true); break; case UserSelectionDialogResult.RESULT_CODE_CANCELED_AND_LAUNCHED_SETTINGS: Log.i("reemademo", "RESULT_CODE_CANCELED_AND_LAUNCHED_SETTINGS"); mStatus = UiStatus.TERMINATED; mCallbacks.onUiCancellation(/* isUserCancellation= */ false); Loading @@ -102,7 +98,6 @@ public class CredentialManagerUi { mCallbacks.onUiSelectorInvocationFailure(); break; default: Log.i("reemademo", "Unknown error code returned from the UI"); mStatus = UiStatus.IN_PROGRESS; mCallbacks.onUiSelectorInvocationFailure(); break; Loading
services/credentials/java/com/android/server/credentials/GetRequestSession.java +1 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,7 @@ public class GetRequestSession extends RequestSession<GetCredentialRequest, public void onFinalResponseReceived(ComponentName componentName, @Nullable GetCredentialResponse response) { Slog.i(TAG, "onFinalResponseReceived from: " + componentName.flattenToString()); mRequestSessionMetric.collectUiResponseData(/*uiReturned=*/ true, System.nanoTime()); mRequestSessionMetric.updateMetricsOnResponseReceived(mProviders, componentName, isPrimaryProviderViaProviderInfo(componentName)); if (response != null) { Loading
services/credentials/java/com/android/server/credentials/MetricUtilities.java +19 −22 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import java.util.Map; /** * For all future metric additions, this will contain their names for local usage after importing * from {@link com.android.internal.util.FrameworkStatsLog}. * TODO(b/271135048) - Emit all atoms, including all V4 atoms (specifically the rest of track 1). */ public class MetricUtilities { private static final boolean LOG_FLAG = true; Loading Loading @@ -101,7 +100,9 @@ public class MetricUtilities { */ protected static int getMetricTimestampDifferenceMicroseconds(long t2, long t1) { if (t2 - t1 > Integer.MAX_VALUE) { throw new ArithmeticException("Input timestamps are too far apart and unsupported"); Slog.i(TAG, "Input timestamps are too far apart and unsupported, " + "falling back to default int"); return DEFAULT_INT_32; } if (t2 < t1) { Slog.i(TAG, "The timestamps aren't in expected order, falling back to default int"); Loading Loading @@ -229,7 +230,7 @@ public class MetricUtilities { authenticationMetric.isAuthReturned() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during candidate get metric logging: " + e); Slog.w(TAG, "Unexpected error during candidate auth metric logging: " + e); } } Loading @@ -252,7 +253,6 @@ public class MetricUtilities { } var sessions = providers.values(); for (var session : sessions) { try { var metric = session.getProviderSessionMetric() .getCandidatePhasePerProviderMetric(); FrameworkStatsLog.write( Loading @@ -265,9 +265,6 @@ public class MetricUtilities { /* per_classtype_counts */ metric.getResponseCollective().getUniqueResponseCounts() ); } catch (Exception e) { Slog.w(TAG, "Unexpected exception during get metric logging" + e); } } } catch (Exception e) { Slog.w(TAG, "Unexpected error during candidate get metric logging: " + e); Loading Loading @@ -399,7 +396,7 @@ public class MetricUtilities { /* caller_uid */ callingUid, /* api_status */ apiStatus.getMetricCode()); } catch (Exception e) { Slog.w(TAG, "Unexpected error during metric logging: " + e); Slog.w(TAG, "Unexpected error during simple v2 metric logging: " + e); } } Loading Loading @@ -505,7 +502,7 @@ public class MetricUtilities { candidateAggregateMetric.isAuthReturned() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during metric logging: " + e); Slog.w(TAG, "Unexpected error during total candidate metric logging: " + e); } } Loading Loading @@ -570,7 +567,7 @@ public class MetricUtilities { /* primary_indicated */ finalPhaseMetric.isPrimary() ); } catch (Exception e) { Slog.w(TAG, "Unexpected error during metric logging: " + e); Slog.w(TAG, "Unexpected error during final no uid metric logging: " + e); } } Loading