Loading core/java/android/credentials/GetCandidateCredentialsException.java +11 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,17 @@ public class GetCandidateCredentialsException extends Exception { public static final String TYPE_NO_CREDENTIAL = "android.credentials.GetCandidateCredentialsException.TYPE_NO_CREDENTIAL"; @NonNull public static final String TYPE_USER_CANCELED = "android.credentials.GetCredentialException.TYPE_USER_CANCELED"; /** * The error type value for when the given operation failed due to internal interruption. * Retrying the same operation should fix the error. */ @NonNull public static final String TYPE_INTERRUPTED = "android.credentials.GetCredentialException.TYPE_INTERRUPTED"; @NonNull private final String mType; Loading services/credentials/java/com/android/server/credentials/ClearRequestSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,8 @@ public final class ClearRequestSession extends RequestSession<ClearCredentialSta long startedTimestamp) { super(context, sessionCallback, lock, userId, callingUid, request, callback, RequestInfo.TYPE_UNDEFINED, callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp, /*shouldBindClientToDeath=*/ true); } /** Loading services/credentials/java/com/android/server/credentials/CreateRequestSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,8 @@ public final class CreateRequestSession extends RequestSession<CreateCredentialR long startedTimestamp) { super(context, sessionCallback, lock, userId, callingUid, request, callback, RequestInfo.TYPE_CREATE, callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp, /*shouldBindClientToDeath=*/ true); mRequestSessionMetric.collectCreateFlowInitialMetricInfo( /*origin=*/request.getOrigin() != null, request); mPrimaryProviders = primaryProviders; Loading services/credentials/java/com/android/server/credentials/GetCandidateRequestSession.java +17 −4 Original line number Diff line number Diff line Loading @@ -65,10 +65,13 @@ public class GetCandidateRequestSession extends RequestSession<GetCredentialRequ IAutoFillManagerClient autoFillCallback) { super(context, sessionCallback, lock, userId, callingUid, request, callback, RequestInfo.TYPE_GET, callingAppInfo, enabledProviders, cancellationSignal, 0L); cancellationSignal, 0L, /*shouldBindClientToDeath=*/ false); mAutoFillCallback = autoFillCallback; mAutofillSessionId = request.getData().getInt(SESSION_ID_KEY, -1); mAutofillRequestId = request.getData().getInt(REQUEST_ID_KEY, -1); if (mAutoFillCallback != null) { setUpClientCallbackListener(mAutoFillCallback.asBinder()); } } /** Loading Loading @@ -144,17 +147,27 @@ public class GetCandidateRequestSession extends RequestSession<GetCredentialRequ @Override public void onFinalErrorReceived(ComponentName componentName, String errorType, String message) { // Not applicable for session without UI respondToClientWithErrorAndFinish(errorType, message); } @Override public void onUiCancellation(boolean isUserCancellation) { // Not applicable for session without UI String exception = GetCandidateCredentialsException.TYPE_USER_CANCELED; String message = "User cancelled the selector"; if (!isUserCancellation) { exception = GetCandidateCredentialsException.TYPE_INTERRUPTED; message = "The UI was interrupted - please try again."; } mRequestSessionMetric.collectFrameworkException(exception); respondToClientWithErrorAndFinish(exception, message); } @Override public void onUiSelectorInvocationFailure() { // Not applicable for session without UI String exception = GetCandidateCredentialsException.TYPE_NO_CREDENTIAL; mRequestSessionMetric.collectFrameworkException(exception); respondToClientWithErrorAndFinish(exception, "No credentials available."); } @Override Loading services/credentials/java/com/android/server/credentials/GetRequestSession.java +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class GetRequestSession extends RequestSession<GetCredentialRequest, long startedTimestamp) { super(context, sessionCallback, lock, userId, callingUid, request, callback, getRequestInfoFromRequest(request), callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); cancellationSignal, startedTimestamp, /*shouldBindClientToDeath=*/ true); mRequestSessionMetric.collectGetFlowInitialMetricInfo(request); } Loading Loading
core/java/android/credentials/GetCandidateCredentialsException.java +11 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,17 @@ public class GetCandidateCredentialsException extends Exception { public static final String TYPE_NO_CREDENTIAL = "android.credentials.GetCandidateCredentialsException.TYPE_NO_CREDENTIAL"; @NonNull public static final String TYPE_USER_CANCELED = "android.credentials.GetCredentialException.TYPE_USER_CANCELED"; /** * The error type value for when the given operation failed due to internal interruption. * Retrying the same operation should fix the error. */ @NonNull public static final String TYPE_INTERRUPTED = "android.credentials.GetCredentialException.TYPE_INTERRUPTED"; @NonNull private final String mType; Loading
services/credentials/java/com/android/server/credentials/ClearRequestSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,8 @@ public final class ClearRequestSession extends RequestSession<ClearCredentialSta long startedTimestamp) { super(context, sessionCallback, lock, userId, callingUid, request, callback, RequestInfo.TYPE_UNDEFINED, callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp, /*shouldBindClientToDeath=*/ true); } /** Loading
services/credentials/java/com/android/server/credentials/CreateRequestSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,8 @@ public final class CreateRequestSession extends RequestSession<CreateCredentialR long startedTimestamp) { super(context, sessionCallback, lock, userId, callingUid, request, callback, RequestInfo.TYPE_CREATE, callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp, /*shouldBindClientToDeath=*/ true); mRequestSessionMetric.collectCreateFlowInitialMetricInfo( /*origin=*/request.getOrigin() != null, request); mPrimaryProviders = primaryProviders; Loading
services/credentials/java/com/android/server/credentials/GetCandidateRequestSession.java +17 −4 Original line number Diff line number Diff line Loading @@ -65,10 +65,13 @@ public class GetCandidateRequestSession extends RequestSession<GetCredentialRequ IAutoFillManagerClient autoFillCallback) { super(context, sessionCallback, lock, userId, callingUid, request, callback, RequestInfo.TYPE_GET, callingAppInfo, enabledProviders, cancellationSignal, 0L); cancellationSignal, 0L, /*shouldBindClientToDeath=*/ false); mAutoFillCallback = autoFillCallback; mAutofillSessionId = request.getData().getInt(SESSION_ID_KEY, -1); mAutofillRequestId = request.getData().getInt(REQUEST_ID_KEY, -1); if (mAutoFillCallback != null) { setUpClientCallbackListener(mAutoFillCallback.asBinder()); } } /** Loading Loading @@ -144,17 +147,27 @@ public class GetCandidateRequestSession extends RequestSession<GetCredentialRequ @Override public void onFinalErrorReceived(ComponentName componentName, String errorType, String message) { // Not applicable for session without UI respondToClientWithErrorAndFinish(errorType, message); } @Override public void onUiCancellation(boolean isUserCancellation) { // Not applicable for session without UI String exception = GetCandidateCredentialsException.TYPE_USER_CANCELED; String message = "User cancelled the selector"; if (!isUserCancellation) { exception = GetCandidateCredentialsException.TYPE_INTERRUPTED; message = "The UI was interrupted - please try again."; } mRequestSessionMetric.collectFrameworkException(exception); respondToClientWithErrorAndFinish(exception, message); } @Override public void onUiSelectorInvocationFailure() { // Not applicable for session without UI String exception = GetCandidateCredentialsException.TYPE_NO_CREDENTIAL; mRequestSessionMetric.collectFrameworkException(exception); respondToClientWithErrorAndFinish(exception, "No credentials available."); } @Override Loading
services/credentials/java/com/android/server/credentials/GetRequestSession.java +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class GetRequestSession extends RequestSession<GetCredentialRequest, long startedTimestamp) { super(context, sessionCallback, lock, userId, callingUid, request, callback, getRequestInfoFromRequest(request), callingAppInfo, enabledProviders, cancellationSignal, startedTimestamp); cancellationSignal, startedTimestamp, /*shouldBindClientToDeath=*/ true); mRequestSessionMetric.collectGetFlowInitialMetricInfo(request); } Loading