package com.google.android.gms.location; import android.os.Parcel; import android.os.Parcelable; 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 java.util.ArrayList; import java.util.List; /* loaded from: classes2.dex */ public class GeofencingRequest extends AbstractSafeParcelable { public static final Parcelable.Creator CREATOR = new zzbb(); public static final int INITIAL_TRIGGER_DWELL = 4; public static final int INITIAL_TRIGGER_ENTER = 1; public static final int INITIAL_TRIGGER_EXIT = 2; private final List zza; private final int zzb; private final String zzc; private final String zzd; /* loaded from: classes.dex */ public @interface InitialTrigger { } /* JADX INFO: Access modifiers changed from: package-private */ public GeofencingRequest(List list, int i, String str, String str2) { this.zza = list; this.zzb = i; this.zzc = str; this.zzd = str2; } public List getGeofences() { ArrayList arrayList = new ArrayList(); arrayList.addAll(this.zza); return arrayList; } public String toString() { StringBuilder sb = new StringBuilder("GeofencingRequest[geofences="); sb.append(this.zza); sb.append(", initialTrigger="); sb.append(this.zzb); sb.append(", tag="); sb.append(this.zzc); sb.append(", attributionTag="); sb.append(this.zzd); sb.append("]"); return sb.toString(); } @Override // android.os.Parcelable public void writeToParcel(Parcel parcel, int i) { int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel); SafeParcelWriter.writeTypedList(parcel, 1, this.zza, false); SafeParcelWriter.writeInt(parcel, 2, getInitialTrigger()); SafeParcelWriter.writeString(parcel, 3, this.zzc, false); SafeParcelWriter.writeString(parcel, 4, this.zzd, false); SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader); } public final GeofencingRequest zza(String str) { return new GeofencingRequest(this.zza, this.zzb, this.zzc, str); } /* loaded from: classes2.dex */ public static final class Builder { private final List zza = new ArrayList(); private int zzb = 5; private String zzc = ""; public final Builder addGeofence(Geofence geofence) { Preconditions.checkNotNull(geofence, "geofence can't be null."); Preconditions.checkArgument(geofence instanceof com.google.android.gms.internal.location.zzbj, "Geofence must be created using Geofence.Builder."); this.zza.add((com.google.android.gms.internal.location.zzbj) geofence); return this; } public final Builder addGeofences(List list) { if (list != null && !list.isEmpty()) { for (Geofence geofence : list) { if (geofence != null) { addGeofence(geofence); } } } return this; } public final GeofencingRequest build() { Preconditions.checkArgument(!this.zza.isEmpty(), "No geofence has been added to this request."); return new GeofencingRequest(this.zza, this.zzb, this.zzc, null); } public final Builder setInitialTrigger(int i) { this.zzb = i & 7; return this; } } public int getInitialTrigger() { return this.zzb; } }