86 lines
3.5 KiB
Java
86 lines
3.5 KiB
Java
|
package com.google.android.gms.location;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.os.Parcel;
|
||
|
import android.os.Parcelable;
|
||
|
import com.google.android.gms.common.internal.Objects;
|
||
|
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.util.Arrays;
|
||
|
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class LocationAvailability extends AbstractSafeParcelable implements ReflectedParcelable {
|
||
|
int zzc;
|
||
|
private final int zzd;
|
||
|
private final int zze;
|
||
|
private final long zzf;
|
||
|
private final zzbv[] zzg;
|
||
|
public static final LocationAvailability zza = new LocationAvailability(0, 1, 1, 0, null, true);
|
||
|
public static final LocationAvailability zzb = new LocationAvailability(1000, 1, 1, 0, null, false);
|
||
|
public static final Parcelable.Creator<LocationAvailability> CREATOR = new zzbn();
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public LocationAvailability(int i, int i2, int i3, long j, zzbv[] zzbvVarArr, boolean z) {
|
||
|
this.zzc = i < 1000 ? 0 : 1000;
|
||
|
this.zzd = i2;
|
||
|
this.zze = i3;
|
||
|
this.zzf = j;
|
||
|
this.zzg = zzbvVarArr;
|
||
|
}
|
||
|
|
||
|
public static LocationAvailability extractLocationAvailability(Intent intent) {
|
||
|
if (!hasLocationAvailability(intent)) {
|
||
|
return null;
|
||
|
}
|
||
|
try {
|
||
|
return (LocationAvailability) intent.getParcelableExtra("com.google.android.gms.location.EXTRA_LOCATION_AVAILABILITY");
|
||
|
} catch (ClassCastException unused) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@EnsuresNonNullIf(expression = {"#1"}, result = true)
|
||
|
public static boolean hasLocationAvailability(Intent intent) {
|
||
|
return intent != null && intent.hasExtra("com.google.android.gms.location.EXTRA_LOCATION_AVAILABILITY");
|
||
|
}
|
||
|
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (!(obj instanceof LocationAvailability)) {
|
||
|
return false;
|
||
|
}
|
||
|
LocationAvailability locationAvailability = (LocationAvailability) obj;
|
||
|
return this.zzd == locationAvailability.zzd && this.zze == locationAvailability.zze && this.zzf == locationAvailability.zzf && this.zzc == locationAvailability.zzc && Arrays.equals(this.zzg, locationAvailability.zzg);
|
||
|
}
|
||
|
|
||
|
public final int hashCode() {
|
||
|
return Objects.hashCode(Integer.valueOf(this.zzc));
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
boolean isLocationAvailable = isLocationAvailable();
|
||
|
StringBuilder sb = new StringBuilder(27);
|
||
|
sb.append("LocationAvailability[");
|
||
|
sb.append(isLocationAvailable);
|
||
|
sb.append("]");
|
||
|
return sb.toString();
|
||
|
}
|
||
|
|
||
|
@Override // android.os.Parcelable
|
||
|
public final void writeToParcel(Parcel parcel, int i) {
|
||
|
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||
|
SafeParcelWriter.writeInt(parcel, 1, this.zzd);
|
||
|
SafeParcelWriter.writeInt(parcel, 2, this.zze);
|
||
|
SafeParcelWriter.writeLong(parcel, 3, this.zzf);
|
||
|
SafeParcelWriter.writeInt(parcel, 4, this.zzc);
|
||
|
SafeParcelWriter.writeTypedArray(parcel, 5, this.zzg, i, false);
|
||
|
SafeParcelWriter.writeBoolean(parcel, 6, isLocationAvailable());
|
||
|
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
|
||
|
}
|
||
|
|
||
|
public final boolean isLocationAvailable() {
|
||
|
return this.zzc < 1000;
|
||
|
}
|
||
|
}
|