203 lines
6.8 KiB
Java
203 lines
6.8 KiB
Java
package com.google.android.gms.location;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.os.WorkSource;
|
|
import com.google.android.gms.common.internal.Objects;
|
|
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.util.WorkSourceUtil;
|
|
import com.google.android.gms.libs.identity.ClientIdentity;
|
|
import com.google.android.gms.libs.identity.zzeo;
|
|
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
|
|
import org.checkerframework.dataflow.qual.Pure;
|
|
|
|
/* JADX INFO: compiled from: com.google.android.gms:play-services-location@@21.2.0 */
|
|
/* JADX INFO: loaded from: classes2.dex */
|
|
public final class CurrentLocationRequest extends AbstractSafeParcelable {
|
|
public static final Parcelable.Creator<CurrentLocationRequest> CREATOR = new zzj();
|
|
private final long zza;
|
|
private final int zzb;
|
|
private final int zzc;
|
|
private final long zzd;
|
|
private final boolean zze;
|
|
private final int zzf;
|
|
private final WorkSource zzg;
|
|
private final ClientIdentity zzh;
|
|
|
|
/* JADX INFO: compiled from: com.google.android.gms:play-services-location@@21.2.0 */
|
|
public static final class Builder {
|
|
private long zza;
|
|
private int zzb;
|
|
private int zzc;
|
|
private long zzd;
|
|
private final boolean zze;
|
|
private final int zzf;
|
|
private final WorkSource zzg;
|
|
private final ClientIdentity zzh;
|
|
|
|
public Builder() {
|
|
this.zza = DeviceOrientationRequest.OUTPUT_PERIOD_MEDIUM;
|
|
this.zzb = 0;
|
|
this.zzc = 102;
|
|
this.zzd = Long.MAX_VALUE;
|
|
this.zze = false;
|
|
this.zzf = 0;
|
|
this.zzg = null;
|
|
this.zzh = null;
|
|
}
|
|
|
|
public Builder(CurrentLocationRequest currentLocationRequest) {
|
|
this.zza = currentLocationRequest.getMaxUpdateAgeMillis();
|
|
this.zzb = currentLocationRequest.getGranularity();
|
|
this.zzc = currentLocationRequest.getPriority();
|
|
this.zzd = currentLocationRequest.getDurationMillis();
|
|
this.zze = currentLocationRequest.zza();
|
|
this.zzf = currentLocationRequest.zzb();
|
|
this.zzg = new WorkSource(currentLocationRequest.zzc());
|
|
this.zzh = currentLocationRequest.zzd();
|
|
}
|
|
|
|
public CurrentLocationRequest build() {
|
|
return new CurrentLocationRequest(this.zza, this.zzb, this.zzc, this.zzd, this.zze, this.zzf, new WorkSource(this.zzg), this.zzh);
|
|
}
|
|
|
|
public Builder setDurationMillis(long j) {
|
|
Preconditions.checkArgument(j > 0, "durationMillis must be greater than 0");
|
|
this.zzd = j;
|
|
return this;
|
|
}
|
|
|
|
public Builder setGranularity(int i) {
|
|
zzq.zza(i);
|
|
this.zzb = i;
|
|
return this;
|
|
}
|
|
|
|
public Builder setMaxUpdateAgeMillis(long j) {
|
|
Preconditions.checkArgument(j >= 0, "maxUpdateAgeMillis must be greater than or equal to 0");
|
|
this.zza = j;
|
|
return this;
|
|
}
|
|
|
|
public Builder setPriority(int i) {
|
|
zzan.zza(i);
|
|
this.zzc = i;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
CurrentLocationRequest(long j, int i, int i2, long j2, boolean z, int i3, WorkSource workSource, ClientIdentity clientIdentity) {
|
|
this.zza = j;
|
|
this.zzb = i;
|
|
this.zzc = i2;
|
|
this.zzd = j2;
|
|
this.zze = z;
|
|
this.zzf = i3;
|
|
this.zzg = workSource;
|
|
this.zzh = clientIdentity;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (!(obj instanceof CurrentLocationRequest)) {
|
|
return false;
|
|
}
|
|
CurrentLocationRequest currentLocationRequest = (CurrentLocationRequest) obj;
|
|
return this.zza == currentLocationRequest.zza && this.zzb == currentLocationRequest.zzb && this.zzc == currentLocationRequest.zzc && this.zzd == currentLocationRequest.zzd && this.zze == currentLocationRequest.zze && this.zzf == currentLocationRequest.zzf && Objects.equal(this.zzg, currentLocationRequest.zzg) && Objects.equal(this.zzh, currentLocationRequest.zzh);
|
|
}
|
|
|
|
@Pure
|
|
public long getDurationMillis() {
|
|
return this.zzd;
|
|
}
|
|
|
|
@Pure
|
|
public int getGranularity() {
|
|
return this.zzb;
|
|
}
|
|
|
|
@Pure
|
|
public long getMaxUpdateAgeMillis() {
|
|
return this.zza;
|
|
}
|
|
|
|
@Pure
|
|
public int getPriority() {
|
|
return this.zzc;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Objects.hashCode(Long.valueOf(this.zza), Integer.valueOf(this.zzb), Integer.valueOf(this.zzc), Long.valueOf(this.zzd));
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("CurrentLocationRequest[");
|
|
sb.append(zzan.zzb(this.zzc));
|
|
if (this.zza != Long.MAX_VALUE) {
|
|
sb.append(", maxAge=");
|
|
zzeo.zzc(this.zza, sb);
|
|
}
|
|
if (this.zzd != Long.MAX_VALUE) {
|
|
sb.append(", duration=");
|
|
sb.append(this.zzd);
|
|
sb.append("ms");
|
|
}
|
|
if (this.zzb != 0) {
|
|
sb.append(", ");
|
|
sb.append(zzq.zzb(this.zzb));
|
|
}
|
|
if (this.zze) {
|
|
sb.append(", bypass");
|
|
}
|
|
if (this.zzf != 0) {
|
|
sb.append(", ");
|
|
sb.append(zzar.zzb(this.zzf));
|
|
}
|
|
if (!WorkSourceUtil.isEmpty(this.zzg)) {
|
|
sb.append(", workSource=");
|
|
sb.append(this.zzg);
|
|
}
|
|
if (this.zzh != null) {
|
|
sb.append(", impersonation=");
|
|
sb.append(this.zzh);
|
|
}
|
|
sb.append(AbstractJsonLexerKt.END_LIST);
|
|
return sb.toString();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
|
SafeParcelWriter.writeLong(parcel, 1, getMaxUpdateAgeMillis());
|
|
SafeParcelWriter.writeInt(parcel, 2, getGranularity());
|
|
SafeParcelWriter.writeInt(parcel, 3, getPriority());
|
|
SafeParcelWriter.writeLong(parcel, 4, getDurationMillis());
|
|
SafeParcelWriter.writeBoolean(parcel, 5, this.zze);
|
|
SafeParcelWriter.writeParcelable(parcel, 6, this.zzg, i, false);
|
|
SafeParcelWriter.writeInt(parcel, 7, this.zzf);
|
|
SafeParcelWriter.writeParcelable(parcel, 9, this.zzh, i, false);
|
|
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
|
}
|
|
|
|
@Pure
|
|
public final boolean zza() {
|
|
return this.zze;
|
|
}
|
|
|
|
@Pure
|
|
public final int zzb() {
|
|
return this.zzf;
|
|
}
|
|
|
|
@Pure
|
|
public final WorkSource zzc() {
|
|
return this.zzg;
|
|
}
|
|
|
|
@Pure
|
|
public final ClientIdentity zzd() {
|
|
return this.zzh;
|
|
}
|
|
} |