2016-08-27 12:28:00 +02:00
|
|
|
/*
|
2021-05-14 01:59:12 +02:00
|
|
|
* SPDX-FileCopyrightText: 2016, microG Project Team
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
|
|
|
* according to terms described in the Creative Commons 4.0 Attribution License.
|
|
|
|
* See https://developers.google.com/readme/policies for details.
|
2016-08-27 12:28:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
package com.google.android.gms.auth.api.credentials;
|
|
|
|
|
|
|
|
import org.microg.safeparcel.AutoSafeParcelable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parameters for requesting a Credential, via Auth.CredentialsApi.request(). Instances can be
|
|
|
|
* created using CredentialRequest.Builder.
|
|
|
|
*/
|
|
|
|
public class CredentialRequest extends AutoSafeParcelable {
|
|
|
|
|
2021-04-15 23:35:47 +02:00
|
|
|
@Field(1000)
|
2016-08-27 12:28:00 +02:00
|
|
|
private int versionCode = 1;
|
|
|
|
|
2021-04-15 23:35:47 +02:00
|
|
|
@Field(1)
|
2016-08-27 12:28:00 +02:00
|
|
|
private boolean passwordLoginSupported;
|
2021-04-15 23:35:47 +02:00
|
|
|
@Field(2)
|
2016-08-27 12:28:00 +02:00
|
|
|
private String[] accountTypes;
|
2021-04-15 23:35:47 +02:00
|
|
|
@Field(3)
|
2016-08-27 12:28:00 +02:00
|
|
|
private CredentialPickerConfig credentialPickerConfig;
|
2021-04-15 23:35:47 +02:00
|
|
|
@Field(4)
|
2016-08-27 12:28:00 +02:00
|
|
|
private CredentialPickerConfig credentialHintPickerConfig;
|
|
|
|
|
2021-06-27 21:53:47 +02:00
|
|
|
private CredentialRequest() { }
|
|
|
|
|
2016-08-27 12:28:00 +02:00
|
|
|
public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) {
|
|
|
|
this.passwordLoginSupported = passwordLoginSupported;
|
|
|
|
this.accountTypes = accountTypes;
|
|
|
|
this.credentialPickerConfig = credentialPickerConfig;
|
|
|
|
this.credentialHintPickerConfig = credentialHintPickerConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String[] getAccountTypes() {
|
|
|
|
return accountTypes;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CredentialPickerConfig getCredentialHintPickerConfig() {
|
|
|
|
return credentialHintPickerConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CredentialPickerConfig getCredentialPickerConfig() {
|
|
|
|
return credentialPickerConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated Use {@link #isPasswordLoginSupported()}
|
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
public boolean getSupportsPasswordLogin() {
|
|
|
|
return isPasswordLoginSupported();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isPasswordLoginSupported() {
|
|
|
|
return passwordLoginSupported;
|
|
|
|
}
|
|
|
|
|
2022-01-26 06:26:56 +01:00
|
|
|
public static final Creator<CredentialRequest> CREATOR = new AutoCreator<CredentialRequest>(CredentialRequest.class);
|
2021-04-15 23:35:47 +02:00
|
|
|
|
|
|
|
public static class Builder {
|
|
|
|
private boolean passwordLoginSupported;
|
|
|
|
private String[] accountTypes;
|
|
|
|
private CredentialPickerConfig credentialPickerConfig;
|
|
|
|
private CredentialPickerConfig credentialHintPickerConfig;
|
|
|
|
|
|
|
|
public void setAccountTypes(String... accountTypes) {
|
|
|
|
this.accountTypes = accountTypes.clone();
|
|
|
|
}
|
|
|
|
}
|
2016-08-27 12:28:00 +02:00
|
|
|
}
|