VancedMicroG/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java

87 lines
2.7 KiB
Java
Raw Normal View History

/*
2017-06-12 22:11:15 +00:00
* Copyright (C) 2013-2017 microG Project Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.gms.auth.api.credentials;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
/**
* Parameters for requesting a Credential, via Auth.CredentialsApi.request(). Instances can be
* created using CredentialRequest.Builder.
*/
public class CredentialRequest extends AutoSafeParcelable {
2021-04-15 21:35:47 +00:00
@Field(1000)
private int versionCode = 1;
2021-04-15 21:35:47 +00:00
@Field(1)
private boolean passwordLoginSupported;
2021-04-15 21:35:47 +00:00
@Field(2)
private String[] accountTypes;
2021-04-15 21:35:47 +00:00
@Field(3)
private CredentialPickerConfig credentialPickerConfig;
2021-04-15 21:35:47 +00:00
@Field(4)
private CredentialPickerConfig credentialHintPickerConfig;
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;
}
2020-08-31 23:27:05 +00:00
public static final Creator<CredentialRequest> CREATOR = new AutoCreator<>(CredentialRequest.class);
2021-04-15 21:35:47 +00: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();
}
}
}