mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-13 09:27:16 +01:00
145 lines
4.8 KiB
Java
145 lines
4.8 KiB
Java
package com.google.android.gms.location;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.util.Log;
|
|
import com.amazon.alexa.hho.navigation.constants.NavigationConstants;
|
|
import com.amazon.alexa.ra.core.ui.markdown.parser.formatter.MarkdownConstants;
|
|
import com.amazon.credentiallocker.CredentialConfig$$ExternalSyntheticOutline0;
|
|
import com.google.android.gms.common.internal.Objects;
|
|
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.SafeParcelable;
|
|
import java.util.Comparator;
|
|
|
|
@SafeParcelable.Class(creator = "DetectedActivityCreator")
|
|
@SafeParcelable.Reserved({1000})
|
|
/* loaded from: classes7.dex */
|
|
public class DetectedActivity extends AbstractSafeParcelable {
|
|
public static final int IN_VEHICLE = 0;
|
|
public static final int ON_BICYCLE = 1;
|
|
public static final int ON_FOOT = 2;
|
|
public static final int RUNNING = 8;
|
|
public static final int STILL = 3;
|
|
public static final int TILTING = 5;
|
|
public static final int UNKNOWN = 4;
|
|
public static final int WALKING = 7;
|
|
|
|
@SafeParcelable.Field(id = 1)
|
|
private int zzi;
|
|
|
|
@SafeParcelable.Field(id = 2)
|
|
private int zzs;
|
|
private static final Comparator<DetectedActivity> zzo = new zzh();
|
|
private static final int[] zzp = {9, 10};
|
|
private static final int[] zzq = {0, 1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19};
|
|
private static final int[] zzr = {0, 1, 2, 3, 7, 8, 16, 17};
|
|
public static final Parcelable.Creator<DetectedActivity> CREATOR = new zzi();
|
|
|
|
@SafeParcelable.Constructor
|
|
public DetectedActivity(@SafeParcelable.Param(id = 1) int i, @SafeParcelable.Param(id = 2) int i2) {
|
|
this.zzi = i;
|
|
this.zzs = i2;
|
|
}
|
|
|
|
public static void zzb(int i) {
|
|
boolean z = false;
|
|
for (int i2 : zzr) {
|
|
if (i2 == i) {
|
|
z = true;
|
|
}
|
|
}
|
|
if (z) {
|
|
return;
|
|
}
|
|
StringBuilder sb = new StringBuilder(81);
|
|
sb.append(i);
|
|
sb.append(" is not a valid DetectedActivity supported by Activity Transition API.");
|
|
Log.w("DetectedActivity", sb.toString());
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (obj != null && getClass() == obj.getClass()) {
|
|
DetectedActivity detectedActivity = (DetectedActivity) obj;
|
|
if (this.zzi == detectedActivity.zzi && this.zzs == detectedActivity.zzs) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public int getConfidence() {
|
|
return this.zzs;
|
|
}
|
|
|
|
public int getType() {
|
|
int i = this.zzi;
|
|
if (i > 19 || i < 0) {
|
|
return 4;
|
|
}
|
|
return i;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Objects.hashCode(Integer.valueOf(this.zzi), Integer.valueOf(this.zzs));
|
|
}
|
|
|
|
public String toString() {
|
|
String str;
|
|
int type = getType();
|
|
if (type == 0) {
|
|
str = "IN_VEHICLE";
|
|
} else if (type == 1) {
|
|
str = "ON_BICYCLE";
|
|
} else if (type == 2) {
|
|
str = "ON_FOOT";
|
|
} else if (type == 3) {
|
|
str = "STILL";
|
|
} else if (type == 4) {
|
|
str = "UNKNOWN";
|
|
} else if (type == 5) {
|
|
str = "TILTING";
|
|
} else if (type == 7) {
|
|
str = NavigationConstants.NavigationDirectiveTransportMode.WALKING;
|
|
} else if (type != 8) {
|
|
switch (type) {
|
|
case 16:
|
|
str = "IN_ROAD_VEHICLE";
|
|
break;
|
|
case 17:
|
|
str = "IN_RAIL_VEHICLE";
|
|
break;
|
|
case 18:
|
|
str = "IN_TWO_WHEELER_VEHICLE";
|
|
break;
|
|
case 19:
|
|
str = "IN_FOUR_WHEELER_VEHICLE";
|
|
break;
|
|
default:
|
|
str = Integer.toString(type);
|
|
break;
|
|
}
|
|
} else {
|
|
str = "RUNNING";
|
|
}
|
|
int i = this.zzs;
|
|
StringBuilder sb = new StringBuilder(CredentialConfig$$ExternalSyntheticOutline0.m(48, str));
|
|
sb.append("DetectedActivity [type=");
|
|
sb.append(str);
|
|
sb.append(", confidence=");
|
|
sb.append(i);
|
|
sb.append(MarkdownConstants.RIGHT_BRACKET);
|
|
return sb.toString();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
|
SafeParcelWriter.writeInt(parcel, 1, this.zzi);
|
|
SafeParcelWriter.writeInt(parcel, 2, this.zzs);
|
|
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
|
|
}
|
|
}
|