Initial version -- added millennium read funcionality
This commit is contained in:
+77
@@ -0,0 +1,77 @@
|
||||
package com.google.android.gms.common.server.converter;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.SparseArray;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import com.google.android.gms.common.server.response.FastJsonResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class StringToIntConverter extends AbstractSafeParcelable implements FastJsonResponse.FieldConverter<String, Integer> {
|
||||
public static final Parcelable.Creator<StringToIntConverter> CREATOR = new zad();
|
||||
final int zaa;
|
||||
private final HashMap zab;
|
||||
private final SparseArray zac;
|
||||
|
||||
public StringToIntConverter() {
|
||||
this.zaa = 1;
|
||||
this.zab = new HashMap();
|
||||
this.zac = new SparseArray();
|
||||
}
|
||||
|
||||
public StringToIntConverter add(String str, int i) {
|
||||
this.zab.put(str, Integer.valueOf(i));
|
||||
this.zac.put(i, str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int i2 = this.zaa;
|
||||
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||||
SafeParcelWriter.writeInt(parcel, 1, i2);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (String str : this.zab.keySet()) {
|
||||
arrayList.add(new zac(str, ((Integer) this.zab.get(str)).intValue()));
|
||||
}
|
||||
SafeParcelWriter.writeTypedList(parcel, 2, arrayList, false);
|
||||
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.server.response.FastJsonResponse.FieldConverter
|
||||
public final int zaa() {
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.server.response.FastJsonResponse.FieldConverter
|
||||
public final int zab() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.server.response.FastJsonResponse.FieldConverter
|
||||
public final /* bridge */ /* synthetic */ Object zac(Object obj) {
|
||||
Integer num = (Integer) this.zab.get((String) obj);
|
||||
return num == null ? (Integer) this.zab.get("gms_unknown") : num;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.server.response.FastJsonResponse.FieldConverter
|
||||
public final /* bridge */ /* synthetic */ Object zad(Object obj) {
|
||||
String str = (String) this.zac.get(((Integer) obj).intValue());
|
||||
return (str == null && this.zab.containsKey("gms_unknown")) ? "gms_unknown" : str;
|
||||
}
|
||||
|
||||
StringToIntConverter(int i, ArrayList arrayList) {
|
||||
this.zaa = i;
|
||||
this.zab = new HashMap();
|
||||
this.zac = new SparseArray();
|
||||
int size = arrayList.size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
zac zacVar = (zac) arrayList.get(i2);
|
||||
add(zacVar.zab, zacVar.zac);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.google.android.gms.common.server.converter;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import com.google.android.gms.common.server.response.FastJsonResponse;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class zaa extends AbstractSafeParcelable {
|
||||
public static final Parcelable.Creator<zaa> CREATOR = new zab();
|
||||
final int zaa;
|
||||
private final StringToIntConverter zab;
|
||||
|
||||
zaa(int i, StringToIntConverter stringToIntConverter) {
|
||||
this.zaa = i;
|
||||
this.zab = stringToIntConverter;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int i2 = this.zaa;
|
||||
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||||
SafeParcelWriter.writeInt(parcel, 1, i2);
|
||||
SafeParcelWriter.writeParcelable(parcel, 2, this.zab, i, false);
|
||||
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
||||
}
|
||||
|
||||
public final FastJsonResponse.FieldConverter zab() {
|
||||
StringToIntConverter stringToIntConverter = this.zab;
|
||||
if (stringToIntConverter != null) {
|
||||
return stringToIntConverter;
|
||||
}
|
||||
throw new IllegalStateException("There was no converter wrapped in this ConverterWrapper.");
|
||||
}
|
||||
|
||||
private zaa(StringToIntConverter stringToIntConverter) {
|
||||
this.zaa = 1;
|
||||
this.zab = stringToIntConverter;
|
||||
}
|
||||
|
||||
public static zaa zaa(FastJsonResponse.FieldConverter fieldConverter) {
|
||||
if (fieldConverter instanceof StringToIntConverter) {
|
||||
return new zaa((StringToIntConverter) fieldConverter);
|
||||
}
|
||||
throw new IllegalArgumentException("Unsupported safe parcelable field converter class.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.google.android.gms.common.server.converter;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class zab implements Parcelable.Creator {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
|
||||
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
|
||||
StringToIntConverter stringToIntConverter = null;
|
||||
int i = 0;
|
||||
while (parcel.dataPosition() < iValidateObjectHeader) {
|
||||
int header = SafeParcelReader.readHeader(parcel);
|
||||
int fieldId = SafeParcelReader.getFieldId(header);
|
||||
if (fieldId == 1) {
|
||||
i = SafeParcelReader.readInt(parcel, header);
|
||||
} else if (fieldId != 2) {
|
||||
SafeParcelReader.skipUnknownField(parcel, header);
|
||||
} else {
|
||||
stringToIntConverter = (StringToIntConverter) SafeParcelReader.createParcelable(parcel, header, StringToIntConverter.CREATOR);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
|
||||
return new zaa(i, stringToIntConverter);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Object[] newArray(int i) {
|
||||
return new zaa[i];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.common.server.converter;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class zac extends AbstractSafeParcelable {
|
||||
public static final Parcelable.Creator<zac> CREATOR = new zae();
|
||||
final int zaa;
|
||||
final String zab;
|
||||
final int zac;
|
||||
|
||||
zac(int i, String str, int i2) {
|
||||
this.zaa = i;
|
||||
this.zab = str;
|
||||
this.zac = i2;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int i2 = this.zaa;
|
||||
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||||
SafeParcelWriter.writeInt(parcel, 1, i2);
|
||||
SafeParcelWriter.writeString(parcel, 2, this.zab, false);
|
||||
SafeParcelWriter.writeInt(parcel, 3, this.zac);
|
||||
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
||||
}
|
||||
|
||||
zac(String str, int i) {
|
||||
this.zaa = 1;
|
||||
this.zab = str;
|
||||
this.zac = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.google.android.gms.common.server.converter;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class zad implements Parcelable.Creator {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
|
||||
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
|
||||
ArrayList arrayListCreateTypedList = null;
|
||||
int i = 0;
|
||||
while (parcel.dataPosition() < iValidateObjectHeader) {
|
||||
int header = SafeParcelReader.readHeader(parcel);
|
||||
int fieldId = SafeParcelReader.getFieldId(header);
|
||||
if (fieldId == 1) {
|
||||
i = SafeParcelReader.readInt(parcel, header);
|
||||
} else if (fieldId != 2) {
|
||||
SafeParcelReader.skipUnknownField(parcel, header);
|
||||
} else {
|
||||
arrayListCreateTypedList = SafeParcelReader.createTypedList(parcel, header, zac.CREATOR);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
|
||||
return new StringToIntConverter(i, arrayListCreateTypedList);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Object[] newArray(int i) {
|
||||
return new StringToIntConverter[i];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.common.server.converter;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class zae implements Parcelable.Creator {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
|
||||
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
|
||||
int i = 0;
|
||||
String strCreateString = null;
|
||||
int i2 = 0;
|
||||
while (parcel.dataPosition() < iValidateObjectHeader) {
|
||||
int header = SafeParcelReader.readHeader(parcel);
|
||||
int fieldId = SafeParcelReader.getFieldId(header);
|
||||
if (fieldId == 1) {
|
||||
i = SafeParcelReader.readInt(parcel, header);
|
||||
} else if (fieldId == 2) {
|
||||
strCreateString = SafeParcelReader.createString(parcel, header);
|
||||
} else if (fieldId != 3) {
|
||||
SafeParcelReader.skipUnknownField(parcel, header);
|
||||
} else {
|
||||
i2 = SafeParcelReader.readInt(parcel, header);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
|
||||
return new zac(i, strCreateString, i2);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Object[] newArray(int i) {
|
||||
return new zac[i];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user