package com.google.android.gms.location;

import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.DefaultClock;
import com.google.android.gms.common.util.VisibleForTesting;

/* JADX INFO: loaded from: classes3.dex */
@VisibleForTesting
public interface Geofence {
    public static final int GEOFENCE_TRANSITION_DWELL = 4;
    public static final int GEOFENCE_TRANSITION_ENTER = 1;
    public static final int GEOFENCE_TRANSITION_EXIT = 2;
    public static final long NEVER_EXPIRE = -1;

    @VisibleForTesting
    public static final class Builder {
        private double zze;
        private double zzf;
        private float zzg;
        private String zza = null;

        @TransitionTypes
        private int zzb = 0;
        private long zzc = Long.MIN_VALUE;
        private short zzd = -1;
        private int zzh = 0;
        private int zzi = -1;

        public Geofence build() {
            String str = this.zza;
            if (str == null) {
                throw new IllegalArgumentException("Request ID not set.");
            }
            int i6 = this.zzb;
            if (i6 == 0) {
                throw new IllegalArgumentException("Transitions types not set.");
            }
            if ((i6 & 4) != 0 && this.zzi < 0) {
                throw new IllegalArgumentException("Non-negative loitering delay needs to be set when transition types include GEOFENCE_TRANSITION_DWELLING.");
            }
            long j4 = this.zzc;
            if (j4 == Long.MIN_VALUE) {
                throw new IllegalArgumentException("Expiration not set.");
            }
            if (this.zzd == -1) {
                throw new IllegalArgumentException("Geofence region not set.");
            }
            int i7 = this.zzh;
            if (i7 >= 0) {
                return new com.google.android.gms.internal.location.zzbe(str, i6, (short) 1, this.zze, this.zzf, this.zzg, j4, i7, this.zzi);
            }
            throw new IllegalArgumentException("Notification responsiveness should be nonnegative.");
        }

        public Builder setCircularRegion(double d6, double d7, float f6) {
            boolean z6 = d6 >= -90.0d && d6 <= 90.0d;
            StringBuilder sb = new StringBuilder(42);
            sb.append("Invalid latitude: ");
            sb.append(d6);
            Preconditions.checkArgument(z6, sb.toString());
            boolean z7 = d7 >= -180.0d && d7 <= 180.0d;
            StringBuilder sb2 = new StringBuilder(43);
            sb2.append("Invalid longitude: ");
            sb2.append(d7);
            Preconditions.checkArgument(z7, sb2.toString());
            boolean z8 = f6 > 0.0f;
            StringBuilder sb3 = new StringBuilder(31);
            sb3.append("Invalid radius: ");
            sb3.append(f6);
            Preconditions.checkArgument(z8, sb3.toString());
            this.zzd = (short) 1;
            this.zze = d6;
            this.zzf = d7;
            this.zzg = f6;
            return this;
        }

        public Builder setExpirationDuration(long j4) {
            if (j4 < 0) {
                this.zzc = -1L;
                return this;
            }
            this.zzc = DefaultClock.getInstance().elapsedRealtime() + j4;
            return this;
        }

        public Builder setLoiteringDelay(int i6) {
            this.zzi = i6;
            return this;
        }

        public Builder setNotificationResponsiveness(int i6) {
            this.zzh = i6;
            return this;
        }

        public Builder setRequestId(String str) {
            this.zza = (String) Preconditions.checkNotNull(str, "Request ID can't be set to null");
            return this;
        }

        public Builder setTransitionTypes(@TransitionTypes int i6) {
            this.zzb = i6;
            return this;
        }
    }

    public @interface GeofenceTransition {
    }

    public @interface TransitionTypes {
    }

    String getRequestId();
}
