129 lines
4.3 KiB
Java
129 lines
4.3 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.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.internal.safeparcel.SafeParcelableSerializer;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class SleepClassifyEvent extends AbstractSafeParcelable {
|
|
public static final Parcelable.Creator<SleepClassifyEvent> CREATOR = new zzcb();
|
|
private final int zza;
|
|
private final int zzb;
|
|
private final int zzc;
|
|
private final int zzd;
|
|
private final int zze;
|
|
private final int zzf;
|
|
private final int zzg;
|
|
private final boolean zzh;
|
|
private final int zzi;
|
|
|
|
public SleepClassifyEvent(int i, int i2, int i3, int i4, int i5, int i6, int i7, boolean z, int i8) {
|
|
this.zza = i;
|
|
this.zzb = i2;
|
|
this.zzc = i3;
|
|
this.zzd = i4;
|
|
this.zze = i5;
|
|
this.zzf = i6;
|
|
this.zzg = i7;
|
|
this.zzh = z;
|
|
this.zzi = i8;
|
|
}
|
|
|
|
public static List<SleepClassifyEvent> extractEvents(Intent intent) {
|
|
Preconditions.checkNotNull(intent);
|
|
if (!hasEvents(intent)) {
|
|
return Collections.emptyList();
|
|
}
|
|
ArrayList arrayList = (ArrayList) intent.getSerializableExtra("com.google.android.location.internal.EXTRA_SLEEP_CLASSIFY_RESULT");
|
|
if (arrayList == null) {
|
|
return Collections.emptyList();
|
|
}
|
|
ArrayList arrayList2 = new ArrayList(arrayList.size());
|
|
int size = arrayList.size();
|
|
for (int i = 0; i < size; i++) {
|
|
byte[] bArr = (byte[]) arrayList.get(i);
|
|
Preconditions.checkNotNull(bArr);
|
|
arrayList2.add((SleepClassifyEvent) SafeParcelableSerializer.deserializeFromBytes(bArr, CREATOR));
|
|
}
|
|
return Collections.unmodifiableList(arrayList2);
|
|
}
|
|
|
|
public static boolean hasEvents(Intent intent) {
|
|
if (intent == null) {
|
|
return false;
|
|
}
|
|
return intent.hasExtra("com.google.android.location.internal.EXTRA_SLEEP_CLASSIFY_RESULT");
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof SleepClassifyEvent)) {
|
|
return false;
|
|
}
|
|
SleepClassifyEvent sleepClassifyEvent = (SleepClassifyEvent) obj;
|
|
return this.zza == sleepClassifyEvent.zza && this.zzb == sleepClassifyEvent.zzb;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Objects.hashCode(Integer.valueOf(this.zza), Integer.valueOf(this.zzb));
|
|
}
|
|
|
|
public String toString() {
|
|
int i = this.zza;
|
|
int i2 = this.zzb;
|
|
int i3 = this.zzc;
|
|
int i4 = this.zzd;
|
|
StringBuilder sb = new StringBuilder(65);
|
|
sb.append(i);
|
|
sb.append(" Conf:");
|
|
sb.append(i2);
|
|
sb.append(" Motion:");
|
|
sb.append(i3);
|
|
sb.append(" Light:");
|
|
sb.append(i4);
|
|
return sb.toString();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
Preconditions.checkNotNull(parcel);
|
|
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
|
SafeParcelWriter.writeInt(parcel, 1, this.zza);
|
|
SafeParcelWriter.writeInt(parcel, 2, getConfidence());
|
|
SafeParcelWriter.writeInt(parcel, 3, getMotion());
|
|
SafeParcelWriter.writeInt(parcel, 4, getLight());
|
|
SafeParcelWriter.writeInt(parcel, 5, this.zze);
|
|
SafeParcelWriter.writeInt(parcel, 6, this.zzf);
|
|
SafeParcelWriter.writeInt(parcel, 7, this.zzg);
|
|
SafeParcelWriter.writeBoolean(parcel, 8, this.zzh);
|
|
SafeParcelWriter.writeInt(parcel, 9, this.zzi);
|
|
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
|
|
}
|
|
|
|
public long getTimestampMillis() {
|
|
return this.zza * 1000;
|
|
}
|
|
|
|
public int getMotion() {
|
|
return this.zzc;
|
|
}
|
|
|
|
public int getLight() {
|
|
return this.zzd;
|
|
}
|
|
|
|
public int getConfidence() {
|
|
return this.zzb;
|
|
}
|
|
}
|