Loading core/api/current.txt +3 −2 Original line number Diff line number Diff line Loading @@ -13096,9 +13096,10 @@ package android.credentials { } public final class GetCredentialOption implements android.os.Parcelable { ctor public GetCredentialOption(@NonNull String, @NonNull android.os.Bundle, boolean); ctor public GetCredentialOption(@NonNull String, @NonNull android.os.Bundle, @NonNull android.os.Bundle, boolean); method public int describeContents(); method @NonNull public android.os.Bundle getData(); method @NonNull public android.os.Bundle getCandidateQueryData(); method @NonNull public android.os.Bundle getCredentialRetrievalData(); method @NonNull public String getType(); method public boolean requireSystemProvider(); method public void writeToParcel(@NonNull android.os.Parcel, int); core/java/android/credentials/CreateCredentialRequest.java +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public final class CreateCredentialRequest implements Parcelable { private final Bundle mCandidateQueryData; /** * Determines whether or not the request must only be fulfilled by a system provider. * Determines whether the request must only be fulfilled by a system provider. */ private final boolean mRequireSystemProvider; Loading core/java/android/credentials/GetCredentialOption.java +60 −27 Original line number Diff line number Diff line Loading @@ -38,13 +38,20 @@ public final class GetCredentialOption implements Parcelable { private final String mType; /** * The request data. * The full request data. */ @NonNull private final Bundle mData; private final Bundle mCredentialRetrievalData; /** * Determines whether or not the request must only be fulfilled by a system provider. * The partial request data that will be sent to the provider during the initial credential * candidate query stage. */ @NonNull private final Bundle mCandidateQueryData; /** * Determines whether the request must only be fulfilled by a system provider. */ private final boolean mRequireSystemProvider; Loading @@ -57,11 +64,27 @@ public final class GetCredentialOption implements Parcelable { } /** * Returns the request data. * Returns the full request data. */ @NonNull public Bundle getData() { return mData; public Bundle getCredentialRetrievalData() { return mCredentialRetrievalData; } /** * Returns the partial request data that will be sent to the provider during the initial * credential candidate query stage. * * For security reason, a provider will receive the request data in two stages. First it gets * this partial request that do not contain sensitive user information; it uses this * information to provide credential candidates that the [@code CredentialManager] will show to * the user. Next, the full request data, {@link #getCredentialRetrievalData()}, will be sent to * a provider only if the user further grants the consent by choosing a candidate from the * provider. */ @NonNull public Bundle getCandidateQueryData() { return mCandidateQueryData; } /** Loading @@ -75,7 +98,8 @@ public final class GetCredentialOption implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString8(mType); dest.writeBundle(mData); dest.writeBundle(mCredentialRetrievalData); dest.writeBundle(mCandidateQueryData); dest.writeBoolean(mRequireSystemProvider); } Loading @@ -88,7 +112,8 @@ public final class GetCredentialOption implements Parcelable { public String toString() { return "GetCredentialOption {" + "type=" + mType + ", data=" + mData + ", requestData=" + mCredentialRetrievalData + ", candidateQueryData=" + mCandidateQueryData + ", requireSystemProvider=" + mRequireSystemProvider + "}"; } Loading @@ -97,30 +122,38 @@ public final class GetCredentialOption implements Parcelable { * Constructs a {@link GetCredentialOption}. * * @param type the requested credential type * @param data the request data * @param requireSystemProvider whether or not the request must only be fulfilled by a system * @param credentialRetrievalData the request data * @param candidateQueryData the partial request data that will be sent to the provider * during the initial credential candidate query stage * @param requireSystemProvider whether the request must only be fulfilled by a system * provider * * @throws IllegalArgumentException If type is empty. */ public GetCredentialOption( @NonNull String type, @NonNull Bundle data, @NonNull Bundle credentialRetrievalData, @NonNull Bundle candidateQueryData, boolean requireSystemProvider) { mType = Preconditions.checkStringNotEmpty(type, "type must not be empty"); mData = requireNonNull(data, "data must not be null"); mCredentialRetrievalData = requireNonNull(credentialRetrievalData, "requestData must not be null"); mCandidateQueryData = requireNonNull(candidateQueryData, "candidateQueryData must not be null"); mRequireSystemProvider = requireSystemProvider; } private GetCredentialOption(@NonNull Parcel in) { String type = in.readString8(); Bundle data = in.readBundle(); Bundle candidateQueryData = in.readBundle(); boolean requireSystemProvider = in.readBoolean(); mType = type; AnnotationValidations.validate(NonNull.class, null, mType); mData = data; AnnotationValidations.validate(NonNull.class, null, mData); mCredentialRetrievalData = data; AnnotationValidations.validate(NonNull.class, null, mCredentialRetrievalData); mCandidateQueryData = candidateQueryData; AnnotationValidations.validate(NonNull.class, null, mCandidateQueryData); mRequireSystemProvider = requireSystemProvider; } Loading packages/CredentialManager/src/com/android/credentialmanager/CredentialManagerRepo.kt +1 −1 Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ class CredentialManagerRepo( GetCredentialRequest.Builder() .addGetCredentialOption( GetCredentialOption( TYPE_PUBLIC_KEY_CREDENTIAL, Bundle(), /*requireSystemProvider=*/ false) TYPE_PUBLIC_KEY_CREDENTIAL, Bundle(), Bundle(), /*requireSystemProvider=*/ false) ) .build(), /*isFirstUsage=*/false, Loading packages/CredentialManager/src/com/android/credentialmanager/jetpack/developer/GetCredentialOption.kt +13 −7 Original line number Diff line number Diff line Loading @@ -38,14 +38,20 @@ open class GetCredentialOption( return try { when (from.type) { Credential.TYPE_PASSWORD_CREDENTIAL -> GetPasswordOption.createFrom(from.data) GetPasswordOption.createFrom(from.credentialRetrievalData) PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL -> GetPublicKeyCredentialBaseOption.createFrom(from.data) GetPublicKeyCredentialBaseOption.createFrom(from.credentialRetrievalData) else -> GetCredentialOption(from.type, from.data, from.requireSystemProvider()) GetCredentialOption( from.type, from.credentialRetrievalData, from.requireSystemProvider() ) } } catch (e: FrameworkClassParsingException) { GetCredentialOption(from.type, from.data, from.requireSystemProvider()) GetCredentialOption( from.type, from.credentialRetrievalData, from.requireSystemProvider() ) } } } Loading Loading
core/api/current.txt +3 −2 Original line number Diff line number Diff line Loading @@ -13096,9 +13096,10 @@ package android.credentials { } public final class GetCredentialOption implements android.os.Parcelable { ctor public GetCredentialOption(@NonNull String, @NonNull android.os.Bundle, boolean); ctor public GetCredentialOption(@NonNull String, @NonNull android.os.Bundle, @NonNull android.os.Bundle, boolean); method public int describeContents(); method @NonNull public android.os.Bundle getData(); method @NonNull public android.os.Bundle getCandidateQueryData(); method @NonNull public android.os.Bundle getCredentialRetrievalData(); method @NonNull public String getType(); method public boolean requireSystemProvider(); method public void writeToParcel(@NonNull android.os.Parcel, int);
core/java/android/credentials/CreateCredentialRequest.java +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public final class CreateCredentialRequest implements Parcelable { private final Bundle mCandidateQueryData; /** * Determines whether or not the request must only be fulfilled by a system provider. * Determines whether the request must only be fulfilled by a system provider. */ private final boolean mRequireSystemProvider; Loading
core/java/android/credentials/GetCredentialOption.java +60 −27 Original line number Diff line number Diff line Loading @@ -38,13 +38,20 @@ public final class GetCredentialOption implements Parcelable { private final String mType; /** * The request data. * The full request data. */ @NonNull private final Bundle mData; private final Bundle mCredentialRetrievalData; /** * Determines whether or not the request must only be fulfilled by a system provider. * The partial request data that will be sent to the provider during the initial credential * candidate query stage. */ @NonNull private final Bundle mCandidateQueryData; /** * Determines whether the request must only be fulfilled by a system provider. */ private final boolean mRequireSystemProvider; Loading @@ -57,11 +64,27 @@ public final class GetCredentialOption implements Parcelable { } /** * Returns the request data. * Returns the full request data. */ @NonNull public Bundle getData() { return mData; public Bundle getCredentialRetrievalData() { return mCredentialRetrievalData; } /** * Returns the partial request data that will be sent to the provider during the initial * credential candidate query stage. * * For security reason, a provider will receive the request data in two stages. First it gets * this partial request that do not contain sensitive user information; it uses this * information to provide credential candidates that the [@code CredentialManager] will show to * the user. Next, the full request data, {@link #getCredentialRetrievalData()}, will be sent to * a provider only if the user further grants the consent by choosing a candidate from the * provider. */ @NonNull public Bundle getCandidateQueryData() { return mCandidateQueryData; } /** Loading @@ -75,7 +98,8 @@ public final class GetCredentialOption implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString8(mType); dest.writeBundle(mData); dest.writeBundle(mCredentialRetrievalData); dest.writeBundle(mCandidateQueryData); dest.writeBoolean(mRequireSystemProvider); } Loading @@ -88,7 +112,8 @@ public final class GetCredentialOption implements Parcelable { public String toString() { return "GetCredentialOption {" + "type=" + mType + ", data=" + mData + ", requestData=" + mCredentialRetrievalData + ", candidateQueryData=" + mCandidateQueryData + ", requireSystemProvider=" + mRequireSystemProvider + "}"; } Loading @@ -97,30 +122,38 @@ public final class GetCredentialOption implements Parcelable { * Constructs a {@link GetCredentialOption}. * * @param type the requested credential type * @param data the request data * @param requireSystemProvider whether or not the request must only be fulfilled by a system * @param credentialRetrievalData the request data * @param candidateQueryData the partial request data that will be sent to the provider * during the initial credential candidate query stage * @param requireSystemProvider whether the request must only be fulfilled by a system * provider * * @throws IllegalArgumentException If type is empty. */ public GetCredentialOption( @NonNull String type, @NonNull Bundle data, @NonNull Bundle credentialRetrievalData, @NonNull Bundle candidateQueryData, boolean requireSystemProvider) { mType = Preconditions.checkStringNotEmpty(type, "type must not be empty"); mData = requireNonNull(data, "data must not be null"); mCredentialRetrievalData = requireNonNull(credentialRetrievalData, "requestData must not be null"); mCandidateQueryData = requireNonNull(candidateQueryData, "candidateQueryData must not be null"); mRequireSystemProvider = requireSystemProvider; } private GetCredentialOption(@NonNull Parcel in) { String type = in.readString8(); Bundle data = in.readBundle(); Bundle candidateQueryData = in.readBundle(); boolean requireSystemProvider = in.readBoolean(); mType = type; AnnotationValidations.validate(NonNull.class, null, mType); mData = data; AnnotationValidations.validate(NonNull.class, null, mData); mCredentialRetrievalData = data; AnnotationValidations.validate(NonNull.class, null, mCredentialRetrievalData); mCandidateQueryData = candidateQueryData; AnnotationValidations.validate(NonNull.class, null, mCandidateQueryData); mRequireSystemProvider = requireSystemProvider; } Loading
packages/CredentialManager/src/com/android/credentialmanager/CredentialManagerRepo.kt +1 −1 Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ class CredentialManagerRepo( GetCredentialRequest.Builder() .addGetCredentialOption( GetCredentialOption( TYPE_PUBLIC_KEY_CREDENTIAL, Bundle(), /*requireSystemProvider=*/ false) TYPE_PUBLIC_KEY_CREDENTIAL, Bundle(), Bundle(), /*requireSystemProvider=*/ false) ) .build(), /*isFirstUsage=*/false, Loading
packages/CredentialManager/src/com/android/credentialmanager/jetpack/developer/GetCredentialOption.kt +13 −7 Original line number Diff line number Diff line Loading @@ -38,14 +38,20 @@ open class GetCredentialOption( return try { when (from.type) { Credential.TYPE_PASSWORD_CREDENTIAL -> GetPasswordOption.createFrom(from.data) GetPasswordOption.createFrom(from.credentialRetrievalData) PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL -> GetPublicKeyCredentialBaseOption.createFrom(from.data) GetPublicKeyCredentialBaseOption.createFrom(from.credentialRetrievalData) else -> GetCredentialOption(from.type, from.data, from.requireSystemProvider()) GetCredentialOption( from.type, from.credentialRetrievalData, from.requireSystemProvider() ) } } catch (e: FrameworkClassParsingException) { GetCredentialOption(from.type, from.data, from.requireSystemProvider()) GetCredentialOption( from.type, from.credentialRetrievalData, from.requireSystemProvider() ) } } } Loading