Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
package androidx.core.location;
import android.annotation.SuppressLint;
import android.location.GnssStatus;
import android.location.GpsStatus;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* loaded from: classes.dex */
public abstract class GnssStatusCompat {
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_BEIDOU = 5;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_GALILEO = 6;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_GLONASS = 3;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_GPS = 1;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_IRNSS = 7;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_QZSS = 4;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_SBAS = 2;
@SuppressLint({"InlinedApi"})
public static final int CONSTELLATION_UNKNOWN = 0;
public static abstract class Callback {
public void onFirstFix(@IntRange(from = 0) int i) {
}
public void onSatelliteStatusChanged(@NonNull GnssStatusCompat gnssStatusCompat) {
}
public void onStarted() {
}
public void onStopped() {
}
}
@Retention(RetentionPolicy.SOURCE)
@RestrictTo({RestrictTo.Scope.LIBRARY})
public @interface ConstellationType {
}
@FloatRange(from = 0.0d, to = 360.0d)
public abstract float getAzimuthDegrees(@IntRange(from = 0) int i);
@FloatRange(from = 0.0d, to = 63.0d)
public abstract float getBasebandCn0DbHz(@IntRange(from = 0) int i);
@FloatRange(from = 0.0d)
public abstract float getCarrierFrequencyHz(@IntRange(from = 0) int i);
@FloatRange(from = 0.0d, to = 63.0d)
public abstract float getCn0DbHz(@IntRange(from = 0) int i);
public abstract int getConstellationType(@IntRange(from = 0) int i);
@FloatRange(from = -90.0d, to = 90.0d)
public abstract float getElevationDegrees(@IntRange(from = 0) int i);
@IntRange(from = 0)
public abstract int getSatelliteCount();
@IntRange(from = 1, to = 200)
public abstract int getSvid(@IntRange(from = 0) int i);
public abstract boolean hasAlmanacData(@IntRange(from = 0) int i);
public abstract boolean hasBasebandCn0DbHz(@IntRange(from = 0) int i);
public abstract boolean hasCarrierFrequencyHz(@IntRange(from = 0) int i);
public abstract boolean hasEphemerisData(@IntRange(from = 0) int i);
public abstract boolean usedInFix(@IntRange(from = 0) int i);
@NonNull
@RequiresApi(24)
public static GnssStatusCompat wrap(@NonNull GnssStatus gnssStatus) {
return new GnssStatusWrapper(gnssStatus);
}
@NonNull
@SuppressLint({"ReferencesDeprecated"})
public static GnssStatusCompat wrap(@NonNull GpsStatus gpsStatus) {
return new GpsStatusWrapper(gpsStatus);
}
}

View File

@@ -0,0 +1,131 @@
package androidx.core.location;
import android.location.GnssStatus;
import android.os.Build;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.core.util.Preconditions;
@RequiresApi(24)
@RestrictTo({RestrictTo.Scope.LIBRARY})
/* loaded from: classes.dex */
class GnssStatusWrapper extends GnssStatusCompat {
private final GnssStatus mWrapped;
public GnssStatusWrapper(Object obj) {
this.mWrapped = (GnssStatus) Preconditions.checkNotNull((GnssStatus) obj);
}
@Override // androidx.core.location.GnssStatusCompat
public int getSatelliteCount() {
return this.mWrapped.getSatelliteCount();
}
@Override // androidx.core.location.GnssStatusCompat
public int getConstellationType(int i) {
return this.mWrapped.getConstellationType(i);
}
@Override // androidx.core.location.GnssStatusCompat
public int getSvid(int i) {
return this.mWrapped.getSvid(i);
}
@Override // androidx.core.location.GnssStatusCompat
public float getCn0DbHz(int i) {
return this.mWrapped.getCn0DbHz(i);
}
@Override // androidx.core.location.GnssStatusCompat
public float getElevationDegrees(int i) {
return this.mWrapped.getElevationDegrees(i);
}
@Override // androidx.core.location.GnssStatusCompat
public float getAzimuthDegrees(int i) {
return this.mWrapped.getAzimuthDegrees(i);
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasEphemerisData(int i) {
return this.mWrapped.hasEphemerisData(i);
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasAlmanacData(int i) {
return this.mWrapped.hasAlmanacData(i);
}
@Override // androidx.core.location.GnssStatusCompat
public boolean usedInFix(int i) {
return this.mWrapped.usedInFix(i);
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasCarrierFrequencyHz(int i) {
return Api26Impl.hasCarrierFrequencyHz(this.mWrapped, i);
}
@Override // androidx.core.location.GnssStatusCompat
public float getCarrierFrequencyHz(int i) {
return Api26Impl.getCarrierFrequencyHz(this.mWrapped, i);
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasBasebandCn0DbHz(int i) {
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.hasBasebandCn0DbHz(this.mWrapped, i);
}
return false;
}
@Override // androidx.core.location.GnssStatusCompat
public float getBasebandCn0DbHz(int i) {
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.getBasebandCn0DbHz(this.mWrapped, i);
}
throw new UnsupportedOperationException();
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof GnssStatusWrapper) {
return this.mWrapped.equals(((GnssStatusWrapper) obj).mWrapped);
}
return false;
}
public int hashCode() {
return this.mWrapped.hashCode();
}
@RequiresApi(26)
public static class Api26Impl {
private Api26Impl() {
}
public static float getCarrierFrequencyHz(GnssStatus gnssStatus, int i) {
return gnssStatus.getCarrierFrequencyHz(i);
}
public static boolean hasCarrierFrequencyHz(GnssStatus gnssStatus, int i) {
return gnssStatus.hasCarrierFrequencyHz(i);
}
}
@RequiresApi(30)
public static class Api30Impl {
private Api30Impl() {
}
public static boolean hasBasebandCn0DbHz(GnssStatus gnssStatus, int i) {
return gnssStatus.hasBasebandCn0DbHz(i);
}
public static float getBasebandCn0DbHz(GnssStatus gnssStatus, int i) {
return gnssStatus.getBasebandCn0DbHz(i);
}
}
}

View File

@@ -0,0 +1,189 @@
package androidx.core.location;
import android.location.GpsSatellite;
import android.location.GpsStatus;
import androidx.annotation.GuardedBy;
import androidx.annotation.RestrictTo;
import androidx.core.util.Preconditions;
import com.applovin.sdk.AppLovinErrorCodes;
import java.util.Iterator;
@RestrictTo({RestrictTo.Scope.LIBRARY})
/* loaded from: classes.dex */
class GpsStatusWrapper extends GnssStatusCompat {
private static final int BEIDOU_PRN_COUNT = 35;
private static final int BEIDOU_PRN_OFFSET = 200;
private static final int GLONASS_PRN_COUNT = 24;
private static final int GLONASS_PRN_OFFSET = 64;
private static final int GPS_PRN_COUNT = 32;
private static final int GPS_PRN_OFFSET = 0;
private static final int QZSS_SVID_MAX = 200;
private static final int QZSS_SVID_MIN = 193;
private static final int SBAS_PRN_MAX = 64;
private static final int SBAS_PRN_MIN = 33;
private static final int SBAS_PRN_OFFSET = -87;
@GuardedBy("mWrapped")
private Iterator<GpsSatellite> mCachedIterator;
@GuardedBy("mWrapped")
private int mCachedIteratorPosition;
@GuardedBy("mWrapped")
private GpsSatellite mCachedSatellite;
@GuardedBy("mWrapped")
private int mCachedSatelliteCount;
private final GpsStatus mWrapped;
private static int getConstellationFromPrn(int i) {
if (i > 0 && i <= 32) {
return 1;
}
if (i >= 33 && i <= 64) {
return 2;
}
if (i > 64 && i <= 88) {
return 3;
}
if (i <= 200 || i > 235) {
return (i < QZSS_SVID_MIN || i > 200) ? 0 : 4;
}
return 5;
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasBasebandCn0DbHz(int i) {
return false;
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasCarrierFrequencyHz(int i) {
return false;
}
public GpsStatusWrapper(GpsStatus gpsStatus) {
GpsStatus gpsStatus2 = (GpsStatus) Preconditions.checkNotNull(gpsStatus);
this.mWrapped = gpsStatus2;
this.mCachedSatelliteCount = -1;
this.mCachedIterator = gpsStatus2.getSatellites().iterator();
this.mCachedIteratorPosition = -1;
this.mCachedSatellite = null;
}
@Override // androidx.core.location.GnssStatusCompat
public int getSatelliteCount() {
int i;
synchronized (this.mWrapped) {
try {
if (this.mCachedSatelliteCount == -1) {
for (GpsSatellite gpsSatellite : this.mWrapped.getSatellites()) {
this.mCachedSatelliteCount++;
}
this.mCachedSatelliteCount++;
}
i = this.mCachedSatelliteCount;
} catch (Throwable th) {
throw th;
}
}
return i;
}
@Override // androidx.core.location.GnssStatusCompat
public int getConstellationType(int i) {
return getConstellationFromPrn(getSatellite(i).getPrn());
}
@Override // androidx.core.location.GnssStatusCompat
public int getSvid(int i) {
return getSvidFromPrn(getSatellite(i).getPrn());
}
@Override // androidx.core.location.GnssStatusCompat
public float getCn0DbHz(int i) {
return getSatellite(i).getSnr();
}
@Override // androidx.core.location.GnssStatusCompat
public float getElevationDegrees(int i) {
return getSatellite(i).getElevation();
}
@Override // androidx.core.location.GnssStatusCompat
public float getAzimuthDegrees(int i) {
return getSatellite(i).getAzimuth();
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasEphemerisData(int i) {
return getSatellite(i).hasEphemeris();
}
@Override // androidx.core.location.GnssStatusCompat
public boolean hasAlmanacData(int i) {
return getSatellite(i).hasAlmanac();
}
@Override // androidx.core.location.GnssStatusCompat
public boolean usedInFix(int i) {
return getSatellite(i).usedInFix();
}
@Override // androidx.core.location.GnssStatusCompat
public float getCarrierFrequencyHz(int i) {
throw new UnsupportedOperationException();
}
@Override // androidx.core.location.GnssStatusCompat
public float getBasebandCn0DbHz(int i) {
throw new UnsupportedOperationException();
}
private GpsSatellite getSatellite(int i) {
GpsSatellite gpsSatellite;
synchronized (this.mWrapped) {
try {
if (i < this.mCachedIteratorPosition) {
this.mCachedIterator = this.mWrapped.getSatellites().iterator();
this.mCachedIteratorPosition = -1;
}
while (true) {
int i2 = this.mCachedIteratorPosition;
if (i2 >= i) {
break;
}
this.mCachedIteratorPosition = i2 + 1;
if (!this.mCachedIterator.hasNext()) {
this.mCachedSatellite = null;
break;
}
this.mCachedSatellite = this.mCachedIterator.next();
}
gpsSatellite = this.mCachedSatellite;
} catch (Throwable th) {
throw th;
}
}
return (GpsSatellite) Preconditions.checkNotNull(gpsSatellite);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof GpsStatusWrapper) {
return this.mWrapped.equals(((GpsStatusWrapper) obj).mWrapped);
}
return false;
}
public int hashCode() {
return this.mWrapped.hashCode();
}
private static int getSvidFromPrn(int i) {
int constellationFromPrn = getConstellationFromPrn(i);
return constellationFromPrn != 2 ? constellationFromPrn != 3 ? constellationFromPrn != 5 ? i : i + AppLovinErrorCodes.UNABLE_TO_PRECACHE_RESOURCES : i - 64 : i + 87;
}
}

View File

@@ -0,0 +1,624 @@
package androidx.core.location;
import android.annotation.SuppressLint;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.FloatRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.ReplaceWith;
import androidx.annotation.RequiresApi;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
/* loaded from: classes.dex */
public final class LocationCompat {
public static final String EXTRA_BEARING_ACCURACY = "bearingAccuracy";
public static final String EXTRA_IS_MOCK = "mockLocation";
public static final String EXTRA_MSL_ALTITUDE = "androidx.core.location.extra.MSL_ALTITUDE";
public static final String EXTRA_MSL_ALTITUDE_ACCURACY = "androidx.core.location.extra.MSL_ALTITUDE_ACCURACY";
public static final String EXTRA_SPEED_ACCURACY = "speedAccuracy";
public static final String EXTRA_VERTICAL_ACCURACY = "verticalAccuracy";
@Nullable
private static Field sFieldsMaskField;
@Nullable
private static Integer sHasBearingAccuracyMask;
@Nullable
private static Integer sHasSpeedAccuracyMask;
@Nullable
private static Integer sHasVerticalAccuracyMask;
@Nullable
private static Method sSetIsFromMockProviderMethod;
private LocationCompat() {
}
@ReplaceWith(expression = "location.getElapsedRealtimeNanos()")
@Deprecated
public static long getElapsedRealtimeNanos(@NonNull Location location) {
return location.getElapsedRealtimeNanos();
}
public static long getElapsedRealtimeMillis(@NonNull Location location) {
return TimeUnit.NANOSECONDS.toMillis(location.getElapsedRealtimeNanos());
}
public static boolean hasVerticalAccuracy(@NonNull Location location) {
return Api26Impl.hasVerticalAccuracy(location);
}
public static float getVerticalAccuracyMeters(@NonNull Location location) {
return Api26Impl.getVerticalAccuracyMeters(location);
}
public static void setVerticalAccuracyMeters(@NonNull Location location, float f) {
Api26Impl.setVerticalAccuracyMeters(location, f);
}
public static void removeVerticalAccuracy(@NonNull Location location) {
int i = Build.VERSION.SDK_INT;
if (i >= 33) {
Api33Impl.removeVerticalAccuracy(location);
return;
}
if (i >= 29) {
Api29Impl.removeVerticalAccuracy(location);
} else if (i >= 28) {
Api28Impl.removeVerticalAccuracy(location);
} else {
Api26Impl.removeVerticalAccuracy(location);
}
}
public static boolean hasSpeedAccuracy(@NonNull Location location) {
return Api26Impl.hasSpeedAccuracy(location);
}
public static float getSpeedAccuracyMetersPerSecond(@NonNull Location location) {
return Api26Impl.getSpeedAccuracyMetersPerSecond(location);
}
public static void setSpeedAccuracyMetersPerSecond(@NonNull Location location, float f) {
Api26Impl.setSpeedAccuracyMetersPerSecond(location, f);
}
public static void removeSpeedAccuracy(@NonNull Location location) {
int i = Build.VERSION.SDK_INT;
if (i >= 33) {
Api33Impl.removeSpeedAccuracy(location);
return;
}
if (i >= 29) {
Api29Impl.removeSpeedAccuracy(location);
} else if (i >= 28) {
Api28Impl.removeSpeedAccuracy(location);
} else {
Api26Impl.removeSpeedAccuracy(location);
}
}
public static boolean hasBearingAccuracy(@NonNull Location location) {
return Api26Impl.hasBearingAccuracy(location);
}
public static float getBearingAccuracyDegrees(@NonNull Location location) {
return Api26Impl.getBearingAccuracyDegrees(location);
}
public static void setBearingAccuracyDegrees(@NonNull Location location, float f) {
Api26Impl.setBearingAccuracyDegrees(location, f);
}
public static void removeBearingAccuracy(@NonNull Location location) {
int i = Build.VERSION.SDK_INT;
if (i >= 33) {
Api33Impl.removeBearingAccuracy(location);
return;
}
if (i >= 29) {
Api29Impl.removeBearingAccuracy(location);
} else if (i >= 28) {
Api28Impl.removeBearingAccuracy(location);
} else {
Api26Impl.removeBearingAccuracy(location);
}
}
public static double getMslAltitudeMeters(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 34) {
return Api34Impl.getMslAltitudeMeters(location);
}
return getOrCreateExtras(location).getDouble(EXTRA_MSL_ALTITUDE);
}
public static void setMslAltitudeMeters(@NonNull Location location, double d) {
if (Build.VERSION.SDK_INT >= 34) {
Api34Impl.setMslAltitudeMeters(location, d);
} else {
getOrCreateExtras(location).putDouble(EXTRA_MSL_ALTITUDE, d);
}
}
public static boolean hasMslAltitude(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 34) {
return Api34Impl.hasMslAltitude(location);
}
return containsExtra(location, EXTRA_MSL_ALTITUDE);
}
public static void removeMslAltitude(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 34) {
Api34Impl.removeMslAltitude(location);
} else {
removeExtra(location, EXTRA_MSL_ALTITUDE);
}
}
@FloatRange(from = 0.0d)
public static float getMslAltitudeAccuracyMeters(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 34) {
return Api34Impl.getMslAltitudeAccuracyMeters(location);
}
return getOrCreateExtras(location).getFloat(EXTRA_MSL_ALTITUDE_ACCURACY);
}
public static void setMslAltitudeAccuracyMeters(@NonNull Location location, @FloatRange(from = 0.0d) float f) {
if (Build.VERSION.SDK_INT >= 34) {
Api34Impl.setMslAltitudeAccuracyMeters(location, f);
} else {
getOrCreateExtras(location).putFloat(EXTRA_MSL_ALTITUDE_ACCURACY, f);
}
}
public static boolean hasMslAltitudeAccuracy(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 34) {
return Api34Impl.hasMslAltitudeAccuracy(location);
}
return containsExtra(location, EXTRA_MSL_ALTITUDE_ACCURACY);
}
public static void removeMslAltitudeAccuracy(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 34) {
Api34Impl.removeMslAltitudeAccuracy(location);
} else {
removeExtra(location, EXTRA_MSL_ALTITUDE_ACCURACY);
}
}
public static boolean isMock(@NonNull Location location) {
if (Build.VERSION.SDK_INT >= 31) {
return Api31Impl.isMock(location);
}
return location.isFromMockProvider();
}
@SuppressLint({"BanUncheckedReflection"})
public static void setMock(@NonNull Location location, boolean z) {
try {
getSetIsFromMockProviderMethod().invoke(location, Boolean.valueOf(z));
} catch (IllegalAccessException e) {
IllegalAccessError illegalAccessError = new IllegalAccessError();
illegalAccessError.initCause(e);
throw illegalAccessError;
} catch (NoSuchMethodException e2) {
NoSuchMethodError noSuchMethodError = new NoSuchMethodError();
noSuchMethodError.initCause(e2);
throw noSuchMethodError;
} catch (InvocationTargetException e3) {
throw new RuntimeException(e3);
}
}
@RequiresApi(34)
public static class Api34Impl {
private Api34Impl() {
}
public static double getMslAltitudeMeters(Location location) {
return location.getMslAltitudeMeters();
}
public static void setMslAltitudeMeters(Location location, double d) {
location.setMslAltitudeMeters(d);
}
public static boolean hasMslAltitude(Location location) {
return location.hasMslAltitude();
}
public static void removeMslAltitude(Location location) {
location.removeMslAltitude();
}
public static float getMslAltitudeAccuracyMeters(Location location) {
return location.getMslAltitudeAccuracyMeters();
}
public static void setMslAltitudeAccuracyMeters(Location location, float f) {
location.setMslAltitudeAccuracyMeters(f);
}
public static boolean hasMslAltitudeAccuracy(Location location) {
return location.hasMslAltitudeAccuracy();
}
public static void removeMslAltitudeAccuracy(Location location) {
location.removeMslAltitudeAccuracy();
}
}
@RequiresApi(33)
public static class Api33Impl {
private Api33Impl() {
}
public static void removeVerticalAccuracy(Location location) {
location.removeVerticalAccuracy();
}
public static void removeSpeedAccuracy(Location location) {
location.removeSpeedAccuracy();
}
public static void removeBearingAccuracy(Location location) {
location.removeBearingAccuracy();
}
}
@RequiresApi(29)
public static class Api29Impl {
private Api29Impl() {
}
public static void removeVerticalAccuracy(Location location) {
if (location.hasVerticalAccuracy()) {
double elapsedRealtimeUncertaintyNanos = location.getElapsedRealtimeUncertaintyNanos();
Api28Impl.removeVerticalAccuracy(location);
location.setElapsedRealtimeUncertaintyNanos(elapsedRealtimeUncertaintyNanos);
}
}
public static void removeSpeedAccuracy(Location location) {
if (location.hasSpeedAccuracy()) {
double elapsedRealtimeUncertaintyNanos = location.getElapsedRealtimeUncertaintyNanos();
Api28Impl.removeSpeedAccuracy(location);
location.setElapsedRealtimeUncertaintyNanos(elapsedRealtimeUncertaintyNanos);
}
}
public static void removeBearingAccuracy(Location location) {
if (location.hasBearingAccuracy()) {
double elapsedRealtimeUncertaintyNanos = location.getElapsedRealtimeUncertaintyNanos();
Api28Impl.removeBearingAccuracy(location);
location.setElapsedRealtimeUncertaintyNanos(elapsedRealtimeUncertaintyNanos);
}
}
}
@RequiresApi(28)
public static class Api28Impl {
private Api28Impl() {
}
public static void removeVerticalAccuracy(Location location) {
if (location.hasVerticalAccuracy()) {
String provider = location.getProvider();
long time = location.getTime();
long elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
double latitude = location.getLatitude();
double longitude = location.getLongitude();
boolean hasAltitude = location.hasAltitude();
double altitude = location.getAltitude();
boolean hasSpeed = location.hasSpeed();
float speed = location.getSpeed();
boolean hasBearing = location.hasBearing();
float bearing = location.getBearing();
boolean hasAccuracy = location.hasAccuracy();
float accuracy = location.getAccuracy();
boolean hasSpeedAccuracy = location.hasSpeedAccuracy();
float speedAccuracyMetersPerSecond = location.getSpeedAccuracyMetersPerSecond();
boolean hasBearingAccuracy = location.hasBearingAccuracy();
float bearingAccuracyDegrees = location.getBearingAccuracyDegrees();
Bundle extras = location.getExtras();
location.reset();
location.setProvider(provider);
location.setTime(time);
location.setElapsedRealtimeNanos(elapsedRealtimeNanos);
location.setLatitude(latitude);
location.setLongitude(longitude);
if (hasAltitude) {
location.setAltitude(altitude);
}
if (hasSpeed) {
location.setSpeed(speed);
}
if (hasBearing) {
location.setBearing(bearing);
}
if (hasAccuracy) {
location.setAccuracy(accuracy);
}
if (hasSpeedAccuracy) {
location.setSpeedAccuracyMetersPerSecond(speedAccuracyMetersPerSecond);
}
if (hasBearingAccuracy) {
location.setBearingAccuracyDegrees(bearingAccuracyDegrees);
}
if (extras != null) {
location.setExtras(extras);
}
}
}
public static void removeSpeedAccuracy(Location location) {
if (location.hasSpeedAccuracy()) {
String provider = location.getProvider();
long time = location.getTime();
long elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
double latitude = location.getLatitude();
double longitude = location.getLongitude();
boolean hasAltitude = location.hasAltitude();
double altitude = location.getAltitude();
boolean hasSpeed = location.hasSpeed();
float speed = location.getSpeed();
boolean hasBearing = location.hasBearing();
float bearing = location.getBearing();
boolean hasAccuracy = location.hasAccuracy();
float accuracy = location.getAccuracy();
boolean hasVerticalAccuracy = location.hasVerticalAccuracy();
float verticalAccuracyMeters = location.getVerticalAccuracyMeters();
boolean hasBearingAccuracy = location.hasBearingAccuracy();
float bearingAccuracyDegrees = location.getBearingAccuracyDegrees();
Bundle extras = location.getExtras();
location.reset();
location.setProvider(provider);
location.setTime(time);
location.setElapsedRealtimeNanos(elapsedRealtimeNanos);
location.setLatitude(latitude);
location.setLongitude(longitude);
if (hasAltitude) {
location.setAltitude(altitude);
}
if (hasSpeed) {
location.setSpeed(speed);
}
if (hasBearing) {
location.setBearing(bearing);
}
if (hasAccuracy) {
location.setAccuracy(accuracy);
}
if (hasVerticalAccuracy) {
location.setVerticalAccuracyMeters(verticalAccuracyMeters);
}
if (hasBearingAccuracy) {
location.setBearingAccuracyDegrees(bearingAccuracyDegrees);
}
if (extras != null) {
location.setExtras(extras);
}
}
}
public static void removeBearingAccuracy(Location location) {
if (location.hasBearingAccuracy()) {
String provider = location.getProvider();
long time = location.getTime();
long elapsedRealtimeNanos = location.getElapsedRealtimeNanos();
double latitude = location.getLatitude();
double longitude = location.getLongitude();
boolean hasAltitude = location.hasAltitude();
double altitude = location.getAltitude();
boolean hasSpeed = location.hasSpeed();
float speed = location.getSpeed();
boolean hasBearing = location.hasBearing();
float bearing = location.getBearing();
boolean hasAccuracy = location.hasAccuracy();
float accuracy = location.getAccuracy();
boolean hasVerticalAccuracy = location.hasVerticalAccuracy();
float verticalAccuracyMeters = location.getVerticalAccuracyMeters();
boolean hasSpeedAccuracy = location.hasSpeedAccuracy();
float speedAccuracyMetersPerSecond = location.getSpeedAccuracyMetersPerSecond();
Bundle extras = location.getExtras();
location.reset();
location.setProvider(provider);
location.setTime(time);
location.setElapsedRealtimeNanos(elapsedRealtimeNanos);
location.setLatitude(latitude);
location.setLongitude(longitude);
if (hasAltitude) {
location.setAltitude(altitude);
}
if (hasSpeed) {
location.setSpeed(speed);
}
if (hasBearing) {
location.setBearing(bearing);
}
if (hasAccuracy) {
location.setAccuracy(accuracy);
}
if (hasVerticalAccuracy) {
location.setVerticalAccuracyMeters(verticalAccuracyMeters);
}
if (hasSpeedAccuracy) {
location.setBearingAccuracyDegrees(speedAccuracyMetersPerSecond);
}
if (extras != null) {
location.setExtras(extras);
}
}
}
}
@RequiresApi(26)
public static class Api26Impl {
private Api26Impl() {
}
public static boolean hasVerticalAccuracy(Location location) {
return location.hasVerticalAccuracy();
}
public static float getVerticalAccuracyMeters(Location location) {
return location.getVerticalAccuracyMeters();
}
public static void setVerticalAccuracyMeters(Location location, float f) {
location.setVerticalAccuracyMeters(f);
}
public static void removeVerticalAccuracy(Location location) {
try {
LocationCompat.getFieldsMaskField().setByte(location, (byte) (LocationCompat.getFieldsMaskField().getByte(location) & (~LocationCompat.getHasVerticalAccuracyMask())));
} catch (IllegalAccessException | NoSuchFieldException e) {
IllegalAccessError illegalAccessError = new IllegalAccessError();
illegalAccessError.initCause(e);
throw illegalAccessError;
}
}
public static boolean hasSpeedAccuracy(Location location) {
return location.hasSpeedAccuracy();
}
public static float getSpeedAccuracyMetersPerSecond(Location location) {
return location.getSpeedAccuracyMetersPerSecond();
}
public static void setSpeedAccuracyMetersPerSecond(Location location, float f) {
location.setSpeedAccuracyMetersPerSecond(f);
}
public static void removeSpeedAccuracy(Location location) {
try {
LocationCompat.getFieldsMaskField().setByte(location, (byte) (LocationCompat.getFieldsMaskField().getByte(location) & (~LocationCompat.getHasSpeedAccuracyMask())));
} catch (IllegalAccessException e) {
IllegalAccessError illegalAccessError = new IllegalAccessError();
illegalAccessError.initCause(e);
throw illegalAccessError;
} catch (NoSuchFieldException e2) {
NoSuchFieldError noSuchFieldError = new NoSuchFieldError();
noSuchFieldError.initCause(e2);
throw noSuchFieldError;
}
}
public static boolean hasBearingAccuracy(Location location) {
return location.hasBearingAccuracy();
}
public static float getBearingAccuracyDegrees(Location location) {
return location.getBearingAccuracyDegrees();
}
public static void setBearingAccuracyDegrees(Location location, float f) {
location.setBearingAccuracyDegrees(f);
}
public static void removeBearingAccuracy(Location location) {
try {
LocationCompat.getFieldsMaskField().setByte(location, (byte) (LocationCompat.getFieldsMaskField().getByte(location) & (~LocationCompat.getHasBearingAccuracyMask())));
} catch (IllegalAccessException e) {
IllegalAccessError illegalAccessError = new IllegalAccessError();
illegalAccessError.initCause(e);
throw illegalAccessError;
} catch (NoSuchFieldException e2) {
NoSuchFieldError noSuchFieldError = new NoSuchFieldError();
noSuchFieldError.initCause(e2);
throw noSuchFieldError;
}
}
}
private static Method getSetIsFromMockProviderMethod() throws NoSuchMethodException {
if (sSetIsFromMockProviderMethod == null) {
Method declaredMethod = Location.class.getDeclaredMethod("setIsFromMockProvider", Boolean.TYPE);
sSetIsFromMockProviderMethod = declaredMethod;
declaredMethod.setAccessible(true);
}
return sSetIsFromMockProviderMethod;
}
@SuppressLint({"BlockedPrivateApi"})
public static Field getFieldsMaskField() throws NoSuchFieldException {
if (sFieldsMaskField == null) {
Field declaredField = Location.class.getDeclaredField("mFieldsMask");
sFieldsMaskField = declaredField;
declaredField.setAccessible(true);
}
return sFieldsMaskField;
}
@SuppressLint({"SoonBlockedPrivateApi"})
public static int getHasSpeedAccuracyMask() throws NoSuchFieldException, IllegalAccessException {
if (sHasSpeedAccuracyMask == null) {
Field declaredField = Location.class.getDeclaredField("HAS_SPEED_ACCURACY_MASK");
declaredField.setAccessible(true);
sHasSpeedAccuracyMask = Integer.valueOf(declaredField.getInt(null));
}
return sHasSpeedAccuracyMask.intValue();
}
@SuppressLint({"SoonBlockedPrivateApi"})
public static int getHasBearingAccuracyMask() throws NoSuchFieldException, IllegalAccessException {
if (sHasBearingAccuracyMask == null) {
Field declaredField = Location.class.getDeclaredField("HAS_BEARING_ACCURACY_MASK");
declaredField.setAccessible(true);
sHasBearingAccuracyMask = Integer.valueOf(declaredField.getInt(null));
}
return sHasBearingAccuracyMask.intValue();
}
@SuppressLint({"SoonBlockedPrivateApi"})
public static int getHasVerticalAccuracyMask() throws NoSuchFieldException, IllegalAccessException {
if (sHasVerticalAccuracyMask == null) {
Field declaredField = Location.class.getDeclaredField("HAS_VERTICAL_ACCURACY_MASK");
declaredField.setAccessible(true);
sHasVerticalAccuracyMask = Integer.valueOf(declaredField.getInt(null));
}
return sHasVerticalAccuracyMask.intValue();
}
private static Bundle getOrCreateExtras(@NonNull Location location) {
Bundle extras = location.getExtras();
if (extras != null) {
return extras;
}
location.setExtras(new Bundle());
return location.getExtras();
}
private static boolean containsExtra(@NonNull Location location, String str) {
Bundle extras = location.getExtras();
return extras != null && extras.containsKey(str);
}
private static void removeExtra(@NonNull Location location, String str) {
Bundle extras = location.getExtras();
if (extras != null) {
extras.remove(str);
if (extras.isEmpty()) {
location.setExtras(null);
}
}
}
@RequiresApi(31)
public static class Api31Impl {
private Api31Impl() {
}
public static boolean isMock(Location location) {
return location.isMock();
}
}
}

View File

@@ -0,0 +1,14 @@
package androidx.core.location;
import android.location.Location;
/* loaded from: classes.dex */
public final class LocationKt {
public static final double component1(Location location) {
return location.getLatitude();
}
public static final double component2(Location location) {
return location.getLongitude();
}
}

View File

@@ -0,0 +1,35 @@
package androidx.core.location;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.List;
/* loaded from: classes.dex */
public interface LocationListenerCompat extends LocationListener {
@Override // android.location.LocationListener
default void onFlushComplete(int i) {
}
@Override // android.location.LocationListener
default void onProviderDisabled(@NonNull String str) {
}
@Override // android.location.LocationListener
default void onProviderEnabled(@NonNull String str) {
}
@Override // android.location.LocationListener
default void onStatusChanged(@NonNull String str, int i, @Nullable Bundle bundle) {
}
@Override // android.location.LocationListener
default void onLocationChanged(@NonNull List<Location> list) {
int size = list.size();
for (int i = 0; i < size; i++) {
onLocationChanged(list.get(i));
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
package androidx.core.location;
import android.location.LocationRequest;
/* loaded from: classes.dex */
public abstract /* synthetic */ class LocationRequestCompat$$ExternalSyntheticApiModelOutline0 {
public static /* bridge */ /* synthetic */ LocationRequest m(Object obj) {
return (LocationRequest) obj;
}
}

View File

@@ -0,0 +1,319 @@
package androidx.core.location;
import android.annotation.SuppressLint;
import android.location.LocationRequest;
import android.os.Build;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.core.util.Preconditions;
import androidx.core.util.TimeUtils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public final class LocationRequestCompat {
private static final long IMPLICIT_MIN_UPDATE_INTERVAL = -1;
public static final long PASSIVE_INTERVAL = Long.MAX_VALUE;
public static final int QUALITY_BALANCED_POWER_ACCURACY = 102;
public static final int QUALITY_HIGH_ACCURACY = 100;
public static final int QUALITY_LOW_POWER = 104;
final long mDurationMillis;
final long mIntervalMillis;
final long mMaxUpdateDelayMillis;
final int mMaxUpdates;
final float mMinUpdateDistanceMeters;
final long mMinUpdateIntervalMillis;
final int mQuality;
@Retention(RetentionPolicy.SOURCE)
@RestrictTo({RestrictTo.Scope.LIBRARY})
public @interface Quality {
}
@IntRange(from = 1)
public long getDurationMillis() {
return this.mDurationMillis;
}
@IntRange(from = 0)
public long getIntervalMillis() {
return this.mIntervalMillis;
}
@IntRange(from = 0)
public long getMaxUpdateDelayMillis() {
return this.mMaxUpdateDelayMillis;
}
@IntRange(from = 1, to = 2147483647L)
public int getMaxUpdates() {
return this.mMaxUpdates;
}
@FloatRange(from = 0.0d, to = 3.4028234663852886E38d)
public float getMinUpdateDistanceMeters() {
return this.mMinUpdateDistanceMeters;
}
@IntRange(from = 0)
public long getMinUpdateIntervalMillis() {
long j = this.mMinUpdateIntervalMillis;
return j == -1 ? this.mIntervalMillis : j;
}
public int getQuality() {
return this.mQuality;
}
public int hashCode() {
int i = this.mQuality * 31;
long j = this.mIntervalMillis;
int i2 = (i + ((int) (j ^ (j >>> 32)))) * 31;
long j2 = this.mMinUpdateIntervalMillis;
return i2 + ((int) (j2 ^ (j2 >>> 32)));
}
public LocationRequestCompat(long j, int i, long j2, int i2, long j3, float f, long j4) {
this.mIntervalMillis = j;
this.mQuality = i;
this.mMinUpdateIntervalMillis = j3;
this.mDurationMillis = j2;
this.mMaxUpdates = i2;
this.mMinUpdateDistanceMeters = f;
this.mMaxUpdateDelayMillis = j4;
}
@NonNull
@RequiresApi(31)
public LocationRequest toLocationRequest() {
return Api31Impl.toLocationRequest(this);
}
@Nullable
@SuppressLint({"NewApi"})
public LocationRequest toLocationRequest(@NonNull String str) {
if (Build.VERSION.SDK_INT >= 31) {
return toLocationRequest();
}
return LocationRequestCompat$$ExternalSyntheticApiModelOutline0.m(Api19Impl.toLocationRequest(this, str));
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LocationRequestCompat)) {
return false;
}
LocationRequestCompat locationRequestCompat = (LocationRequestCompat) obj;
return this.mQuality == locationRequestCompat.mQuality && this.mIntervalMillis == locationRequestCompat.mIntervalMillis && this.mMinUpdateIntervalMillis == locationRequestCompat.mMinUpdateIntervalMillis && this.mDurationMillis == locationRequestCompat.mDurationMillis && this.mMaxUpdates == locationRequestCompat.mMaxUpdates && Float.compare(locationRequestCompat.mMinUpdateDistanceMeters, this.mMinUpdateDistanceMeters) == 0 && this.mMaxUpdateDelayMillis == locationRequestCompat.mMaxUpdateDelayMillis;
}
@NonNull
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Request[");
if (this.mIntervalMillis != Long.MAX_VALUE) {
sb.append("@");
TimeUtils.formatDuration(this.mIntervalMillis, sb);
int i = this.mQuality;
if (i == 100) {
sb.append(" HIGH_ACCURACY");
} else if (i == 102) {
sb.append(" BALANCED");
} else if (i == 104) {
sb.append(" LOW_POWER");
}
} else {
sb.append("PASSIVE");
}
if (this.mDurationMillis != Long.MAX_VALUE) {
sb.append(", duration=");
TimeUtils.formatDuration(this.mDurationMillis, sb);
}
if (this.mMaxUpdates != Integer.MAX_VALUE) {
sb.append(", maxUpdates=");
sb.append(this.mMaxUpdates);
}
long j = this.mMinUpdateIntervalMillis;
if (j != -1 && j < this.mIntervalMillis) {
sb.append(", minUpdateInterval=");
TimeUtils.formatDuration(this.mMinUpdateIntervalMillis, sb);
}
if (this.mMinUpdateDistanceMeters > 0.0d) {
sb.append(", minUpdateDistance=");
sb.append(this.mMinUpdateDistanceMeters);
}
if (this.mMaxUpdateDelayMillis / 2 > this.mIntervalMillis) {
sb.append(", maxUpdateDelay=");
TimeUtils.formatDuration(this.mMaxUpdateDelayMillis, sb);
}
sb.append(']');
return sb.toString();
}
public static final class Builder {
private long mDurationMillis;
private long mIntervalMillis;
private long mMaxUpdateDelayMillis;
private int mMaxUpdates;
private float mMinUpdateDistanceMeters;
private long mMinUpdateIntervalMillis;
private int mQuality;
@NonNull
public Builder clearMinUpdateIntervalMillis() {
this.mMinUpdateIntervalMillis = -1L;
return this;
}
public Builder(long j) {
setIntervalMillis(j);
this.mQuality = 102;
this.mDurationMillis = Long.MAX_VALUE;
this.mMaxUpdates = Integer.MAX_VALUE;
this.mMinUpdateIntervalMillis = -1L;
this.mMinUpdateDistanceMeters = 0.0f;
this.mMaxUpdateDelayMillis = 0L;
}
public Builder(@NonNull LocationRequestCompat locationRequestCompat) {
this.mIntervalMillis = locationRequestCompat.mIntervalMillis;
this.mQuality = locationRequestCompat.mQuality;
this.mDurationMillis = locationRequestCompat.mDurationMillis;
this.mMaxUpdates = locationRequestCompat.mMaxUpdates;
this.mMinUpdateIntervalMillis = locationRequestCompat.mMinUpdateIntervalMillis;
this.mMinUpdateDistanceMeters = locationRequestCompat.mMinUpdateDistanceMeters;
this.mMaxUpdateDelayMillis = locationRequestCompat.mMaxUpdateDelayMillis;
}
@NonNull
public Builder setIntervalMillis(@IntRange(from = 0) long j) {
this.mIntervalMillis = Preconditions.checkArgumentInRange(j, 0L, Long.MAX_VALUE, "intervalMillis");
return this;
}
@NonNull
public Builder setQuality(int i) {
Preconditions.checkArgument(i == 104 || i == 102 || i == 100, "quality must be a defined QUALITY constant, not %d", Integer.valueOf(i));
this.mQuality = i;
return this;
}
@NonNull
public Builder setDurationMillis(@IntRange(from = 1) long j) {
this.mDurationMillis = Preconditions.checkArgumentInRange(j, 1L, Long.MAX_VALUE, "durationMillis");
return this;
}
@NonNull
public Builder setMaxUpdates(@IntRange(from = 1, to = 2147483647L) int i) {
this.mMaxUpdates = Preconditions.checkArgumentInRange(i, 1, Integer.MAX_VALUE, "maxUpdates");
return this;
}
@NonNull
public Builder setMinUpdateIntervalMillis(@IntRange(from = 0) long j) {
this.mMinUpdateIntervalMillis = Preconditions.checkArgumentInRange(j, 0L, Long.MAX_VALUE, "minUpdateIntervalMillis");
return this;
}
@NonNull
public Builder setMinUpdateDistanceMeters(@FloatRange(from = 0.0d, to = 3.4028234663852886E38d) float f) {
this.mMinUpdateDistanceMeters = f;
this.mMinUpdateDistanceMeters = Preconditions.checkArgumentInRange(f, 0.0f, Float.MAX_VALUE, "minUpdateDistanceMeters");
return this;
}
@NonNull
public Builder setMaxUpdateDelayMillis(@IntRange(from = 0) long j) {
this.mMaxUpdateDelayMillis = j;
this.mMaxUpdateDelayMillis = Preconditions.checkArgumentInRange(j, 0L, Long.MAX_VALUE, "maxUpdateDelayMillis");
return this;
}
@NonNull
public LocationRequestCompat build() {
Preconditions.checkState((this.mIntervalMillis == Long.MAX_VALUE && this.mMinUpdateIntervalMillis == -1) ? false : true, "passive location requests must have an explicit minimum update interval");
long j = this.mIntervalMillis;
return new LocationRequestCompat(j, this.mQuality, this.mDurationMillis, this.mMaxUpdates, Math.min(this.mMinUpdateIntervalMillis, j), this.mMinUpdateDistanceMeters, this.mMaxUpdateDelayMillis);
}
}
@RequiresApi(31)
public static class Api31Impl {
private Api31Impl() {
}
public static LocationRequest toLocationRequest(LocationRequestCompat locationRequestCompat) {
return new LocationRequest.Builder(locationRequestCompat.getIntervalMillis()).setQuality(locationRequestCompat.getQuality()).setMinUpdateIntervalMillis(locationRequestCompat.getMinUpdateIntervalMillis()).setDurationMillis(locationRequestCompat.getDurationMillis()).setMaxUpdates(locationRequestCompat.getMaxUpdates()).setMinUpdateDistanceMeters(locationRequestCompat.getMinUpdateDistanceMeters()).setMaxUpdateDelayMillis(locationRequestCompat.getMaxUpdateDelayMillis()).build();
}
}
public static class Api19Impl {
private static Method sCreateFromDeprecatedProviderMethod;
private static Class<?> sLocationRequestClass;
private static Method sSetExpireInMethod;
private static Method sSetFastestIntervalMethod;
private static Method sSetNumUpdatesMethod;
private static Method sSetQualityMethod;
private Api19Impl() {
}
@SuppressLint({"BanUncheckedReflection"})
public static Object toLocationRequest(LocationRequestCompat locationRequestCompat, String str) {
try {
if (sLocationRequestClass == null) {
sLocationRequestClass = Class.forName("android.location.LocationRequest");
}
if (sCreateFromDeprecatedProviderMethod == null) {
Method declaredMethod = sLocationRequestClass.getDeclaredMethod("createFromDeprecatedProvider", String.class, Long.TYPE, Float.TYPE, Boolean.TYPE);
sCreateFromDeprecatedProviderMethod = declaredMethod;
declaredMethod.setAccessible(true);
}
Object invoke = sCreateFromDeprecatedProviderMethod.invoke(null, str, Long.valueOf(locationRequestCompat.getIntervalMillis()), Float.valueOf(locationRequestCompat.getMinUpdateDistanceMeters()), Boolean.FALSE);
if (invoke == null) {
return null;
}
if (sSetQualityMethod == null) {
Method declaredMethod2 = sLocationRequestClass.getDeclaredMethod("setQuality", Integer.TYPE);
sSetQualityMethod = declaredMethod2;
declaredMethod2.setAccessible(true);
}
sSetQualityMethod.invoke(invoke, Integer.valueOf(locationRequestCompat.getQuality()));
if (sSetFastestIntervalMethod == null) {
Method declaredMethod3 = sLocationRequestClass.getDeclaredMethod("setFastestInterval", Long.TYPE);
sSetFastestIntervalMethod = declaredMethod3;
declaredMethod3.setAccessible(true);
}
sSetFastestIntervalMethod.invoke(invoke, Long.valueOf(locationRequestCompat.getMinUpdateIntervalMillis()));
if (locationRequestCompat.getMaxUpdates() < Integer.MAX_VALUE) {
if (sSetNumUpdatesMethod == null) {
Method declaredMethod4 = sLocationRequestClass.getDeclaredMethod("setNumUpdates", Integer.TYPE);
sSetNumUpdatesMethod = declaredMethod4;
declaredMethod4.setAccessible(true);
}
sSetNumUpdatesMethod.invoke(invoke, Integer.valueOf(locationRequestCompat.getMaxUpdates()));
}
if (locationRequestCompat.getDurationMillis() < Long.MAX_VALUE) {
if (sSetExpireInMethod == null) {
Method declaredMethod5 = sLocationRequestClass.getDeclaredMethod("setExpireIn", Long.TYPE);
sSetExpireInMethod = declaredMethod5;
declaredMethod5.setAccessible(true);
}
sSetExpireInMethod.invoke(invoke, Long.valueOf(locationRequestCompat.getDurationMillis()));
}
return invoke;
} catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
return null;
}
}
}
}