Merge "Address API council review feedback"

This commit is contained in:
Reema Bajwa
2023-02-14 21:30:40 +00:00
committed by Android (Google) Code Review
5 changed files with 20 additions and 28 deletions

View File

@@ -13615,7 +13615,6 @@ package android.credentials {
public final class CreateCredentialRequest implements android.os.Parcelable {
ctor public CreateCredentialRequest(@NonNull String, @NonNull android.os.Bundle, @NonNull android.os.Bundle, boolean, boolean);
ctor public CreateCredentialRequest(@NonNull String, @NonNull android.os.Bundle, @NonNull android.os.Bundle, boolean);
method public boolean alwaysSendAppInfoToProvider();
method public int describeContents();
method @NonNull public android.os.Bundle getCandidateQueryData();

View File

@@ -182,27 +182,6 @@ public final class CreateCredentialRequest implements Parcelable {
mAlwaysSendAppInfoToProvider = alwaysSendAppInfoToProvider;
}
/**
* Constructs a {@link CreateCredentialRequest}.
*
* @param type the requested credential type
* @param credentialData the full credential creation request data
* @param candidateQueryData the partial request data that will be sent to the provider
* during the initial creation candidate query stage
* @param isSystemProviderRequired whether the request must only be fulfilled by a system
* provider
*
* @throws IllegalArgumentException If type is empty.
*/
public CreateCredentialRequest(
@NonNull String type,
@NonNull Bundle credentialData,
@NonNull Bundle candidateQueryData,
boolean isSystemProviderRequired) {
this(type, credentialData, candidateQueryData, isSystemProviderRequired,
/*mAlwaysSendAppInfoToProvider=*/true);
}
private CreateCredentialRequest(@NonNull Parcel in) {
String type = in.readString8();
Bundle credentialData = in.readBundle();

View File

@@ -100,7 +100,13 @@ public class BeginCreateCredentialRequest implements Parcelable {
dest.writeBundle(mData);
}
/** Returns the info pertaining to the calling app. */
/**
* Returns the info pertaining to the calling app.
*
* This value can be null when this instance is set on a {@link BeginGetCredentialRequest} or
* a {@link BeginCreateCredentialRequest} if the caller of the API does not wish to propagate
* this information to a credential provider.
*/
@Nullable
public CallingAppInfo getCallingAppInfo() {
return mCallingAppInfo;

View File

@@ -21,6 +21,10 @@ import android.content.pm.SigningInfo;
import android.os.Parcel;
import android.os.Parcelable;
import com.android.internal.util.Preconditions;
import java.util.Objects;
/**
* Information pertaining to the calling application, including the package name and a list of
* app signatures.
@@ -37,8 +41,9 @@ public final class CallingAppInfo implements Parcelable {
*/
public CallingAppInfo(@NonNull String packageName,
@NonNull SigningInfo signingInfo) {
mPackageName = packageName;
mSigningInfo = signingInfo;
mPackageName = Preconditions.checkStringNotEmpty(packageName, "package name"
+ "must not be null or empty");
mSigningInfo = Objects.requireNonNull(signingInfo);
}
private CallingAppInfo(@NonNull Parcel in) {

View File

@@ -407,7 +407,8 @@ class CredentialManagerRepo(
"androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL",
credentialData,
/*candidateQueryData=*/ Bundle(),
/*isSystemProviderRequired=*/ false
/*isSystemProviderRequired=*/ false,
/*alwaysSendAppInfoToProvider=*/ true
),
"com.google.android.youtube"
)
@@ -421,7 +422,8 @@ class CredentialManagerRepo(
TYPE_PASSWORD_CREDENTIAL,
request.credentialData,
request.candidateQueryData,
/*isSystemProviderRequired=*/ false
/*isSystemProviderRequired=*/ false,
/*alwaysSendAppInfoToProvider=*/ true
),
"com.google.android.youtube"
)
@@ -440,7 +442,8 @@ class CredentialManagerRepo(
"other-sign-ins",
data,
/*candidateQueryData=*/ Bundle(),
/*isSystemProviderRequired=*/ false
/*isSystemProviderRequired=*/ false,
/*alwaysSendAppInfoToProvider=*/ true
),
"com.google.android.youtube"
)