209 lines
9.2 KiB
Java
209 lines
9.2 KiB
Java
|
package com.google.android.libraries.places.internal;
|
||
|
|
||
|
import android.location.Location;
|
||
|
import com.google.android.gms.tasks.Continuation;
|
||
|
import com.google.android.gms.tasks.SuccessContinuation;
|
||
|
import com.google.android.gms.tasks.Task;
|
||
|
import com.google.android.libraries.places.api.net.FetchPhotoRequest;
|
||
|
import com.google.android.libraries.places.api.net.FetchPhotoResponse;
|
||
|
import com.google.android.libraries.places.api.net.FetchPlaceRequest;
|
||
|
import com.google.android.libraries.places.api.net.FetchPlaceResponse;
|
||
|
import com.google.android.libraries.places.api.net.FindAutocompletePredictionsRequest;
|
||
|
import com.google.android.libraries.places.api.net.FindAutocompletePredictionsResponse;
|
||
|
import com.google.android.libraries.places.api.net.FindCurrentPlaceRequest;
|
||
|
import com.google.android.libraries.places.api.net.FindCurrentPlaceResponse;
|
||
|
import com.google.android.libraries.places.api.net.PlacesClient;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzdo implements PlacesClient {
|
||
|
private final zzcs zza;
|
||
|
private final zzci zzb;
|
||
|
private final zzcn zzc;
|
||
|
private final zzfr zzd;
|
||
|
private final zzbx zze;
|
||
|
|
||
|
private static void zzg(zzcf zzcfVar, zzcg zzcgVar) {
|
||
|
zzcf.zza(zzcfVar, zzcf.zzb("Duration"));
|
||
|
zzcc.zza();
|
||
|
zzcc.zza();
|
||
|
zzcf.zza(zzcfVar, zzcf.zzb("Battery"));
|
||
|
zzcc.zza();
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.libraries.places.api.net.PlacesClient
|
||
|
public final Task<FetchPhotoResponse> fetchPhoto(final FetchPhotoRequest fetchPhotoRequest) {
|
||
|
try {
|
||
|
zzig.zzc(fetchPhotoRequest, "Request must not be null.");
|
||
|
zzcc.zza();
|
||
|
final zzcg zza = zzcg.zza();
|
||
|
return this.zza.zza(fetchPhotoRequest).continueWith(new Continuation(this, fetchPhotoRequest, zza) { // from class: com.google.android.libraries.places.internal.zzdi
|
||
|
public final zzdo zza;
|
||
|
public final FetchPhotoRequest zzb;
|
||
|
public final zzcg zzc;
|
||
|
|
||
|
@Override // com.google.android.gms.tasks.Continuation
|
||
|
public final Object then(Task task) {
|
||
|
return this.zza.zzc(this.zzb, this.zzc, task);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.zza = this;
|
||
|
this.zzb = fetchPhotoRequest;
|
||
|
this.zzc = zza;
|
||
|
}
|
||
|
}).continueWithTask(zzdj.zza);
|
||
|
} catch (Error | RuntimeException e) {
|
||
|
zzgb.zzb(e);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.libraries.places.api.net.PlacesClient
|
||
|
public final Task<FetchPlaceResponse> fetchPlace(final FetchPlaceRequest fetchPlaceRequest) {
|
||
|
try {
|
||
|
zzig.zzc(fetchPlaceRequest, "Request must not be null.");
|
||
|
zzcc.zza();
|
||
|
final zzcg zza = zzcg.zza();
|
||
|
return this.zza.zzb(fetchPlaceRequest).continueWith(new Continuation(this, fetchPlaceRequest, zza) { // from class: com.google.android.libraries.places.internal.zzdm
|
||
|
public final zzdo zza;
|
||
|
public final FetchPlaceRequest zzb;
|
||
|
public final zzcg zzc;
|
||
|
|
||
|
@Override // com.google.android.gms.tasks.Continuation
|
||
|
public final Object then(Task task) {
|
||
|
return this.zza.zzd(this.zzb, this.zzc, task);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.zza = this;
|
||
|
this.zzb = fetchPlaceRequest;
|
||
|
this.zzc = zza;
|
||
|
}
|
||
|
}).continueWithTask(zzdj.zza);
|
||
|
} catch (Error | RuntimeException e) {
|
||
|
zzgb.zzb(e);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.libraries.places.api.net.PlacesClient
|
||
|
public final Task<FindAutocompletePredictionsResponse> findAutocompletePredictions(final FindAutocompletePredictionsRequest findAutocompletePredictionsRequest) {
|
||
|
try {
|
||
|
zzig.zzc(findAutocompletePredictionsRequest, "Request must not be null.");
|
||
|
zzcc.zza();
|
||
|
final zzcg zza = zzcg.zza();
|
||
|
return this.zza.zzc(findAutocompletePredictionsRequest).continueWith(new Continuation(this, findAutocompletePredictionsRequest, zza) { // from class: com.google.android.libraries.places.internal.zzdn
|
||
|
public final zzdo zza;
|
||
|
public final FindAutocompletePredictionsRequest zzb;
|
||
|
public final zzcg zzc;
|
||
|
|
||
|
@Override // com.google.android.gms.tasks.Continuation
|
||
|
public final Object then(Task task) {
|
||
|
return this.zza.zze(this.zzb, this.zzc, task);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.zza = this;
|
||
|
this.zzb = findAutocompletePredictionsRequest;
|
||
|
this.zzc = zza;
|
||
|
}
|
||
|
}).continueWithTask(zzdj.zza);
|
||
|
} catch (Error | RuntimeException e) {
|
||
|
zzgb.zzb(e);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.libraries.places.api.net.PlacesClient
|
||
|
public final Task<FindCurrentPlaceResponse> findCurrentPlace(FindCurrentPlaceRequest findCurrentPlaceRequest) {
|
||
|
return zza(findCurrentPlaceRequest, null);
|
||
|
}
|
||
|
|
||
|
public final Task zza(final FindCurrentPlaceRequest findCurrentPlaceRequest, String str) {
|
||
|
try {
|
||
|
zzig.zzc(findCurrentPlaceRequest, "Request must not be null.");
|
||
|
final long zza = this.zze.zza();
|
||
|
zzcc.zza();
|
||
|
final zzcg zza2 = zzcg.zza();
|
||
|
final String str2 = null;
|
||
|
return this.zzb.zza(findCurrentPlaceRequest.getCancellationToken()).onSuccessTask(new SuccessContinuation(this, findCurrentPlaceRequest, str2) { // from class: com.google.android.libraries.places.internal.zzdk
|
||
|
public final zzdo zza;
|
||
|
public final FindCurrentPlaceRequest zzb;
|
||
|
|
||
|
@Override // com.google.android.gms.tasks.SuccessContinuation
|
||
|
public final Task then(Object obj) {
|
||
|
return this.zza.zzb(this.zzb, null, (Location) obj);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.zza = this;
|
||
|
this.zzb = findCurrentPlaceRequest;
|
||
|
}
|
||
|
}).continueWith(new Continuation(this, findCurrentPlaceRequest, zza, zza2) { // from class: com.google.android.libraries.places.internal.zzdl
|
||
|
public final zzdo zza;
|
||
|
public final FindCurrentPlaceRequest zzb;
|
||
|
public final long zzc;
|
||
|
public final zzcg zzd;
|
||
|
|
||
|
@Override // com.google.android.gms.tasks.Continuation
|
||
|
public final Object then(Task task) {
|
||
|
return this.zza.zzf(this.zzb, this.zzc, this.zzd, task);
|
||
|
}
|
||
|
|
||
|
{
|
||
|
this.zza = this;
|
||
|
this.zzb = findCurrentPlaceRequest;
|
||
|
this.zzc = zza;
|
||
|
this.zzd = zza2;
|
||
|
}
|
||
|
}).continueWithTask(zzdj.zza);
|
||
|
} catch (Error | RuntimeException e) {
|
||
|
zzgb.zzb(e);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final /* synthetic */ Task zzb(FindCurrentPlaceRequest findCurrentPlaceRequest, String str, Location location) throws Exception {
|
||
|
zzig.zzc(location, "Location must not be null.");
|
||
|
return this.zza.zzd(findCurrentPlaceRequest, location, this.zzc.zza(null));
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final /* synthetic */ FetchPhotoResponse zzc(FetchPhotoRequest fetchPhotoRequest, zzcg zzcgVar, Task task) throws Exception {
|
||
|
this.zzd.zza(fetchPhotoRequest);
|
||
|
zzg(zzcf.zzb("FetchPhoto"), zzcgVar);
|
||
|
return (FetchPhotoResponse) task.getResult();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final /* synthetic */ FetchPlaceResponse zzd(FetchPlaceRequest fetchPlaceRequest, zzcg zzcgVar, Task task) throws Exception {
|
||
|
this.zzd.zzc(fetchPlaceRequest);
|
||
|
zzg(zzcf.zzb("FetchPlace"), zzcgVar);
|
||
|
return (FetchPlaceResponse) task.getResult();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final /* synthetic */ FindAutocompletePredictionsResponse zze(FindAutocompletePredictionsRequest findAutocompletePredictionsRequest, zzcg zzcgVar, Task task) throws Exception {
|
||
|
this.zzd.zze(findAutocompletePredictionsRequest);
|
||
|
zzg(zzcf.zzb("FindAutocompletePredictions"), zzcgVar);
|
||
|
return (FindAutocompletePredictionsResponse) task.getResult();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final /* synthetic */ FindCurrentPlaceResponse zzf(FindCurrentPlaceRequest findCurrentPlaceRequest, long j, zzcg zzcgVar, Task task) throws Exception {
|
||
|
this.zzd.zzg(findCurrentPlaceRequest, task, j, this.zze.zza());
|
||
|
zzg(zzcf.zzb("FindCurrentPlace"), zzcgVar);
|
||
|
return (FindCurrentPlaceResponse) task.getResult();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public zzdo(zzcs zzcsVar, zzci zzciVar, zzcn zzcnVar, zzfr zzfrVar, zzbx zzbxVar) {
|
||
|
this.zza = zzcsVar;
|
||
|
this.zzb = zzciVar;
|
||
|
this.zzc = zzcnVar;
|
||
|
this.zzd = zzfrVar;
|
||
|
this.zze = zzbxVar;
|
||
|
}
|
||
|
}
|