Skip to content

Commit

Permalink
Change the use of AutoSafeParcelable to AbstractSafeParcelable and ad…
Browse files Browse the repository at this point in the history
…d annotation information
  • Loading branch information
DaVinci9196 committed Dec 26, 2023
1 parent 0562150 commit f44d825
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 22 deletions.
2 changes: 2 additions & 0 deletions play-services-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ dependencies {
api project(':play-services-basement')
api project(':play-services-fido')
api project(':play-services-tasks')

annotationProcessor project(':safe-parcel-processor')
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@

package com.google.android.gms.auth.api.identity;

import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcel;

public class BeginSignInRequest extends AutoSafeParcelable {
import androidx.annotation.NonNull;

import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

@SafeParcelable.Class
public class BeginSignInRequest extends AbstractSafeParcelable {
@Field(1)
public PasswordRequestOptions passwordRequestOptions;
@Field(2)
Expand All @@ -19,5 +26,10 @@ public class BeginSignInRequest extends AutoSafeParcelable {
@Field(5)
public int code;

public static final Creator<BeginSignInRequest> CREATOR = findCreator(BeginSignInRequest.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<BeginSignInRequest> CREATOR = findCreator(BeginSignInRequest.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,23 @@
package com.google.android.gms.auth.api.identity;

import android.app.PendingIntent;
import android.os.Parcel;

import org.microg.safeparcel.AutoSafeParcelable;
import androidx.annotation.NonNull;

public class BeginSignInResult extends AutoSafeParcelable {
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

@SafeParcelable.Class
public class BeginSignInResult extends AbstractSafeParcelable {
@Field(1)
public PendingIntent pendingIntent;

public static final Creator<BeginSignInResult> CREATOR = findCreator(BeginSignInResult.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<BeginSignInResult> CREATOR = findCreator(BeginSignInResult.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@

package com.google.android.gms.auth.api.identity;

import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcel;

public class GetPhoneNumberHintIntentRequest extends AutoSafeParcelable {
import androidx.annotation.NonNull;

import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

@SafeParcelable.Class
public class GetPhoneNumberHintIntentRequest extends AbstractSafeParcelable {
@Field(1)
public int code;

public static final Creator<GetPhoneNumberHintIntentRequest> CREATOR = findCreator(GetPhoneNumberHintIntentRequest.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<GetPhoneNumberHintIntentRequest> CREATOR = findCreator(GetPhoneNumberHintIntentRequest.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@

package com.google.android.gms.auth.api.identity;

import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcel;

public class GetSignInIntentRequest extends AutoSafeParcelable {
import androidx.annotation.NonNull;

import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

@SafeParcelable.Class
public class GetSignInIntentRequest extends AbstractSafeParcelable {
@Field(1)
public String clientId;
@Field(2)
Expand All @@ -21,6 +28,11 @@ public class GetSignInIntentRequest extends AutoSafeParcelable {
@Field(6)
public int code;

public static final Creator<GetSignInIntentRequest> CREATOR = findCreator(GetSignInIntentRequest.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<GetSignInIntentRequest> CREATOR = findCreator(GetSignInIntentRequest.class);

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

package com.google.android.gms.auth.api.identity;

import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcel;

import androidx.annotation.NonNull;

import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

import java.util.ArrayList;

public class GoogleIdTokenRequestOptions extends AutoSafeParcelable {
@SafeParcelable.Class
public class GoogleIdTokenRequestOptions extends AbstractSafeParcelable {
@Field(1)
public boolean idTokenRequested;
@Field(2)
Expand All @@ -21,9 +28,14 @@ public class GoogleIdTokenRequestOptions extends AutoSafeParcelable {
@Field(5)
public String serverClientId;
@Field(6)
public ArrayList<?> scopes;
public ArrayList<String> scopes;
@Field(7)
public boolean forceCodeForRefreshToken;

public static final Creator<GoogleIdTokenRequestOptions> CREATOR = findCreator(GoogleIdTokenRequestOptions.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<GoogleIdTokenRequestOptions> CREATOR = findCreator(GoogleIdTokenRequestOptions.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@

package com.google.android.gms.auth.api.identity;

import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcel;

public class PasswordRequestOptions extends AutoSafeParcelable {
import androidx.annotation.NonNull;

import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

@SafeParcelable.Class
public class PasswordRequestOptions extends AbstractSafeParcelable {
@Field(1)
public boolean primary;

public static final Creator<PasswordRequestOptions> CREATOR = findCreator(PasswordRequestOptions.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<PasswordRequestOptions> CREATOR = findCreator(PasswordRequestOptions.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@

package com.google.android.gms.auth.api.identity;

import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcel;

public class SignInCredential extends AutoSafeParcelable {
import androidx.annotation.NonNull;

import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

@SafeParcelable.Class
public class SignInCredential extends AbstractSafeParcelable {
@Field(1)
public String email;
@Field(2)
Expand All @@ -25,5 +32,10 @@ public class SignInCredential extends AutoSafeParcelable {
@Field(8)
public String obfuscatedIdentifier;

public static final Creator<SignInCredential> CREATOR = findCreator(SignInCredential.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<SignInCredential> CREATOR = findCreator(SignInCredential.class);
}

0 comments on commit f44d825

Please sign in to comment.