Initial version -- added millennium read funcionality

This commit is contained in:
Pablo
2026-03-09 22:05:28 +01:00
commit 77c2ded482
2770 changed files with 141927 additions and 0 deletions
@@ -0,0 +1,65 @@
package com.google.android.gms.common.data;
import android.os.Bundle;
import java.util.Iterator;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public abstract class AbstractDataBuffer<T> implements DataBuffer<T> {
protected final DataHolder mDataHolder;
protected AbstractDataBuffer(DataHolder dataHolder) {
this.mDataHolder = dataHolder;
}
@Override // com.google.android.gms.common.data.DataBuffer, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
release();
}
@Override // com.google.android.gms.common.data.DataBuffer
public abstract T get(int i);
@Override // com.google.android.gms.common.data.DataBuffer
public int getCount() {
DataHolder dataHolder = this.mDataHolder;
if (dataHolder == null) {
return 0;
}
return dataHolder.getCount();
}
@Override // com.google.android.gms.common.data.DataBuffer
public final Bundle getMetadata() {
DataHolder dataHolder = this.mDataHolder;
if (dataHolder == null) {
return null;
}
return dataHolder.getMetadata();
}
@Override // com.google.android.gms.common.data.DataBuffer
@Deprecated
public boolean isClosed() {
DataHolder dataHolder = this.mDataHolder;
return dataHolder == null || dataHolder.isClosed();
}
@Override // com.google.android.gms.common.data.DataBuffer, java.lang.Iterable
public Iterator<T> iterator() {
return new DataBufferIterator(this);
}
@Override // com.google.android.gms.common.data.DataBuffer, com.google.android.gms.common.api.Releasable
public void release() {
DataHolder dataHolder = this.mDataHolder;
if (dataHolder != null) {
dataHolder.close();
}
}
@Override // com.google.android.gms.common.data.DataBuffer
public Iterator<T> singleRefIterator() {
return new SingleRefDataBufferIterator(this);
}
}
@@ -0,0 +1,147 @@
package com.google.android.gms.common.data;
import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;
import android.util.Log;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.ReflectedParcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class BitmapTeleporter extends AbstractSafeParcelable implements ReflectedParcelable {
public static final Parcelable.Creator<BitmapTeleporter> CREATOR = new zaa();
final int zaa;
ParcelFileDescriptor zab;
final int zac;
private Bitmap zad;
private boolean zae;
private File zaf;
BitmapTeleporter(int i, ParcelFileDescriptor parcelFileDescriptor, int i2) {
this.zaa = i;
this.zab = parcelFileDescriptor;
this.zac = i2;
this.zad = null;
this.zae = false;
}
private static final void zaa(Closeable closeable) {
try {
closeable.close();
} catch (IOException e) {
Log.w("BitmapTeleporter", "Could not close stream", e);
}
}
public Bitmap get() {
if (!this.zae) {
DataInputStream dataInputStream = new DataInputStream(new ParcelFileDescriptor.AutoCloseInputStream((ParcelFileDescriptor) Preconditions.checkNotNull(this.zab)));
try {
try {
byte[] bArr = new byte[dataInputStream.readInt()];
int i = dataInputStream.readInt();
int i2 = dataInputStream.readInt();
Bitmap.Config configValueOf = Bitmap.Config.valueOf(dataInputStream.readUTF());
dataInputStream.read(bArr);
zaa(dataInputStream);
ByteBuffer byteBufferWrap = ByteBuffer.wrap(bArr);
Bitmap bitmapCreateBitmap = Bitmap.createBitmap(i, i2, configValueOf);
bitmapCreateBitmap.copyPixelsFromBuffer(byteBufferWrap);
this.zad = bitmapCreateBitmap;
this.zae = true;
} catch (IOException e) {
throw new IllegalStateException("Could not read from parcel file descriptor", e);
}
} catch (Throwable th) {
zaa(dataInputStream);
throw th;
}
}
return this.zad;
}
public void release() {
if (this.zae) {
return;
}
try {
((ParcelFileDescriptor) Preconditions.checkNotNull(this.zab)).close();
} catch (IOException e) {
Log.w("BitmapTeleporter", "Could not close PFD", e);
}
}
public void setTempDir(File file) {
if (file == null) {
throw new NullPointerException("Cannot set null temp directory");
}
this.zaf = file;
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
if (this.zab == null) {
Bitmap bitmap = (Bitmap) Preconditions.checkNotNull(this.zad);
ByteBuffer byteBufferAllocate = ByteBuffer.allocate(bitmap.getRowBytes() * bitmap.getHeight());
bitmap.copyPixelsToBuffer(byteBufferAllocate);
byte[] bArrArray = byteBufferAllocate.array();
File file = this.zaf;
if (file == null) {
throw new IllegalStateException("setTempDir() must be called before writing this object to a parcel");
}
try {
File fileCreateTempFile = File.createTempFile("teleporter", ".tmp", file);
try {
FileOutputStream fileOutputStream = new FileOutputStream(fileCreateTempFile);
this.zab = ParcelFileDescriptor.open(fileCreateTempFile, 268435456);
fileCreateTempFile.delete();
DataOutputStream dataOutputStream = new DataOutputStream(new BufferedOutputStream(fileOutputStream));
try {
try {
dataOutputStream.writeInt(bArrArray.length);
dataOutputStream.writeInt(bitmap.getWidth());
dataOutputStream.writeInt(bitmap.getHeight());
dataOutputStream.writeUTF(bitmap.getConfig().toString());
dataOutputStream.write(bArrArray);
} catch (IOException e) {
throw new IllegalStateException("Could not write into unlinked file", e);
}
} finally {
zaa(dataOutputStream);
}
} catch (FileNotFoundException unused) {
throw new IllegalStateException("Temporary file is somehow already deleted");
}
} catch (IOException e2) {
throw new IllegalStateException("Could not create temporary file", e2);
}
}
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, this.zaa);
SafeParcelWriter.writeParcelable(parcel, 2, this.zab, i | 1, false);
SafeParcelWriter.writeInt(parcel, 3, this.zac);
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
this.zab = null;
}
public BitmapTeleporter(Bitmap bitmap) {
this.zaa = 1;
this.zab = null;
this.zac = 0;
this.zad = bitmap;
this.zae = true;
}
}
@@ -0,0 +1,28 @@
package com.google.android.gms.common.data;
import android.os.Bundle;
import com.google.android.gms.common.api.Releasable;
import java.io.Closeable;
import java.util.Iterator;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public interface DataBuffer<T> extends Iterable<T>, Releasable, Closeable {
void close();
T get(int i);
int getCount();
Bundle getMetadata();
@Deprecated
boolean isClosed();
@Override // java.lang.Iterable
Iterator<T> iterator();
void release();
Iterator<T> singleRefIterator();
}
@@ -0,0 +1,37 @@
package com.google.android.gms.common.data;
import com.google.android.gms.common.internal.Preconditions;
import java.util.Iterator;
import java.util.NoSuchElementException;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class DataBufferIterator<T> implements Iterator<T> {
protected final DataBuffer zaa;
protected int zab = -1;
public DataBufferIterator(DataBuffer dataBuffer) {
this.zaa = (DataBuffer) Preconditions.checkNotNull(dataBuffer);
}
@Override // java.util.Iterator
public final boolean hasNext() {
return this.zab < this.zaa.getCount() + (-1);
}
@Override // java.util.Iterator
public Object next() {
if (hasNext()) {
DataBuffer dataBuffer = this.zaa;
int i = this.zab + 1;
this.zab = i;
return dataBuffer.get(i);
}
throw new NoSuchElementException("Cannot advance the iterator beyond " + this.zab);
}
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException("Cannot remove elements from a DataBufferIterator");
}
}
@@ -0,0 +1,23 @@
package com.google.android.gms.common.data;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public interface DataBufferObserver {
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
public interface Observable {
void addObserver(DataBufferObserver dataBufferObserver);
void removeObserver(DataBufferObserver dataBufferObserver);
}
void onDataChanged();
void onDataRangeChanged(int i, int i2);
void onDataRangeInserted(int i, int i2);
void onDataRangeMoved(int i, int i2, int i3);
void onDataRangeRemoved(int i, int i2);
}
@@ -0,0 +1,69 @@
package com.google.android.gms.common.data;
import com.google.android.gms.common.data.DataBufferObserver;
import java.util.HashSet;
import java.util.Iterator;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class DataBufferObserverSet implements DataBufferObserver, DataBufferObserver.Observable {
private final HashSet zaa = new HashSet();
@Override // com.google.android.gms.common.data.DataBufferObserver.Observable
public void addObserver(DataBufferObserver dataBufferObserver) {
this.zaa.add(dataBufferObserver);
}
public void clear() {
this.zaa.clear();
}
public boolean hasObservers() {
return !this.zaa.isEmpty();
}
@Override // com.google.android.gms.common.data.DataBufferObserver
public void onDataChanged() {
Iterator it = this.zaa.iterator();
while (it.hasNext()) {
((DataBufferObserver) it.next()).onDataChanged();
}
}
@Override // com.google.android.gms.common.data.DataBufferObserver
public void onDataRangeChanged(int i, int i2) {
Iterator it = this.zaa.iterator();
while (it.hasNext()) {
((DataBufferObserver) it.next()).onDataRangeChanged(i, i2);
}
}
@Override // com.google.android.gms.common.data.DataBufferObserver
public void onDataRangeInserted(int i, int i2) {
Iterator it = this.zaa.iterator();
while (it.hasNext()) {
((DataBufferObserver) it.next()).onDataRangeInserted(i, i2);
}
}
@Override // com.google.android.gms.common.data.DataBufferObserver
public void onDataRangeMoved(int i, int i2, int i3) {
Iterator it = this.zaa.iterator();
while (it.hasNext()) {
((DataBufferObserver) it.next()).onDataRangeMoved(i, i2, i3);
}
}
@Override // com.google.android.gms.common.data.DataBufferObserver
public void onDataRangeRemoved(int i, int i2) {
Iterator it = this.zaa.iterator();
while (it.hasNext()) {
((DataBufferObserver) it.next()).onDataRangeRemoved(i, i2);
}
}
@Override // com.google.android.gms.common.data.DataBufferObserver.Observable
public void removeObserver(DataBufferObserver dataBufferObserver) {
this.zaa.remove(dataBufferObserver);
}
}
@@ -0,0 +1,99 @@
package com.google.android.gms.common.data;
import android.database.CharArrayBuffer;
import android.net.Uri;
import com.google.android.gms.common.internal.Objects;
import com.google.android.gms.common.internal.Preconditions;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public abstract class DataBufferRef {
protected final DataHolder mDataHolder;
protected int mDataRow;
private int zaa;
public DataBufferRef(DataHolder dataHolder, int i) {
this.mDataHolder = (DataHolder) Preconditions.checkNotNull(dataHolder);
zaa(i);
}
protected void copyToBuffer(String str, CharArrayBuffer charArrayBuffer) {
this.mDataHolder.zac(str, this.mDataRow, this.zaa, charArrayBuffer);
}
public boolean equals(Object obj) {
if (obj instanceof DataBufferRef) {
DataBufferRef dataBufferRef = (DataBufferRef) obj;
if (Objects.equal(Integer.valueOf(dataBufferRef.mDataRow), Integer.valueOf(this.mDataRow)) && Objects.equal(Integer.valueOf(dataBufferRef.zaa), Integer.valueOf(this.zaa)) && dataBufferRef.mDataHolder == this.mDataHolder) {
return true;
}
}
return false;
}
protected boolean getBoolean(String str) {
return this.mDataHolder.getBoolean(str, this.mDataRow, this.zaa);
}
protected byte[] getByteArray(String str) {
return this.mDataHolder.getByteArray(str, this.mDataRow, this.zaa);
}
protected int getDataRow() {
return this.mDataRow;
}
protected double getDouble(String str) {
return this.mDataHolder.zaa(str, this.mDataRow, this.zaa);
}
protected float getFloat(String str) {
return this.mDataHolder.zab(str, this.mDataRow, this.zaa);
}
protected int getInteger(String str) {
return this.mDataHolder.getInteger(str, this.mDataRow, this.zaa);
}
protected long getLong(String str) {
return this.mDataHolder.getLong(str, this.mDataRow, this.zaa);
}
protected String getString(String str) {
return this.mDataHolder.getString(str, this.mDataRow, this.zaa);
}
public boolean hasColumn(String str) {
return this.mDataHolder.hasColumn(str);
}
protected boolean hasNull(String str) {
return this.mDataHolder.hasNull(str, this.mDataRow, this.zaa);
}
public int hashCode() {
return Objects.hashCode(Integer.valueOf(this.mDataRow), Integer.valueOf(this.zaa), this.mDataHolder);
}
public boolean isDataValid() {
return !this.mDataHolder.isClosed();
}
protected Uri parseUri(String str) {
String string = this.mDataHolder.getString(str, this.mDataRow, this.zaa);
if (string == null) {
return null;
}
return Uri.parse(string);
}
protected final void zaa(int i) {
boolean z = false;
if (i >= 0 && i < this.mDataHolder.getCount()) {
z = true;
}
Preconditions.checkState(z);
this.mDataRow = i;
this.zaa = this.mDataHolder.getWindowIndex(i);
}
}
@@ -0,0 +1,45 @@
package com.google.android.gms.common.data;
import android.content.ContentValues;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.data.DataHolder;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class DataBufferSafeParcelable<T extends SafeParcelable> extends AbstractDataBuffer<T> {
private static final String[] zaa = {"data"};
private final Parcelable.Creator zab;
public DataBufferSafeParcelable(DataHolder dataHolder, Parcelable.Creator<T> creator) {
super(dataHolder);
this.zab = creator;
}
public static <T extends SafeParcelable> void addValue(DataHolder.Builder builder, T t) {
Parcel parcelObtain = Parcel.obtain();
t.writeToParcel(parcelObtain, 0);
ContentValues contentValues = new ContentValues();
contentValues.put("data", parcelObtain.marshall());
builder.withRow(contentValues);
parcelObtain.recycle();
}
public static DataHolder.Builder buildDataHolder() {
return DataHolder.builder(zaa);
}
@Override // com.google.android.gms.common.data.AbstractDataBuffer, com.google.android.gms.common.data.DataBuffer
public T get(int i) {
DataHolder dataHolder = (DataHolder) Preconditions.checkNotNull(this.mDataHolder);
byte[] byteArray = dataHolder.getByteArray("data", i, dataHolder.getWindowIndex(i));
Parcel parcelObtain = Parcel.obtain();
parcelObtain.unmarshall(byteArray, 0, byteArray.length);
parcelObtain.setDataPosition(0);
T t = (T) this.zab.createFromParcel(parcelObtain);
parcelObtain.recycle();
return t;
}
}
@@ -0,0 +1,43 @@
package com.google.android.gms.common.data;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.Iterator;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class DataBufferUtils {
public static final String KEY_NEXT_PAGE_TOKEN = "next_page_token";
public static final String KEY_PREV_PAGE_TOKEN = "prev_page_token";
private DataBufferUtils() {
}
/* JADX WARN: Multi-variable type inference failed */
public static <T, E extends Freezable<T>> ArrayList<T> freezeAndClose(DataBuffer<E> dataBuffer) {
ArrayList<T> arrayList = (ArrayList<T>) new ArrayList(dataBuffer.getCount());
try {
Iterator<E> it = dataBuffer.iterator();
while (it.hasNext()) {
arrayList.add(it.next().freeze());
}
return arrayList;
} finally {
dataBuffer.close();
}
}
public static boolean hasData(DataBuffer<?> dataBuffer) {
return dataBuffer != null && dataBuffer.getCount() > 0;
}
public static boolean hasNextPage(DataBuffer<?> dataBuffer) {
Bundle metadata = dataBuffer.getMetadata();
return (metadata == null || metadata.getString(KEY_NEXT_PAGE_TOKEN) == null) ? false : true;
}
public static boolean hasPrevPage(DataBuffer<?> dataBuffer) {
Bundle metadata = dataBuffer.getMetadata();
return (metadata == null || metadata.getString(KEY_PREV_PAGE_TOKEN) == null) ? false : true;
}
}
@@ -0,0 +1,353 @@
package com.google.android.gms.common.data;
import android.content.ContentValues;
import android.database.CharArrayBuffer;
import android.database.Cursor;
import android.database.CursorIndexOutOfBoundsException;
import android.database.CursorWindow;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import com.google.android.gms.common.internal.Asserts;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import com.google.android.gms.common.sqlite.CursorWrapper;
import java.io.Closeable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class DataHolder extends AbstractSafeParcelable implements Closeable {
public static final Parcelable.Creator<DataHolder> CREATOR = new zaf();
private static final Builder zaf = new zab(new String[0], null);
final int zaa;
Bundle zab;
int[] zac;
int zad;
boolean zae;
private final String[] zag;
private final CursorWindow[] zah;
private final int zai;
private final Bundle zaj;
private boolean zak;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
public static class Builder {
private final String[] zaa;
private final ArrayList zab = new ArrayList();
private final HashMap zac = new HashMap();
/* synthetic */ Builder(String[] strArr, String str, zac zacVar) {
this.zaa = (String[]) Preconditions.checkNotNull(strArr);
}
public DataHolder build(int i) {
return new DataHolder(this, i);
}
public Builder withRow(ContentValues contentValues) {
Asserts.checkNotNull(contentValues);
HashMap map = new HashMap(contentValues.size());
for (Map.Entry<String, Object> entry : contentValues.valueSet()) {
map.put(entry.getKey(), entry.getValue());
}
return zaa(map);
}
public Builder zaa(HashMap map) {
Asserts.checkNotNull(map);
this.zab.add(map);
return this;
}
public DataHolder build(int i, Bundle bundle) {
return new DataHolder(this, i, bundle);
}
}
DataHolder(int i, String[] strArr, CursorWindow[] cursorWindowArr, int i2, Bundle bundle) {
this.zae = false;
this.zak = true;
this.zaa = i;
this.zag = strArr;
this.zah = cursorWindowArr;
this.zai = i2;
this.zaj = bundle;
}
public DataHolder(String[] strArr, CursorWindow[] cursorWindowArr, int i, Bundle bundle) {
this.zae = false;
this.zak = true;
this.zaa = 1;
this.zag = (String[]) Preconditions.checkNotNull(strArr);
this.zah = (CursorWindow[]) Preconditions.checkNotNull(cursorWindowArr);
this.zai = i;
this.zaj = bundle;
zad();
}
public static Builder builder(String[] strArr) {
return new Builder(strArr, null, 0 == true ? 1 : 0);
}
public static DataHolder empty(int i) {
return new DataHolder(zaf, i, (Bundle) null);
}
private final void zae(String str, int i) {
Bundle bundle = this.zab;
if (bundle == null || !bundle.containsKey(str)) {
throw new IllegalArgumentException("No such column: ".concat(String.valueOf(str)));
}
if (isClosed()) {
throw new IllegalArgumentException("Buffer is closed.");
}
if (i < 0 || i >= this.zad) {
throw new CursorIndexOutOfBoundsException(i, this.zad);
}
}
/* JADX WARN: Code restructure failed: missing block: B:52:0x0133, code lost:
if (r5 != false) goto L68;
*/
/* JADX WARN: Code restructure failed: missing block: B:53:0x0135, code lost:
android.util.Log.d("DataHolder", "Couldn't populate window data for row " + r4 + " - allocating new window.");
r2.freeLastRow();
r2 = new android.database.CursorWindow(false);
r2.setStartPosition(r4);
r2.setNumColumns(r13.zaa.length);
r3.add(r2);
r4 = r4 - 1;
r5 = true;
*/
/* JADX WARN: Code restructure failed: missing block: B:54:0x0167, code lost:
r4 = r4 + 1;
*/
/* JADX WARN: Code restructure failed: missing block: B:56:0x0171, code lost:
throw new com.google.android.gms.common.data.zad("Could not add the value to a new CursorWindow. The size of value may be larger than what a CursorWindow can handle.");
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
private static android.database.CursorWindow[] zaf(com.google.android.gms.common.data.DataHolder.Builder r13, int r14) {
/*
Method dump skipped, instruction units count: 403
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.data.DataHolder.zaf(com.google.android.gms.common.data.DataHolder$Builder, int):android.database.CursorWindow[]");
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public void close() {
synchronized (this) {
if (!this.zae) {
this.zae = true;
int i = 0;
while (true) {
CursorWindow[] cursorWindowArr = this.zah;
if (i >= cursorWindowArr.length) {
break;
}
cursorWindowArr[i].close();
i++;
}
}
}
}
protected final void finalize() throws Throwable {
try {
if (this.zak && this.zah.length > 0 && !isClosed()) {
close();
Log.e("DataBuffer", "Internal data leak within a DataBuffer object detected! Be sure to explicitly call release() on all DataBuffer extending objects when you are done with them. (internal object: " + toString() + ")");
}
} finally {
super.finalize();
}
}
public boolean getBoolean(String str, int i, int i2) {
zae(str, i);
return Long.valueOf(this.zah[i2].getLong(i, this.zab.getInt(str))).longValue() == 1;
}
public byte[] getByteArray(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].getBlob(i, this.zab.getInt(str));
}
public int getCount() {
return this.zad;
}
public int getInteger(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].getInt(i, this.zab.getInt(str));
}
public long getLong(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].getLong(i, this.zab.getInt(str));
}
public Bundle getMetadata() {
return this.zaj;
}
public int getStatusCode() {
return this.zai;
}
public String getString(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].getString(i, this.zab.getInt(str));
}
public int getWindowIndex(int i) {
int length;
int i2 = 0;
Preconditions.checkState(i >= 0 && i < this.zad);
while (true) {
int[] iArr = this.zac;
length = iArr.length;
if (i2 >= length) {
break;
}
if (i < iArr[i2]) {
i2--;
break;
}
i2++;
}
return i2 == length ? i2 - 1 : i2;
}
public boolean hasColumn(String str) {
return this.zab.containsKey(str);
}
public boolean hasNull(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].isNull(i, this.zab.getInt(str));
}
public boolean isClosed() {
boolean z;
synchronized (this) {
z = this.zae;
}
return z;
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
String[] strArr = this.zag;
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeStringArray(parcel, 1, strArr, false);
SafeParcelWriter.writeTypedArray(parcel, 2, this.zah, i, false);
SafeParcelWriter.writeInt(parcel, 3, getStatusCode());
SafeParcelWriter.writeBundle(parcel, 4, getMetadata(), false);
SafeParcelWriter.writeInt(parcel, 1000, this.zaa);
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
if ((i & 1) != 0) {
close();
}
}
public final double zaa(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].getDouble(i, this.zab.getInt(str));
}
public final float zab(String str, int i, int i2) {
zae(str, i);
return this.zah[i2].getFloat(i, this.zab.getInt(str));
}
public final void zac(String str, int i, int i2, CharArrayBuffer charArrayBuffer) {
zae(str, i);
this.zah[i2].copyStringToBuffer(i, this.zab.getInt(str), charArrayBuffer);
}
public final void zad() {
this.zab = new Bundle();
int i = 0;
int i2 = 0;
while (true) {
String[] strArr = this.zag;
if (i2 >= strArr.length) {
break;
}
this.zab.putInt(strArr[i2], i2);
i2++;
}
this.zac = new int[this.zah.length];
int numRows = 0;
while (true) {
CursorWindow[] cursorWindowArr = this.zah;
if (i >= cursorWindowArr.length) {
this.zad = numRows;
return;
}
this.zac[i] = numRows;
numRows += this.zah[i].getNumRows() - (numRows - cursorWindowArr[i].getStartPosition());
i++;
}
}
public DataHolder(Cursor cursor, int i, Bundle bundle) {
int startPosition;
CursorWrapper cursorWrapper = new CursorWrapper(cursor);
String[] columnNames = cursorWrapper.getColumnNames();
ArrayList arrayList = new ArrayList();
try {
int count = cursorWrapper.getCount();
CursorWindow window = cursorWrapper.getWindow();
if (window == null || window.getStartPosition() != 0) {
startPosition = 0;
} else {
window.acquireReference();
cursorWrapper.setWindow(null);
arrayList.add(window);
startPosition = window.getNumRows();
}
while (startPosition < count) {
if (!cursorWrapper.moveToPosition(startPosition)) {
break;
}
CursorWindow window2 = cursorWrapper.getWindow();
if (window2 != null) {
window2.acquireReference();
cursorWrapper.setWindow(null);
} else {
window2 = new CursorWindow(false);
window2.setStartPosition(startPosition);
cursorWrapper.fillWindow(startPosition, window2);
}
if (window2.getNumRows() == 0) {
break;
}
arrayList.add(window2);
startPosition = window2.getStartPosition() + window2.getNumRows();
}
cursorWrapper.close();
this(columnNames, (CursorWindow[]) arrayList.toArray(new CursorWindow[arrayList.size()]), i, bundle);
} catch (Throwable th) {
cursorWrapper.close();
throw th;
}
}
private DataHolder(Builder builder, int i, Bundle bundle) {
this(builder.zaa, zaf(builder, -1), i, (Bundle) null);
}
}
@@ -0,0 +1,96 @@
package com.google.android.gms.common.data;
import com.google.android.gms.common.internal.Preconditions;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
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 abstract class EntityBuffer<T> extends AbstractDataBuffer<T> {
private boolean zaa;
private ArrayList zab;
protected EntityBuffer(DataHolder dataHolder) {
super(dataHolder);
this.zaa = false;
}
private final void zab() {
synchronized (this) {
if (!this.zaa) {
int count = ((DataHolder) Preconditions.checkNotNull(this.mDataHolder)).getCount();
ArrayList arrayList = new ArrayList();
this.zab = arrayList;
if (count > 0) {
arrayList.add(0);
String primaryDataMarkerColumn = getPrimaryDataMarkerColumn();
String string = this.mDataHolder.getString(primaryDataMarkerColumn, 0, this.mDataHolder.getWindowIndex(0));
for (int i = 1; i < count; i++) {
int windowIndex = this.mDataHolder.getWindowIndex(i);
String string2 = this.mDataHolder.getString(primaryDataMarkerColumn, i, windowIndex);
if (string2 == null) {
throw new NullPointerException("Missing value for markerColumn: " + primaryDataMarkerColumn + ", at row: " + i + ", for window: " + windowIndex);
}
if (!string2.equals(string)) {
this.zab.add(Integer.valueOf(i));
string = string2;
}
}
}
this.zaa = true;
}
}
}
@Override // com.google.android.gms.common.data.AbstractDataBuffer, com.google.android.gms.common.data.DataBuffer
@ResultIgnorabilityUnspecified
public final T get(int i) {
int iIntValue;
int iIntValue2;
zab();
int iZaa = zaa(i);
int i2 = 0;
if (i >= 0 && i != this.zab.size()) {
if (i == this.zab.size() - 1) {
iIntValue = ((DataHolder) Preconditions.checkNotNull(this.mDataHolder)).getCount();
iIntValue2 = ((Integer) this.zab.get(i)).intValue();
} else {
iIntValue = ((Integer) this.zab.get(i + 1)).intValue();
iIntValue2 = ((Integer) this.zab.get(i)).intValue();
}
int i3 = iIntValue - iIntValue2;
if (i3 == 1) {
int iZaa2 = zaa(i);
int windowIndex = ((DataHolder) Preconditions.checkNotNull(this.mDataHolder)).getWindowIndex(iZaa2);
String childDataMarkerColumn = getChildDataMarkerColumn();
if (childDataMarkerColumn == null || this.mDataHolder.getString(childDataMarkerColumn, iZaa2, windowIndex) != null) {
i2 = 1;
}
} else {
i2 = i3;
}
}
return getEntry(iZaa, i2);
}
protected String getChildDataMarkerColumn() {
return null;
}
@Override // com.google.android.gms.common.data.AbstractDataBuffer, com.google.android.gms.common.data.DataBuffer
public int getCount() {
zab();
return this.zab.size();
}
protected abstract T getEntry(int i, int i2);
protected abstract String getPrimaryDataMarkerColumn();
final int zaa(int i) {
if (i >= 0 && i < this.zab.size()) {
return ((Integer) this.zab.get(i)).intValue();
}
throw new IllegalArgumentException("Position " + i + " is out of bounds for this buffer");
}
}
@@ -0,0 +1,9 @@
package com.google.android.gms.common.data;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public interface Freezable<T> {
T freeze();
boolean isDataValid();
}
@@ -0,0 +1,37 @@
package com.google.android.gms.common.data;
import java.util.ArrayList;
import java.util.Iterator;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class FreezableUtils {
/* JADX WARN: Multi-variable type inference failed */
public static <T, E extends Freezable<T>> ArrayList<T> freeze(ArrayList<E> arrayList) {
ArrayList<T> arrayList2 = (ArrayList<T>) new ArrayList(arrayList.size());
int size = arrayList.size();
for (int i = 0; i < size; i++) {
arrayList2.add(arrayList.get(i).freeze());
}
return arrayList2;
}
/* JADX WARN: Multi-variable type inference failed */
public static <T, E extends Freezable<T>> ArrayList<T> freezeIterable(Iterable<E> iterable) {
ArrayList<T> arrayList = (ArrayList<T>) new ArrayList();
Iterator<E> it = iterable.iterator();
while (it.hasNext()) {
arrayList.add(it.next().freeze());
}
return arrayList;
}
/* JADX WARN: Multi-variable type inference failed */
public static <T, E extends Freezable<T>> ArrayList<T> freeze(E[] eArr) {
ArrayList<T> arrayList = (ArrayList<T>) new ArrayList(eArr.length);
for (E e : eArr) {
arrayList.add(e.freeze());
}
return arrayList;
}
}
@@ -0,0 +1,33 @@
package com.google.android.gms.common.data;
import com.google.android.gms.common.internal.Preconditions;
import java.util.NoSuchElementException;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public class SingleRefDataBufferIterator<T> extends DataBufferIterator<T> {
private Object zac;
public SingleRefDataBufferIterator(DataBuffer dataBuffer) {
super(dataBuffer);
}
@Override // com.google.android.gms.common.data.DataBufferIterator, java.util.Iterator
public final Object next() {
if (!hasNext()) {
throw new NoSuchElementException("Cannot advance the iterator beyond " + this.zab);
}
int i = this.zab + 1;
this.zab = i;
if (i == 0) {
Object objCheckNotNull = Preconditions.checkNotNull(this.zaa.get(0));
this.zac = objCheckNotNull;
if (!(objCheckNotNull instanceof DataBufferRef)) {
throw new IllegalStateException("DataBuffer reference of type " + String.valueOf(objCheckNotNull.getClass()) + " is not movable");
}
} else {
((DataBufferRef) Preconditions.checkNotNull(this.zac)).zaa(this.zab);
}
return this.zac;
}
}
@@ -0,0 +1,38 @@
package com.google.android.gms.common.data;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
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 zaa implements Parcelable.Creator {
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
int i = 0;
ParcelFileDescriptor parcelFileDescriptor = 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) {
parcelFileDescriptor = (ParcelFileDescriptor) SafeParcelReader.createParcelable(parcel, header, ParcelFileDescriptor.CREATOR);
} else if (fieldId != 3) {
SafeParcelReader.skipUnknownField(parcel, header);
} else {
i2 = SafeParcelReader.readInt(parcel, header);
}
}
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
return new BitmapTeleporter(i, parcelFileDescriptor, i2);
}
@Override // android.os.Parcelable.Creator
public final /* synthetic */ Object[] newArray(int i) {
return new BitmapTeleporter[i];
}
}
@@ -0,0 +1,23 @@
package com.google.android.gms.common.data;
import android.content.ContentValues;
import com.google.android.gms.common.data.DataHolder;
import java.util.HashMap;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
final class zab extends DataHolder.Builder {
zab(String[] strArr, String str) {
super(strArr, null, null);
}
@Override // com.google.android.gms.common.data.DataHolder.Builder
public final DataHolder.Builder withRow(ContentValues contentValues) {
throw new UnsupportedOperationException("Cannot add data to empty builder");
}
@Override // com.google.android.gms.common.data.DataHolder.Builder
public final DataHolder.Builder zaa(HashMap map) {
throw new UnsupportedOperationException("Cannot add data to empty builder");
}
}
@@ -0,0 +1,9 @@
package com.google.android.gms.common.data;
/* JADX INFO: compiled from: com.google.android.gms:play-services-base@@18.4.0 */
/* JADX INFO: loaded from: classes2.dex */
public final class zad extends RuntimeException {
public zad(String str) {
super("Could not add the value to a new CursorWindow. The size of value may be larger than what a CursorWindow can handle.");
}
}
@@ -0,0 +1,47 @@
package com.google.android.gms.common.data;
import android.database.CursorWindow;
import android.os.Bundle;
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 zaf implements Parcelable.Creator {
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
String[] strArrCreateStringArray = null;
CursorWindow[] cursorWindowArr = null;
Bundle bundleCreateBundle = null;
int i = 0;
int i2 = 0;
while (parcel.dataPosition() < iValidateObjectHeader) {
int header = SafeParcelReader.readHeader(parcel);
int fieldId = SafeParcelReader.getFieldId(header);
if (fieldId == 1) {
strArrCreateStringArray = SafeParcelReader.createStringArray(parcel, header);
} else if (fieldId == 2) {
cursorWindowArr = (CursorWindow[]) SafeParcelReader.createTypedArray(parcel, header, CursorWindow.CREATOR);
} else if (fieldId == 3) {
i2 = SafeParcelReader.readInt(parcel, header);
} else if (fieldId == 4) {
bundleCreateBundle = SafeParcelReader.createBundle(parcel, header);
} else if (fieldId != 1000) {
SafeParcelReader.skipUnknownField(parcel, header);
} else {
i = SafeParcelReader.readInt(parcel, header);
}
}
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
DataHolder dataHolder = new DataHolder(i, strArrCreateStringArray, cursorWindowArr, i2, bundleCreateBundle);
dataHolder.zad();
return dataHolder;
}
@Override // android.os.Parcelable.Creator
public final /* synthetic */ Object[] newArray(int i) {
return new DataHolder[i];
}
}