mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-09-05 05:56:24 +02:00
Update Gradle, Add initial Credential API files
This commit is contained in:
parent
e057a9daae
commit
c6f5d25850
38
build.gradle
Normal file
38
build.gradle
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.3'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
ext.androidBuildVersionTools = "23.0.3"
|
||||
}
|
||||
|
||||
def androidCompileSdk() { return 23 }
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
}
|
2
extern/SafeParcel
vendored
2
extern/SafeParcel
vendored
@ -1 +1 @@
|
||||
Subproject commit 6e2e63bdf0016b094b41f66b15accb4915cf7561
|
||||
Subproject commit 7e7fcee20047116b87406ae0e1296489a46bac73
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
||||
|
@ -14,15 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
String getMyVersionName() {
|
||||
@ -38,8 +29,8 @@ group = 'org.microg'
|
||||
version = getMyVersionName()
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.3"
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName getMyVersionName()
|
||||
|
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.auth.api.credentials;
|
||||
|
||||
parcelable Credential;
|
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.auth.api.credentials;
|
||||
|
||||
parcelable CredentialRequest;
|
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.auth.api.credentials.internal;
|
||||
|
||||
parcelable DeleteRequest;
|
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.auth.api.credentials.internal;
|
||||
|
||||
parcelable GeneratePasswordRequest;
|
@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.auth.api.credentials.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.auth.api.credentials.Credential;
|
||||
|
||||
interface ICredentialsCallbacks {
|
||||
void onStatusAndCredential(in Status status, in Credential credential) = 0;
|
||||
void onStatus(in Status status) = 1;
|
||||
void onStatusAndString(in Status status, String string) = 2;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.google.android.gms.auth.api.credentials.internal;
|
||||
|
||||
import com.google.android.gms.auth.api.credentials.CredentialRequest;
|
||||
import com.google.android.gms.auth.api.credentials.internal.ICredentialsCallbacks;
|
||||
import com.google.android.gms.auth.api.credentials.internal.DeleteRequest;
|
||||
import com.google.android.gms.auth.api.credentials.internal.GeneratePasswordRequest;
|
||||
import com.google.android.gms.auth.api.credentials.internal.SaveRequest;
|
||||
|
||||
interface ICredentialsService {
|
||||
void request(ICredentialsCallbacks callbacks, in CredentialRequest request) = 0;
|
||||
void save(ICredentialsCallbacks callbacks, in SaveRequest request) = 1;
|
||||
void delete(ICredentialsCallbacks callbacks, in DeleteRequest request) = 2;
|
||||
void disableAutoSignIn(ICredentialsCallbacks callbacks) = 3;
|
||||
void generatePassword(ICredentialsCallbacks callbacks, in GeneratePasswordRequest request) = 4;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.auth.api.credentials.internal;
|
||||
|
||||
parcelable SaveRequest;
|
@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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 android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.microg.gms.common.PublicApi;
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@PublicApi
|
||||
public class Credential extends AutoSafeParcelable {
|
||||
|
||||
@SafeParceled(1000)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(1)
|
||||
private String id;
|
||||
|
||||
@SafeParceled(2)
|
||||
private String name;
|
||||
|
||||
@SafeParceled(3)
|
||||
private Uri profilePictureUri;
|
||||
|
||||
@SafeParceled(value = 4, subClass = IdToken.class)
|
||||
private List<IdToken> tokens;
|
||||
|
||||
@SafeParceled(5)
|
||||
private String password;
|
||||
|
||||
@SafeParceled(6)
|
||||
private String accountType;
|
||||
|
||||
@SafeParceled(7)
|
||||
private String generatedPassword;
|
||||
|
||||
private Credential() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of federated identity account used to sign in the user. While this may be
|
||||
* any string, it is strongly recommended that values from {@link com.google.android.gms.auth.api.credentials.IdentityProviders}
|
||||
* are used, which are the login domains for common identity providers.
|
||||
*
|
||||
* @return A string identifying the federated identity provider associated with this account,
|
||||
* typically in the form of the identity provider's login domain. null will be returned if the
|
||||
* credential is a password credential.
|
||||
*/
|
||||
public String getAccountType() {
|
||||
return accountType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the generated password for an account hint.
|
||||
*/
|
||||
public String getGeneratedPassword() {
|
||||
return generatedPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the credential identifier, typically an email address or user name, though it may
|
||||
* also be some encoded unique identifier for a federated identity account.
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ID tokens that assert the identity of the user, if available. ID tokens provide
|
||||
* a secure mechanism to verify that the user owns the identity asserted by the credential.
|
||||
* <p/>
|
||||
* This is useful for account hints, where the ID token can replace the need to separately
|
||||
* verify that the user owns their claimed email address - with a valid ID token, it is not
|
||||
* necessary to send an account activation link to the address, simplifying the account
|
||||
* creation process for the user.
|
||||
* <p/>
|
||||
* A signed ID token is returned automatically for credential hints when the credential ID is a
|
||||
* Google account that is authenticated on the device. This ID token can be sent along with
|
||||
* your application's account creation operation, where the signature can be verified.
|
||||
*/
|
||||
public List<IdToken> getIdTokens() {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the display name of the credential, if available. Typically, the display name will
|
||||
* be the name of the user, or some other string which the user can easily recognize and
|
||||
* distinguish from other accounts they may have.
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the password used to sign in the user.
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL to an image of the user, if available.
|
||||
*/
|
||||
public Uri getProfilePictureUri() {
|
||||
return profilePictureUri;
|
||||
}
|
||||
|
||||
@PublicApi(exclude = true)
|
||||
public String getAsString() {
|
||||
if (TextUtils.isEmpty(accountType)) {
|
||||
return id.toLowerCase() + "|";
|
||||
} else {
|
||||
Uri uri = Uri.parse(accountType);
|
||||
return id.toLowerCase() + "|" + (TextUtils.isEmpty(uri.getScheme()) ? "" : uri.getScheme().toLowerCase()) + "://" +
|
||||
(TextUtils.isEmpty(uri.getHost()) ? "unknown" : uri.getHost().toLowerCase()) + ":" + uri.getPort();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || !(o instanceof Credential)) return false;
|
||||
|
||||
Credential that = (Credential) o;
|
||||
|
||||
if (id != null ? !id.equals(that.id) : that.id != null) return false;
|
||||
if (name != null ? !name.equals(that.name) : that.name != null) return false;
|
||||
if (profilePictureUri != null ? !profilePictureUri.equals(that.profilePictureUri) : that.profilePictureUri != null)
|
||||
return false;
|
||||
if (password != null ? !password.equals(that.password) : that.password != null)
|
||||
return false;
|
||||
if (accountType != null ? !accountType.equals(that.accountType) : that.accountType != null)
|
||||
return false;
|
||||
return generatedPassword != null ? generatedPassword.equals(that.generatedPassword) : that.generatedPassword == null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Arrays.hashCode(new Object[]{id, name, profilePictureUri, password, accountType, generatedPassword});
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String id;
|
||||
private String name;
|
||||
private Uri profilePictureUri;
|
||||
private String password;
|
||||
private String accountType;
|
||||
|
||||
@PublicApi(exclude = true)
|
||||
public List<IdToken> tokens;
|
||||
@PublicApi(exclude = true)
|
||||
private String generatedPassword;
|
||||
|
||||
public Builder(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the information stored in an existing credential, in order to allow that information to be modified.
|
||||
*
|
||||
* @param credential the existing credential
|
||||
*/
|
||||
public Builder(Credential credential) {
|
||||
this.id = credential.id;
|
||||
this.name = credential.name;
|
||||
this.profilePictureUri = credential.profilePictureUri;
|
||||
this.password = credential.password;
|
||||
this.accountType = credential.accountType;
|
||||
this.tokens = credential.tokens;
|
||||
this.generatedPassword = credential.generatedPassword;
|
||||
}
|
||||
|
||||
public Credential build() {
|
||||
Credential credential = new Credential();
|
||||
credential.id = id;
|
||||
credential.name = name;
|
||||
credential.profilePictureUri = profilePictureUri;
|
||||
credential.password = password;
|
||||
credential.accountType = accountType;
|
||||
credential.tokens = tokens;
|
||||
credential.generatedPassword = generatedPassword;
|
||||
return credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the account type for a federated credential. The value should be set to
|
||||
* identity provider's login domain, such as "https://accounts.google.com" for Google
|
||||
* accounts. The login domains for common identity providers are listed in {@link IdentityProviders}.
|
||||
*
|
||||
* @param accountType The type of the account. Typically, one of the values in {@link IdentityProviders}.
|
||||
*/
|
||||
public Builder setAccountType(String accountType) {
|
||||
this.accountType = accountType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the display name for the credential, which should be easy for the user to recognize
|
||||
* as associated to the credential, and distinguishable from other credentials they may
|
||||
* have. This string will be displayed more prominently than, or instead of, the account ID
|
||||
* whenever available. In most cases, the name of the user is sufficient.
|
||||
*/
|
||||
public Builder setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for the credential. Either the password or the account type must be
|
||||
* set for a credential, but not both.
|
||||
*/
|
||||
public Builder setPassword(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a profile picture associated with the credential, typically a picture the user has
|
||||
* selected to represent the account.
|
||||
*/
|
||||
public Builder setProfilePictureUri(Uri profilePictureUri) {
|
||||
this.profilePictureUri = profilePictureUri;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static final Creator<Credential> CREATOR = new AutoCreator<Credential>(Credential.class);
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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;
|
||||
|
||||
public class CredentialPickerConfig extends AutoSafeParcelable {
|
||||
|
||||
@SafeParceled(1000)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(1)
|
||||
private boolean showAddAccountButton;
|
||||
|
||||
@SafeParceled(2)
|
||||
private boolean showCancelButton;
|
||||
|
||||
@SafeParceled(3)
|
||||
private boolean forNewAccount;
|
||||
|
||||
private CredentialPickerConfig() {
|
||||
}
|
||||
|
||||
public CredentialPickerConfig(boolean showAddAccountButton, boolean showCancelButton, boolean forNewAccount) {
|
||||
this.showAddAccountButton = showAddAccountButton;
|
||||
this.showCancelButton = showCancelButton;
|
||||
this.forNewAccount = forNewAccount;
|
||||
}
|
||||
|
||||
public boolean isForNewAccount() {
|
||||
return forNewAccount;
|
||||
}
|
||||
|
||||
public boolean shouldShowAddAccountButton() {
|
||||
return showAddAccountButton;
|
||||
}
|
||||
|
||||
public boolean shouldShowCancelButton() {
|
||||
return showCancelButton;
|
||||
}
|
||||
|
||||
public class Builder {
|
||||
private boolean showAddAccountButton;
|
||||
private boolean showCancelButton;
|
||||
private boolean forNewAccount;
|
||||
|
||||
public CredentialPickerConfig build() {
|
||||
return new CredentialPickerConfig(showAddAccountButton, showCancelButton, forNewAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the hint request is for a new account sign-up flow.
|
||||
*/
|
||||
public Builder setForNewAccount(boolean forNewAccount) {
|
||||
this.forNewAccount = forNewAccount;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the add account button should be shown in credential picker dialog.
|
||||
*/
|
||||
public Builder setShowAddAccountButton(boolean showAddAccountButton) {
|
||||
this.showAddAccountButton = showAddAccountButton;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the cancel button should be shown in credential picker dialog.
|
||||
*/
|
||||
public Builder setShowCancelButton(boolean showCancelButton) {
|
||||
this.showCancelButton = showCancelButton;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static final Creator<CredentialPickerConfig> CREATOR = new AutoCreator<CredentialPickerConfig>(CredentialPickerConfig.class);
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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 {
|
||||
|
||||
@SafeParceled(1000)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(1)
|
||||
private boolean passwordLoginSupported;
|
||||
|
||||
@SafeParceled(2)
|
||||
private String[] accountTypes;
|
||||
|
||||
@SafeParceled(3)
|
||||
private CredentialPickerConfig credentialPickerConfig;
|
||||
|
||||
@SafeParceled(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;
|
||||
}
|
||||
|
||||
public static final Creator<CredentialRequest> CREATOR = new AutoCreator<CredentialRequest>(CredentialRequest.class);
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.gms.common.PublicApi;
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
@PublicApi
|
||||
public class IdToken extends AutoSafeParcelable {
|
||||
|
||||
@SafeParceled(1000)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(1)
|
||||
private String accountType;
|
||||
|
||||
@SafeParceled(2)
|
||||
private String id;
|
||||
|
||||
private IdToken() {
|
||||
}
|
||||
|
||||
public IdToken(String accountType, String id) {
|
||||
this.accountType = accountType;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code AccountManager} account type for the token.
|
||||
*/
|
||||
public String getAccountType() {
|
||||
return accountType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ID token, formatted according to the rules defined by the account type.
|
||||
*/
|
||||
public String getIdToken() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static final Creator<IdToken> CREATOR = new AutoCreator<IdToken>(IdToken.class);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class DeleteRequest extends AutoSafeParcelable {
|
||||
public static final Creator<DeleteRequest> CREATOR = new AutoCreator<DeleteRequest>(DeleteRequest.class);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class GeneratePasswordRequest extends AutoSafeParcelable {
|
||||
public static final Creator<GeneratePasswordRequest> CREATOR = new AutoCreator<GeneratePasswordRequest>(GeneratePasswordRequest.class);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class SaveRequest extends AutoSafeParcelable {
|
||||
public static final Creator<SaveRequest> CREATOR = new AutoCreator<SaveRequest>(SaveRequest.class);
|
||||
}
|
@ -14,15 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
String getMyVersionName() {
|
||||
@ -40,8 +31,8 @@ group = 'org.microg'
|
||||
version = getMyVersionName()
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.3"
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
aidlPackageWhiteList "com/google/android/gms/common/internal/ICancelToken.aidl"
|
||||
aidlPackageWhiteList "com/google/android/gms/dynamic/IObjectWrapper.aidl"
|
||||
|
@ -61,7 +61,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
private final Bundle metadata;
|
||||
|
||||
private boolean closed = false;
|
||||
private Map<String, Integer> columnIndizes;
|
||||
private Map<String, Integer> columnIndices;
|
||||
|
||||
protected static final int FIELD_TYPE_NULL = 0;
|
||||
protected static final int FIELD_TYPE_INTEGER = 1;
|
||||
@ -300,12 +300,6 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
return windows.toArray(new CursorWindow[windows.size()]);
|
||||
}
|
||||
|
||||
@PublicApi(exclude = true)
|
||||
@Deprecated
|
||||
public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) {
|
||||
return new DataHolder(cursor, statusCode, metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the boolean value for a given column at the provided position.
|
||||
* This will throw an {@link IllegalArgumentException} if the column does not exist, the
|
||||
@ -317,7 +311,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
* @return The boolean value in that column.
|
||||
*/
|
||||
public boolean getBoolean(String column, int row, int windowIndex) {
|
||||
return windows[windowIndex].getLong(row, columnIndizes.get(column)) == 1;
|
||||
return windows[windowIndex].getLong(row, columnIndices.get(column)) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -331,7 +325,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
* @return The byte array value in that column.
|
||||
*/
|
||||
public byte[] getByteArray(String column, int row, int windowIndex) {
|
||||
return windows[windowIndex].getBlob(row, columnIndizes.get(column));
|
||||
return windows[windowIndex].getBlob(row, columnIndices.get(column));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -360,7 +354,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
* @return The integer value in that column.
|
||||
*/
|
||||
public int getInteger(String column, int row, int windowIndex) {
|
||||
return windows[windowIndex].getInt(row, columnIndizes.get(column));
|
||||
return windows[windowIndex].getInt(row, columnIndices.get(column));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -374,7 +368,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
* @return The long value in that column.
|
||||
*/
|
||||
public long getLong(String column, int row, int windowIndex) {
|
||||
return windows[windowIndex].getLong(row, columnIndizes.get(column));
|
||||
return windows[windowIndex].getLong(row, columnIndices.get(column));
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
@ -392,7 +386,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
* @return The string value in that column.
|
||||
*/
|
||||
public String getString(String column, int row, int windowIndex) {
|
||||
return windows[windowIndex].getString(row, columnIndizes.get(column));
|
||||
return windows[windowIndex].getString(row, columnIndices.get(column));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -406,7 +400,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
* @return Whether the column value is null at this position.
|
||||
*/
|
||||
public boolean isNull(String column, int row, int windowIndex) {
|
||||
return windows[windowIndex].isNull(row, columnIndizes.get(column));
|
||||
return windows[windowIndex].isNull(row, columnIndices.get(column));
|
||||
}
|
||||
|
||||
public boolean isClosed() {
|
||||
@ -442,9 +436,9 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
|
||||
}
|
||||
|
||||
public void validateContents() {
|
||||
columnIndizes = new HashMap<String, Integer>();
|
||||
columnIndices = new HashMap<String, Integer>();
|
||||
for (int i = 0; i < columns.length; i++) {
|
||||
columnIndizes.put(columns[i], i);
|
||||
columnIndices.put(columns[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,15 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
String getMyVersionName() {
|
||||
@ -38,8 +29,8 @@ group = 'org.microg'
|
||||
version = getMyVersionName()
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.3"
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName getMyVersionName()
|
||||
|
@ -14,15 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
String getMyVersionName() {
|
||||
@ -38,8 +29,8 @@ group = 'org.microg'
|
||||
version = getMyVersionName()
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.3"
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName getMyVersionName()
|
||||
|
@ -14,15 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
String getMyVersionName() {
|
||||
@ -38,8 +29,8 @@ group = 'org.microg'
|
||||
version = getMyVersionName()
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.3"
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName getMyVersionName()
|
||||
|
@ -14,15 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
String getMyVersionName() {
|
||||
@ -38,8 +29,8 @@ group = 'org.microg'
|
||||
version = getMyVersionName()
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.3"
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName getMyVersionName()
|
||||
|
Loading…
Reference in New Issue
Block a user