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

Commit e765ec8b authored by Helen Qin's avatar Helen Qin Committed by Automerger Merge Worker
Browse files

Merge "Switch the activity parameter to context." into udc-dev am: 4b3d41dc

parents 517db145 4b3d41dc
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -13655,9 +13655,9 @@ package android.credentials {
  public final class CredentialManager {
  public final class CredentialManager {
    method public void clearCredentialState(@NonNull android.credentials.ClearCredentialStateRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.credentials.ClearCredentialStateException>);
    method public void clearCredentialState(@NonNull android.credentials.ClearCredentialStateRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.credentials.ClearCredentialStateException>);
    method public void createCredential(@NonNull android.credentials.CreateCredentialRequest, @NonNull android.app.Activity, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.CreateCredentialResponse,android.credentials.CreateCredentialException>);
    method public void createCredential(@NonNull android.content.Context, @NonNull android.credentials.CreateCredentialRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.CreateCredentialResponse,android.credentials.CreateCredentialException>);
    method public void getCredential(@NonNull android.credentials.GetCredentialRequest, @NonNull android.app.Activity, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public void getCredential(@NonNull android.content.Context, @NonNull android.credentials.GetCredentialRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public void getCredential(@NonNull android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle, @NonNull android.app.Activity, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public void getCredential(@NonNull android.content.Context, @NonNull android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public boolean isEnabledCredentialProviderService(@NonNull android.content.ComponentName);
    method public boolean isEnabledCredentialProviderService(@NonNull android.content.ComponentName);
    method public void prepareGetCredential(@NonNull android.credentials.GetCredentialRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.PrepareGetCredentialResponse,android.credentials.GetCredentialException>);
    method public void prepareGetCredential(@NonNull android.credentials.GetCredentialRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.credentials.PrepareGetCredentialResponse,android.credentials.GetCredentialException>);
    method public void registerCredentialDescription(@NonNull android.credentials.RegisterCredentialDescriptionRequest);
    method public void registerCredentialDescription(@NonNull android.credentials.RegisterCredentialDescriptionRequest);
+127 −47
Original line number Original line Diff line number Diff line
@@ -25,11 +25,11 @@ import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.RequiresPermission;
import android.annotation.SystemService;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.TestApi;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Context;
import android.content.Context;
import android.content.IntentSender;
import android.content.IntentSender;
import android.os.Binder;
import android.os.CancellationSignal;
import android.os.CancellationSignal;
import android.os.ICancellationSignal;
import android.os.ICancellationSignal;
import android.os.OutcomeReceiver;
import android.os.OutcomeReceiver;
@@ -126,20 +126,21 @@ public final class CredentialManager {
     * need additional permission {@link CREDENTIAL_MANAGER_SET_ORIGIN}
     * need additional permission {@link CREDENTIAL_MANAGER_SET_ORIGIN}
     * to use this functionality
     * to use this functionality
     *
     *
     * @param context the context used to launch any UI needed; use an activity context to make sure
     *                the UI will be launched within the same task stack
     * @param request the request specifying type(s) of credentials to get from the user
     * @param request the request specifying type(s) of credentials to get from the user
     * @param activity the activity used to launch any UI needed
     * @param cancellationSignal an optional signal that allows for cancelling this call
     * @param cancellationSignal an optional signal that allows for cancelling this call
     * @param executor the callback will take place on this {@link Executor}
     * @param executor the callback will take place on this {@link Executor}
     * @param callback the callback invoked when the request succeeds or fails
     * @param callback the callback invoked when the request succeeds or fails
     */
     */
    public void getCredential(
    public void getCredential(
            @NonNull Context context,
            @NonNull GetCredentialRequest request,
            @NonNull GetCredentialRequest request,
            @NonNull Activity activity,
            @Nullable CancellationSignal cancellationSignal,
            @Nullable CancellationSignal cancellationSignal,
            @CallbackExecutor @NonNull Executor executor,
            @CallbackExecutor @NonNull Executor executor,
            @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
            @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
        requireNonNull(request, "request must not be null");
        requireNonNull(request, "request must not be null");
        requireNonNull(activity, "activity must not be null");
        requireNonNull(context, "context must not be null");
        requireNonNull(executor, "executor must not be null");
        requireNonNull(executor, "executor must not be null");
        requireNonNull(callback, "callback must not be null");
        requireNonNull(callback, "callback must not be null");


@@ -153,7 +154,7 @@ public final class CredentialManager {
            cancelRemote =
            cancelRemote =
                    mService.executeGetCredential(
                    mService.executeGetCredential(
                            request,
                            request,
                            new GetCredentialTransport(activity, executor, callback),
                            new GetCredentialTransport(context, executor, callback),
                            mContext.getOpPackageName());
                            mContext.getOpPackageName());
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            e.rethrowFromSystemServer();
@@ -175,21 +176,22 @@ public final class CredentialManager {
     * request through the {@link #prepareGetCredential(
     * request through the {@link #prepareGetCredential(
     * GetCredentialRequest, CancellationSignal, Executor, OutcomeReceiver)} API.
     * GetCredentialRequest, CancellationSignal, Executor, OutcomeReceiver)} API.
     *
     *
     * @param context the context used to launch any UI needed; use an activity context to make sure
     *                the UI will be launched within the same task stack
     * @param pendingGetCredentialHandle the handle representing the pending operation to resume
     * @param pendingGetCredentialHandle the handle representing the pending operation to resume
     * @param activity the activity used to launch any UI needed
     * @param cancellationSignal an optional signal that allows for cancelling this call
     * @param cancellationSignal an optional signal that allows for cancelling this call
     * @param executor the callback will take place on this {@link Executor}
     * @param executor the callback will take place on this {@link Executor}
     * @param callback the callback invoked when the request succeeds or fails
     * @param callback the callback invoked when the request succeeds or fails
     */
     */
    public void getCredential(
    public void getCredential(
            @NonNull Context context,
            @NonNull PrepareGetCredentialResponse.PendingGetCredentialHandle
            @NonNull PrepareGetCredentialResponse.PendingGetCredentialHandle
            pendingGetCredentialHandle,
            pendingGetCredentialHandle,
            @NonNull Activity activity,
            @Nullable CancellationSignal cancellationSignal,
            @Nullable CancellationSignal cancellationSignal,
            @CallbackExecutor @NonNull Executor executor,
            @CallbackExecutor @NonNull Executor executor,
            @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
            @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
        requireNonNull(pendingGetCredentialHandle, "pendingGetCredentialHandle must not be null");
        requireNonNull(pendingGetCredentialHandle, "pendingGetCredentialHandle must not be null");
        requireNonNull(activity, "activity must not be null");
        requireNonNull(context, "context must not be null");
        requireNonNull(executor, "executor must not be null");
        requireNonNull(executor, "executor must not be null");
        requireNonNull(callback, "callback must not be null");
        requireNonNull(callback, "callback must not be null");


@@ -198,7 +200,7 @@ public final class CredentialManager {
            return;
            return;
        }
        }


        pendingGetCredentialHandle.show(activity, cancellationSignal, executor, callback);
        pendingGetCredentialHandle.show(context, cancellationSignal, executor, callback);
    }
    }


    /**
    /**
@@ -207,9 +209,9 @@ public final class CredentialManager {
     *
     *
     * <p>This API doesn't invoke any UI. It only performs the preparation work so that you can
     * <p>This API doesn't invoke any UI. It only performs the preparation work so that you can
     * later launch the remaining get-credential operation (involves UIs) through the {@link
     * later launch the remaining get-credential operation (involves UIs) through the {@link
     * #getCredential(PrepareGetCredentialResponse.PendingGetCredentialHandle, Activity,
     * #getCredential(PrepareGetCredentialResponse.PendingGetCredentialHandle, Context,
     * CancellationSignal, Executor, OutcomeReceiver)} API which incurs less latency compared to
     * CancellationSignal, Executor, OutcomeReceiver)} API which incurs less latency compared to
     * the {@link #getCredential(GetCredentialRequest, Activity, CancellationSignal, Executor,
     * the {@link #getCredential(GetCredentialRequest, Context, CancellationSignal, Executor,
     * OutcomeReceiver)} API that executes the whole operation in one call.
     * OutcomeReceiver)} API that executes the whole operation in one call.
     *
     *
     * @param request            the request specifying type(s) of credentials to get from the user
     * @param request            the request specifying type(s) of credentials to get from the user
@@ -262,21 +264,22 @@ public final class CredentialManager {
     * need additional permission {@link CREDENTIAL_MANAGER_SET_ORIGIN}
     * need additional permission {@link CREDENTIAL_MANAGER_SET_ORIGIN}
     * to use this functionality
     * to use this functionality
     *
     *
     * @param context the context used to launch any UI needed; use an activity context to make sure
     *                the UI will be launched within the same task stack
     * @param request the request specifying type(s) of credentials to get from the user
     * @param request the request specifying type(s) of credentials to get from the user
     * @param activity the activity used to launch any UI needed
     * @param cancellationSignal an optional signal that allows for cancelling this call
     * @param cancellationSignal an optional signal that allows for cancelling this call
     * @param executor the callback will take place on this {@link Executor}
     * @param executor the callback will take place on this {@link Executor}
     * @param callback the callback invoked when the request succeeds or fails
     * @param callback the callback invoked when the request succeeds or fails
     */
     */
    public void createCredential(
    public void createCredential(
            @NonNull Context context,
            @NonNull CreateCredentialRequest request,
            @NonNull CreateCredentialRequest request,
            @NonNull Activity activity,
            @Nullable CancellationSignal cancellationSignal,
            @Nullable CancellationSignal cancellationSignal,
            @CallbackExecutor @NonNull Executor executor,
            @CallbackExecutor @NonNull Executor executor,
            @NonNull
            @NonNull
                    OutcomeReceiver<CreateCredentialResponse, CreateCredentialException> callback) {
                    OutcomeReceiver<CreateCredentialResponse, CreateCredentialException> callback) {
        requireNonNull(request, "request must not be null");
        requireNonNull(request, "request must not be null");
        requireNonNull(activity, "activity must not be null");
        requireNonNull(context, "context must not be null");
        requireNonNull(executor, "executor must not be null");
        requireNonNull(executor, "executor must not be null");
        requireNonNull(callback, "callback must not be null");
        requireNonNull(callback, "callback must not be null");


@@ -290,7 +293,7 @@ public final class CredentialManager {
            cancelRemote =
            cancelRemote =
                    mService.executeCreateCredential(
                    mService.executeCreateCredential(
                            request,
                            request,
                            new CreateCredentialTransport(activity, executor, callback),
                            new CreateCredentialTransport(context, executor, callback),
                            mContext.getOpPackageName());
                            mContext.getOpPackageName());
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
            e.rethrowFromSystemServer();
@@ -547,14 +550,24 @@ public final class CredentialManager {


        @Override
        @Override
        public void onResponse(PrepareGetCredentialResponseInternal response) {
        public void onResponse(PrepareGetCredentialResponseInternal response) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallback.onResult(
                mExecutor.execute(() -> mCallback.onResult(
                        new PrepareGetCredentialResponse(response, mGetCredentialTransport)));
                        new PrepareGetCredentialResponse(response, mGetCredentialTransport)));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }


        @Override
        @Override
        public void onError(String errorType, String message) {
        public void onError(String errorType, String message) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(
                mExecutor.execute(
                        () -> mCallback.onError(new GetCredentialException(errorType, message)));
                        () -> mCallback.onError(new GetCredentialException(errorType, message)));
            }  finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }
    }
    }


@@ -587,7 +600,12 @@ public final class CredentialManager {
        @Override
        @Override
        public void onResponse(GetCredentialResponse response) {
        public void onResponse(GetCredentialResponse response) {
            if (mCallback != null) {
            if (mCallback != null) {
                final long identity = Binder.clearCallingIdentity();
                try {
                    mCallback.onResponse(response);
                    mCallback.onResponse(response);
                } finally {
                    Binder.restoreCallingIdentity(identity);
                }
            } else {
            } else {
                Log.d(TAG, "Unexpected onResponse call before the show invocation");
                Log.d(TAG, "Unexpected onResponse call before the show invocation");
            }
            }
@@ -596,7 +614,12 @@ public final class CredentialManager {
        @Override
        @Override
        public void onError(String errorType, String message) {
        public void onError(String errorType, String message) {
            if (mCallback != null) {
            if (mCallback != null) {
                final long identity = Binder.clearCallingIdentity();
                try {
                    mCallback.onError(errorType, message);
                    mCallback.onError(errorType, message);
                } finally {
                    Binder.restoreCallingIdentity(identity);
                }
            } else {
            } else {
                Log.d(TAG, "Unexpected onError call before the show invocation");
                Log.d(TAG, "Unexpected onError call before the show invocation");
            }
            }
@@ -606,15 +629,15 @@ public final class CredentialManager {
    private static class GetCredentialTransport extends IGetCredentialCallback.Stub {
    private static class GetCredentialTransport extends IGetCredentialCallback.Stub {
        // TODO: listen for cancellation to release callback.
        // TODO: listen for cancellation to release callback.


        private final Activity mActivity;
        private final Context mContext;
        private final Executor mExecutor;
        private final Executor mExecutor;
        private final OutcomeReceiver<GetCredentialResponse, GetCredentialException> mCallback;
        private final OutcomeReceiver<GetCredentialResponse, GetCredentialException> mCallback;


        private GetCredentialTransport(
        private GetCredentialTransport(
                Activity activity,
                Context context,
                Executor executor,
                Executor executor,
                OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
                OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
            mActivity = activity;
            mContext = context;
            mExecutor = executor;
            mExecutor = executor;
            mCallback = callback;
            mCallback = callback;
        }
        }
@@ -622,42 +645,57 @@ public final class CredentialManager {
        @Override
        @Override
        public void onPendingIntent(PendingIntent pendingIntent) {
        public void onPendingIntent(PendingIntent pendingIntent) {
            try {
            try {
                mActivity.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
                mContext.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
            } catch (IntentSender.SendIntentException e) {
            } catch (IntentSender.SendIntentException e) {
                Log.e(
                Log.e(
                        TAG,
                        TAG,
                        "startIntentSender() failed for intent:" + pendingIntent.getIntentSender(),
                        "startIntentSender() failed for intent:" + pendingIntent.getIntentSender(),
                        e);
                        e);
                final long identity = Binder.clearCallingIdentity();
                try {
                    mExecutor.execute(() -> mCallback.onError(
                    mExecutor.execute(() -> mCallback.onError(
                            new GetCredentialException(GetCredentialException.TYPE_UNKNOWN)));
                            new GetCredentialException(GetCredentialException.TYPE_UNKNOWN)));
                } finally {
                    Binder.restoreCallingIdentity(identity);
                }
            }
            }
        }
        }


        @Override
        @Override
        public void onResponse(GetCredentialResponse response) {
        public void onResponse(GetCredentialResponse response) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallback.onResult(response));
                mExecutor.execute(() -> mCallback.onResult(response));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }


        @Override
        @Override
        public void onError(String errorType, String message) {
        public void onError(String errorType, String message) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(
                mExecutor.execute(
                        () -> mCallback.onError(new GetCredentialException(errorType, message)));
                        () -> mCallback.onError(new GetCredentialException(errorType, message)));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }
    }
    }


    private static class CreateCredentialTransport extends ICreateCredentialCallback.Stub {
    private static class CreateCredentialTransport extends ICreateCredentialCallback.Stub {
        // TODO: listen for cancellation to release callback.
        // TODO: listen for cancellation to release callback.


        private final Activity mActivity;
        private final Context mContext;
        private final Executor mExecutor;
        private final Executor mExecutor;
        private final OutcomeReceiver<CreateCredentialResponse, CreateCredentialException>
        private final OutcomeReceiver<CreateCredentialResponse, CreateCredentialException>
                mCallback;
                mCallback;


        private CreateCredentialTransport(
        private CreateCredentialTransport(
                Activity activity,
                Context context,
                Executor executor,
                Executor executor,
                OutcomeReceiver<CreateCredentialResponse, CreateCredentialException> callback) {
                OutcomeReceiver<CreateCredentialResponse, CreateCredentialException> callback) {
            mActivity = activity;
            mContext = context;
            mExecutor = executor;
            mExecutor = executor;
            mCallback = callback;
            mCallback = callback;
        }
        }
@@ -665,26 +703,41 @@ public final class CredentialManager {
        @Override
        @Override
        public void onPendingIntent(PendingIntent pendingIntent) {
        public void onPendingIntent(PendingIntent pendingIntent) {
            try {
            try {
                mActivity.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
                mContext.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
            } catch (IntentSender.SendIntentException e) {
            } catch (IntentSender.SendIntentException e) {
                Log.e(
                Log.e(
                        TAG,
                        TAG,
                        "startIntentSender() failed for intent:" + pendingIntent.getIntentSender(),
                        "startIntentSender() failed for intent:" + pendingIntent.getIntentSender(),
                        e);
                        e);
                final long identity = Binder.clearCallingIdentity();
                try {
                    mExecutor.execute(() -> mCallback.onError(
                    mExecutor.execute(() -> mCallback.onError(
                            new CreateCredentialException(CreateCredentialException.TYPE_UNKNOWN)));
                            new CreateCredentialException(CreateCredentialException.TYPE_UNKNOWN)));
                } finally {
                    Binder.restoreCallingIdentity(identity);
                }
            }
            }
        }
        }


        @Override
        @Override
        public void onResponse(CreateCredentialResponse response) {
        public void onResponse(CreateCredentialResponse response) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallback.onResult(response));
                mExecutor.execute(() -> mCallback.onResult(response));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }


        @Override
        @Override
        public void onError(String errorType, String message) {
        public void onError(String errorType, String message) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(
                mExecutor.execute(
                        () -> mCallback.onError(new CreateCredentialException(errorType, message)));
                        () -> mCallback.onError(new CreateCredentialException(errorType, message)));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }
    }
    }


@@ -702,13 +755,24 @@ public final class CredentialManager {


        @Override
        @Override
        public void onSuccess() {
        public void onSuccess() {
            final long identity = Binder.clearCallingIdentity();
            try {
                mCallback.onResult(null);
                mCallback.onResult(null);
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }


        @Override
        @Override
        public void onError(String errorType, String message) {
        public void onError(String errorType, String message) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(
                mExecutor.execute(
                    () -> mCallback.onError(new ClearCredentialStateException(errorType, message)));
                        () -> mCallback.onError(
                                new ClearCredentialStateException(errorType, message)));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }
    }
    }


@@ -725,18 +789,34 @@ public final class CredentialManager {
        }
        }


        public void onResponse(Void result) {
        public void onResponse(Void result) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallback.onResult(result));
                mExecutor.execute(() -> mCallback.onResult(result));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }


        @Override
        @Override
        public void onResponse() {
        public void onResponse() {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallback.onResult(null));
                mExecutor.execute(() -> mCallback.onResult(null));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }


        @Override
        @Override
        public void onError(String errorType, String message) {
        public void onError(String errorType, String message) {
            final long identity = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(
                mExecutor.execute(
                    () -> mCallback.onError(new SetEnabledProvidersException(errorType, message)));
                        () -> mCallback.onError(
                                new SetEnabledProvidersException(errorType, message)));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
        }
    }
    }
}
}
+4 −3
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.RequiresPermission;
import android.app.Activity;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.content.Context;
import android.content.IntentSender;
import android.content.IntentSender;
import android.os.CancellationSignal;
import android.os.CancellationSignal;
import android.os.OutcomeReceiver;
import android.os.OutcomeReceiver;
@@ -67,7 +68,7 @@ public final class PrepareGetCredentialResponse {
        }
        }


        /** @hide */
        /** @hide */
        void show(@NonNull Activity activity, @Nullable CancellationSignal cancellationSignal,
        void show(@NonNull Context context, @Nullable CancellationSignal cancellationSignal,
                @CallbackExecutor @NonNull Executor executor,
                @CallbackExecutor @NonNull Executor executor,
                @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
                @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
            if (mPendingIntent == null) {
            if (mPendingIntent == null) {
@@ -80,7 +81,7 @@ public final class PrepareGetCredentialResponse {
                @Override
                @Override
                public void onPendingIntent(PendingIntent pendingIntent) {
                public void onPendingIntent(PendingIntent pendingIntent) {
                    try {
                    try {
                        activity.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
                        context.startIntentSender(pendingIntent.getIntentSender(), null, 0, 0, 0);
                    } catch (IntentSender.SendIntentException e) {
                    } catch (IntentSender.SendIntentException e) {
                        Log.e(TAG, "startIntentSender() failed for intent for show()", e);
                        Log.e(TAG, "startIntentSender() failed for intent for show()", e);
                        executor.execute(() -> callback.onError(
                        executor.execute(() -> callback.onError(
@@ -101,7 +102,7 @@ public final class PrepareGetCredentialResponse {
            });
            });


            try {
            try {
                activity.startIntentSender(mPendingIntent.getIntentSender(), null, 0, 0, 0);
                context.startIntentSender(mPendingIntent.getIntentSender(), null, 0, 0, 0);
            } catch (IntentSender.SendIntentException e) {
            } catch (IntentSender.SendIntentException e) {
                Log.e(TAG, "startIntentSender() failed for intent for show()", e);
                Log.e(TAG, "startIntentSender() failed for intent for show()", e);
                executor.execute(() -> callback.onError(
                executor.execute(() -> callback.onError(
+16 −16

File changed.

Preview size limit exceeded, changes collapsed.