Split location code from framework-minus-apex to framework-location
Bug: 289776578
Test: CtsLocationCoarseTestCases CtsLocationFineTestCases CtsLocationGnssTestCases CtsLocationNoneTestCases CtsLocationPrivilegedTestCases
API-Coverage-Bug: 299124945
Change-Id: I6179e5338bf6d2cd9fe3297e841dc9610bc21160
diff --git a/location/Android.bp b/location/Android.bp
index 46dca74..cfe0e49 100644
--- a/location/Android.bp
+++ b/location/Android.bp
@@ -7,18 +7,18 @@
default_applicable_licenses: ["frameworks_base_license"],
}
-//location sources that will populate the new module
filegroup {
- name: "framework-location-nonupdatable-sources",
+ name: "framework-location-sources",
srcs: [
- "placeholder_java/android/location/Placeholder.java",
+ "java/**/*.java",
+ "java/**/*.aidl",
],
}
java_sdk_library {
name: "framework-location",
srcs: [
- ":framework-location-nonupdatable-sources",
+ ":framework-location-sources",
],
defaults: ["framework-non-updatable-unbundled-defaults"],
permitted_packages: [
diff --git a/location/api/current.txt b/location/api/current.txt
index d802177..33effdd 100644
--- a/location/api/current.txt
+++ b/location/api/current.txt
@@ -1 +1,725 @@
// Signature format: 2.0
+package android.location {
+
+ public class Address implements android.os.Parcelable {
+ ctor public Address(java.util.Locale);
+ method public void clearLatitude();
+ method public void clearLongitude();
+ method public int describeContents();
+ method public String getAddressLine(int);
+ method public String getAdminArea();
+ method public String getCountryCode();
+ method public String getCountryName();
+ method public android.os.Bundle getExtras();
+ method public String getFeatureName();
+ method public double getLatitude();
+ method public java.util.Locale getLocale();
+ method public String getLocality();
+ method public double getLongitude();
+ method public int getMaxAddressLineIndex();
+ method public String getPhone();
+ method public String getPostalCode();
+ method public String getPremises();
+ method public String getSubAdminArea();
+ method public String getSubLocality();
+ method public String getSubThoroughfare();
+ method public String getThoroughfare();
+ method public String getUrl();
+ method public boolean hasLatitude();
+ method public boolean hasLongitude();
+ method public void setAddressLine(int, String);
+ method public void setAdminArea(String);
+ method public void setCountryCode(String);
+ method public void setCountryName(String);
+ method public void setExtras(android.os.Bundle);
+ method public void setFeatureName(String);
+ method public void setLatitude(double);
+ method public void setLocality(String);
+ method public void setLongitude(double);
+ method public void setPhone(String);
+ method public void setPostalCode(String);
+ method public void setPremises(String);
+ method public void setSubAdminArea(String);
+ method public void setSubLocality(String);
+ method public void setSubThoroughfare(String);
+ method public void setThoroughfare(String);
+ method public void setUrl(String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.Address> CREATOR;
+ }
+
+ @Deprecated public class Criteria implements android.os.Parcelable {
+ ctor @Deprecated public Criteria();
+ ctor @Deprecated public Criteria(android.location.Criteria);
+ method @Deprecated public int describeContents();
+ method @Deprecated public int getAccuracy();
+ method @Deprecated public int getBearingAccuracy();
+ method @Deprecated public int getHorizontalAccuracy();
+ method @Deprecated public int getPowerRequirement();
+ method @Deprecated public int getSpeedAccuracy();
+ method @Deprecated public int getVerticalAccuracy();
+ method @Deprecated public boolean isAltitudeRequired();
+ method @Deprecated public boolean isBearingRequired();
+ method @Deprecated public boolean isCostAllowed();
+ method @Deprecated public boolean isSpeedRequired();
+ method @Deprecated public void setAccuracy(int);
+ method @Deprecated public void setAltitudeRequired(boolean);
+ method @Deprecated public void setBearingAccuracy(int);
+ method @Deprecated public void setBearingRequired(boolean);
+ method @Deprecated public void setCostAllowed(boolean);
+ method @Deprecated public void setHorizontalAccuracy(int);
+ method @Deprecated public void setPowerRequirement(int);
+ method @Deprecated public void setSpeedAccuracy(int);
+ method @Deprecated public void setSpeedRequired(boolean);
+ method @Deprecated public void setVerticalAccuracy(int);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated public static final int ACCURACY_COARSE = 2; // 0x2
+ field @Deprecated public static final int ACCURACY_FINE = 1; // 0x1
+ field @Deprecated public static final int ACCURACY_HIGH = 3; // 0x3
+ field @Deprecated public static final int ACCURACY_LOW = 1; // 0x1
+ field @Deprecated public static final int ACCURACY_MEDIUM = 2; // 0x2
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.Criteria> CREATOR;
+ field @Deprecated public static final int NO_REQUIREMENT = 0; // 0x0
+ field @Deprecated public static final int POWER_HIGH = 3; // 0x3
+ field @Deprecated public static final int POWER_LOW = 1; // 0x1
+ field @Deprecated public static final int POWER_MEDIUM = 2; // 0x2
+ }
+
+ public final class Geocoder {
+ ctor public Geocoder(@NonNull android.content.Context);
+ ctor public Geocoder(@NonNull android.content.Context, @NonNull java.util.Locale);
+ method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int) throws java.io.IOException;
+ method public void getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
+ method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int) throws java.io.IOException;
+ method public void getFromLocationName(@NonNull String, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
+ method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double) throws java.io.IOException;
+ method public void getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @NonNull android.location.Geocoder.GeocodeListener);
+ method public static boolean isPresent();
+ }
+
+ public static interface Geocoder.GeocodeListener {
+ method public default void onError(@Nullable String);
+ method public void onGeocode(@NonNull java.util.List<android.location.Address>);
+ }
+
+ public final class GnssAntennaInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f) public double getCarrierFrequencyMHz();
+ method @NonNull public android.location.GnssAntennaInfo.PhaseCenterOffset getPhaseCenterOffset();
+ method @Nullable public android.location.GnssAntennaInfo.SphericalCorrections getPhaseCenterVariationCorrections();
+ method @Nullable public android.location.GnssAntennaInfo.SphericalCorrections getSignalGainCorrections();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo> CREATOR;
+ }
+
+ public static class GnssAntennaInfo.Builder {
+ ctor @Deprecated public GnssAntennaInfo.Builder();
+ ctor public GnssAntennaInfo.Builder(double, @NonNull android.location.GnssAntennaInfo.PhaseCenterOffset);
+ ctor public GnssAntennaInfo.Builder(@NonNull android.location.GnssAntennaInfo);
+ method @NonNull public android.location.GnssAntennaInfo build();
+ method @NonNull public android.location.GnssAntennaInfo.Builder setCarrierFrequencyMHz(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.GnssAntennaInfo.Builder setPhaseCenterOffset(@NonNull android.location.GnssAntennaInfo.PhaseCenterOffset);
+ method @NonNull public android.location.GnssAntennaInfo.Builder setPhaseCenterVariationCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections);
+ method @NonNull public android.location.GnssAntennaInfo.Builder setSignalGainCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections);
+ }
+
+ public static interface GnssAntennaInfo.Listener {
+ method public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>);
+ }
+
+ public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable {
+ ctor public GnssAntennaInfo.PhaseCenterOffset(double, double, double, double, double, double);
+ method public int describeContents();
+ method @FloatRange public double getXOffsetMm();
+ method @FloatRange public double getXOffsetUncertaintyMm();
+ method @FloatRange public double getYOffsetMm();
+ method @FloatRange public double getYOffsetUncertaintyMm();
+ method @FloatRange public double getZOffsetMm();
+ method @FloatRange public double getZOffsetUncertaintyMm();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.PhaseCenterOffset> CREATOR;
+ }
+
+ public static final class GnssAntennaInfo.SphericalCorrections implements android.os.Parcelable {
+ ctor public GnssAntennaInfo.SphericalCorrections(@NonNull double[][], @NonNull double[][]);
+ method public int describeContents();
+ method @NonNull public double[][] getCorrectionUncertaintiesArray();
+ method @NonNull public double[][] getCorrectionsArray();
+ method @FloatRange(from=0.0f, to=180.0f) public double getDeltaPhi();
+ method @FloatRange(from=0.0f, to=360.0f) public double getDeltaTheta();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.SphericalCorrections> CREATOR;
+ }
+
+ public final class GnssAutomaticGainControl implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public long getCarrierFrequencyHz();
+ method public int getConstellationType();
+ method @FloatRange(from=0xffffd8f0, to=10000) public double getLevelDb();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAutomaticGainControl> CREATOR;
+ }
+
+ public static final class GnssAutomaticGainControl.Builder {
+ ctor public GnssAutomaticGainControl.Builder();
+ ctor public GnssAutomaticGainControl.Builder(@NonNull android.location.GnssAutomaticGainControl);
+ method @NonNull public android.location.GnssAutomaticGainControl build();
+ method @NonNull public android.location.GnssAutomaticGainControl.Builder setCarrierFrequencyHz(@IntRange(from=0) long);
+ method @NonNull public android.location.GnssAutomaticGainControl.Builder setConstellationType(int);
+ method @NonNull public android.location.GnssAutomaticGainControl.Builder setLevelDb(@FloatRange(from=0xffffd8f0, to=10000) double);
+ }
+
+ public final class GnssCapabilities implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.location.GnssSignalType> getGnssSignalTypes();
+ method public int hasAccumulatedDeltaRange();
+ method public boolean hasAntennaInfo();
+ method public boolean hasGeofencing();
+ method @Deprecated public boolean hasGnssAntennaInfo();
+ method public boolean hasLowPowerMode();
+ method public boolean hasMeasurementCorrections();
+ method public boolean hasMeasurementCorrectionsExcessPathLength();
+ method public boolean hasMeasurementCorrectionsForDriving();
+ method public boolean hasMeasurementCorrectionsLosSats();
+ method public boolean hasMeasurementCorrectionsReflectingPlane();
+ method public boolean hasMeasurementCorrelationVectors();
+ method public boolean hasMeasurements();
+ method public boolean hasMsa();
+ method public boolean hasMsb();
+ method public boolean hasNavigationMessages();
+ method public boolean hasOnDemandTime();
+ method public boolean hasPowerMultibandAcquisition();
+ method public boolean hasPowerMultibandTracking();
+ method public boolean hasPowerOtherModes();
+ method public boolean hasPowerSinglebandAcquisition();
+ method public boolean hasPowerSinglebandTracking();
+ method public boolean hasPowerTotal();
+ method public boolean hasSatelliteBlocklist();
+ method public boolean hasSatellitePvt();
+ method public boolean hasScheduling();
+ method public boolean hasSingleShotFix();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CAPABILITY_SUPPORTED = 1; // 0x1
+ field public static final int CAPABILITY_UNKNOWN = 0; // 0x0
+ field public static final int CAPABILITY_UNSUPPORTED = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssCapabilities> CREATOR;
+ }
+
+ public static final class GnssCapabilities.Builder {
+ ctor public GnssCapabilities.Builder();
+ ctor public GnssCapabilities.Builder(@NonNull android.location.GnssCapabilities);
+ method @NonNull public android.location.GnssCapabilities build();
+ method @NonNull public android.location.GnssCapabilities.Builder setGnssSignalTypes(@NonNull java.util.List<android.location.GnssSignalType>);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasAccumulatedDeltaRange(int);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasAntennaInfo(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasGeofencing(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasLowPowerMode(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrections(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsExcessPathLength(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsForDriving(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsLosSats(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsReflectingPlane(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrelationVectors(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurements(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMsa(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasMsb(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasNavigationMessages(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasOnDemandTime(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerMultibandAcquisition(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerMultibandTracking(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerOtherModes(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerSinglebandAcquisition(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerSinglebandTracking(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasPowerTotal(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSatelliteBlocklist(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSatellitePvt(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasScheduling(boolean);
+ method @NonNull public android.location.GnssCapabilities.Builder setHasSingleShotFix(boolean);
+ }
+
+ public final class GnssClock implements android.os.Parcelable {
+ method public int describeContents();
+ method public double getBiasNanos();
+ method @FloatRange(from=0.0f) public double getBiasUncertaintyNanos();
+ method public double getDriftNanosPerSecond();
+ method @FloatRange(from=0.0f) public double getDriftUncertaintyNanosPerSecond();
+ method public long getElapsedRealtimeNanos();
+ method @FloatRange(from=0.0f) public double getElapsedRealtimeUncertaintyNanos();
+ method public long getFullBiasNanos();
+ method public int getHardwareClockDiscontinuityCount();
+ method public int getLeapSecond();
+ method @FloatRange(from=0.0) public double getReferenceCarrierFrequencyHzForIsb();
+ method @NonNull public String getReferenceCodeTypeForIsb();
+ method public int getReferenceConstellationTypeForIsb();
+ method public long getTimeNanos();
+ method @FloatRange(from=0.0f) public double getTimeUncertaintyNanos();
+ method public boolean hasBiasNanos();
+ method public boolean hasBiasUncertaintyNanos();
+ method public boolean hasDriftNanosPerSecond();
+ method public boolean hasDriftUncertaintyNanosPerSecond();
+ method public boolean hasElapsedRealtimeNanos();
+ method public boolean hasElapsedRealtimeUncertaintyNanos();
+ method public boolean hasFullBiasNanos();
+ method public boolean hasLeapSecond();
+ method public boolean hasReferenceCarrierFrequencyHzForIsb();
+ method public boolean hasReferenceCodeTypeForIsb();
+ method public boolean hasReferenceConstellationTypeForIsb();
+ method public boolean hasTimeUncertaintyNanos();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssClock> CREATOR;
+ }
+
+ public final class GnssMeasurement implements android.os.Parcelable {
+ method public int describeContents();
+ method public double getAccumulatedDeltaRangeMeters();
+ method public int getAccumulatedDeltaRangeState();
+ method public double getAccumulatedDeltaRangeUncertaintyMeters();
+ method @Deprecated public double getAutomaticGainControlLevelDb();
+ method @FloatRange(from=0, to=63) public double getBasebandCn0DbHz();
+ method @Deprecated public long getCarrierCycles();
+ method public float getCarrierFrequencyHz();
+ method @Deprecated public double getCarrierPhase();
+ method @Deprecated public double getCarrierPhaseUncertainty();
+ method @FloatRange(from=0, to=63) public double getCn0DbHz();
+ method @NonNull public String getCodeType();
+ method public int getConstellationType();
+ method public double getFullInterSignalBiasNanos();
+ method @FloatRange(from=0.0) public double getFullInterSignalBiasUncertaintyNanos();
+ method public int getMultipathIndicator();
+ method public double getPseudorangeRateMetersPerSecond();
+ method public double getPseudorangeRateUncertaintyMetersPerSecond();
+ method public long getReceivedSvTimeNanos();
+ method public long getReceivedSvTimeUncertaintyNanos();
+ method public double getSatelliteInterSignalBiasNanos();
+ method @FloatRange(from=0.0) public double getSatelliteInterSignalBiasUncertaintyNanos();
+ method public double getSnrInDb();
+ method public int getState();
+ method public int getSvid();
+ method public double getTimeOffsetNanos();
+ method @Deprecated public boolean hasAutomaticGainControlLevelDb();
+ method public boolean hasBasebandCn0DbHz();
+ method @Deprecated public boolean hasCarrierCycles();
+ method public boolean hasCarrierFrequencyHz();
+ method @Deprecated public boolean hasCarrierPhase();
+ method @Deprecated public boolean hasCarrierPhaseUncertainty();
+ method public boolean hasCodeType();
+ method public boolean hasFullInterSignalBiasNanos();
+ method public boolean hasFullInterSignalBiasUncertaintyNanos();
+ method public boolean hasSatelliteInterSignalBiasNanos();
+ method public boolean hasSatelliteInterSignalBiasUncertaintyNanos();
+ method public boolean hasSnrInDb();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int ADR_STATE_CYCLE_SLIP = 4; // 0x4
+ field public static final int ADR_STATE_HALF_CYCLE_REPORTED = 16; // 0x10
+ field public static final int ADR_STATE_HALF_CYCLE_RESOLVED = 8; // 0x8
+ field public static final int ADR_STATE_RESET = 2; // 0x2
+ field public static final int ADR_STATE_UNKNOWN = 0; // 0x0
+ field public static final int ADR_STATE_VALID = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurement> CREATOR;
+ field public static final int MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
+ field public static final int MULTIPATH_INDICATOR_NOT_DETECTED = 2; // 0x2
+ field public static final int MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
+ field public static final int STATE_2ND_CODE_LOCK = 65536; // 0x10000
+ field public static final int STATE_BDS_D2_BIT_SYNC = 256; // 0x100
+ field public static final int STATE_BDS_D2_SUBFRAME_SYNC = 512; // 0x200
+ field public static final int STATE_BIT_SYNC = 2; // 0x2
+ field public static final int STATE_CODE_LOCK = 1; // 0x1
+ field public static final int STATE_GAL_E1BC_CODE_LOCK = 1024; // 0x400
+ field public static final int STATE_GAL_E1B_PAGE_SYNC = 4096; // 0x1000
+ field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800
+ field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40
+ field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80
+ field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000
+ field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10
+ field public static final int STATE_SBAS_SYNC = 8192; // 0x2000
+ field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4
+ field public static final int STATE_SYMBOL_SYNC = 32; // 0x20
+ field public static final int STATE_TOW_DECODED = 8; // 0x8
+ field public static final int STATE_TOW_KNOWN = 16384; // 0x4000
+ field public static final int STATE_UNKNOWN = 0; // 0x0
+ }
+
+ public final class GnssMeasurementRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public int getIntervalMillis();
+ method public boolean isFullTracking();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementRequest> CREATOR;
+ field public static final int PASSIVE_INTERVAL = 2147483647; // 0x7fffffff
+ }
+
+ public static final class GnssMeasurementRequest.Builder {
+ ctor public GnssMeasurementRequest.Builder();
+ ctor public GnssMeasurementRequest.Builder(@NonNull android.location.GnssMeasurementRequest);
+ method @NonNull public android.location.GnssMeasurementRequest build();
+ method @NonNull public android.location.GnssMeasurementRequest.Builder setFullTracking(boolean);
+ method @NonNull public android.location.GnssMeasurementRequest.Builder setIntervalMillis(@IntRange(from=0) int);
+ }
+
+ public final class GnssMeasurementsEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.location.GnssClock getClock();
+ method @NonNull public java.util.Collection<android.location.GnssAutomaticGainControl> getGnssAutomaticGainControls();
+ method @NonNull public java.util.Collection<android.location.GnssMeasurement> getMeasurements();
+ method public boolean hasIsFullTracking();
+ method public boolean isFullTracking();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementsEvent> CREATOR;
+ }
+
+ public static final class GnssMeasurementsEvent.Builder {
+ ctor public GnssMeasurementsEvent.Builder();
+ ctor public GnssMeasurementsEvent.Builder(@NonNull android.location.GnssMeasurementsEvent);
+ method @NonNull public android.location.GnssMeasurementsEvent build();
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder clearIsFullTracking();
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setClock(@NonNull android.location.GnssClock);
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setGnssAutomaticGainControls(@NonNull java.util.Collection<android.location.GnssAutomaticGainControl>);
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setIsFullTracking(boolean);
+ method @NonNull public android.location.GnssMeasurementsEvent.Builder setMeasurements(@NonNull java.util.Collection<android.location.GnssMeasurement>);
+ }
+
+ public abstract static class GnssMeasurementsEvent.Callback {
+ ctor public GnssMeasurementsEvent.Callback();
+ method public void onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent);
+ method @Deprecated public void onStatusChanged(int);
+ field @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_ALLOWED = 3; // 0x3
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ public final class GnssNavigationMessage implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public byte[] getData();
+ method @IntRange(from=0xffffffff, to=120) public int getMessageId();
+ method public int getStatus();
+ method @IntRange(from=1) public int getSubmessageId();
+ method @IntRange(from=1, to=200) public int getSvid();
+ method public int getType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
+ field public static final int STATUS_PARITY_PASSED = 1; // 0x1
+ field public static final int STATUS_PARITY_REBUILT = 2; // 0x2
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ field public static final int TYPE_BDS_CNAV1 = 1283; // 0x503
+ field public static final int TYPE_BDS_CNAV2 = 1284; // 0x504
+ field public static final int TYPE_BDS_D1 = 1281; // 0x501
+ field public static final int TYPE_BDS_D2 = 1282; // 0x502
+ field public static final int TYPE_GAL_F = 1538; // 0x602
+ field public static final int TYPE_GAL_I = 1537; // 0x601
+ field public static final int TYPE_GLO_L1CA = 769; // 0x301
+ field public static final int TYPE_GPS_CNAV2 = 260; // 0x104
+ field public static final int TYPE_GPS_L1CA = 257; // 0x101
+ field public static final int TYPE_GPS_L2CNAV = 258; // 0x102
+ field public static final int TYPE_GPS_L5CNAV = 259; // 0x103
+ field public static final int TYPE_IRN_L5CA = 1793; // 0x701
+ field public static final int TYPE_QZS_L1CA = 1025; // 0x401
+ field public static final int TYPE_SBS = 513; // 0x201
+ field public static final int TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ public abstract static class GnssNavigationMessage.Callback {
+ ctor public GnssNavigationMessage.Callback();
+ method public void onGnssNavigationMessageReceived(android.location.GnssNavigationMessage);
+ method @Deprecated public void onStatusChanged(int);
+ field @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ public final class GnssSignalType implements android.os.Parcelable {
+ method @NonNull public static android.location.GnssSignalType create(int, @FloatRange(from=0.0f, fromInclusive=false) double, @NonNull String);
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getCarrierFrequencyHz();
+ method @NonNull public String getCodeType();
+ method public int getConstellationType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssSignalType> CREATOR;
+ }
+
+ public final class GnssStatus implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0, to=360) public float getAzimuthDegrees(@IntRange(from=0) int);
+ method @FloatRange(from=0, to=63) public float getBasebandCn0DbHz(@IntRange(from=0) int);
+ method @FloatRange(from=0) public float getCarrierFrequencyHz(@IntRange(from=0) int);
+ method @FloatRange(from=0, to=63) public float getCn0DbHz(@IntRange(from=0) int);
+ method public int getConstellationType(@IntRange(from=0) int);
+ method @FloatRange(from=0xffffffa6, to=90) public float getElevationDegrees(@IntRange(from=0) int);
+ method @IntRange(from=0) public int getSatelliteCount();
+ method @IntRange(from=1, to=206) public int getSvid(@IntRange(from=0) int);
+ method public boolean hasAlmanacData(@IntRange(from=0) int);
+ method public boolean hasBasebandCn0DbHz(@IntRange(from=0) int);
+ method public boolean hasCarrierFrequencyHz(@IntRange(from=0) int);
+ method public boolean hasEphemerisData(@IntRange(from=0) int);
+ method public boolean usedInFix(@IntRange(from=0) int);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
+ field public static final int CONSTELLATION_GALILEO = 6; // 0x6
+ field public static final int CONSTELLATION_GLONASS = 3; // 0x3
+ field public static final int CONSTELLATION_GPS = 1; // 0x1
+ field public static final int CONSTELLATION_IRNSS = 7; // 0x7
+ field public static final int CONSTELLATION_QZSS = 4; // 0x4
+ field public static final int CONSTELLATION_SBAS = 2; // 0x2
+ field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssStatus> CREATOR;
+ }
+
+ public static final class GnssStatus.Builder {
+ ctor public GnssStatus.Builder();
+ method @NonNull public android.location.GnssStatus.Builder addSatellite(int, @IntRange(from=1, to=200) int, @FloatRange(from=0, to=63) float, @FloatRange(from=0xffffffa6, to=90) float, @FloatRange(from=0, to=360) float, boolean, boolean, boolean, boolean, @FloatRange(from=0) float, boolean, @FloatRange(from=0, to=63) float);
+ method @NonNull public android.location.GnssStatus build();
+ method @NonNull public android.location.GnssStatus.Builder clearSatellites();
+ }
+
+ public abstract static class GnssStatus.Callback {
+ ctor public GnssStatus.Callback();
+ method public void onFirstFix(int);
+ method public void onSatelliteStatusChanged(@NonNull android.location.GnssStatus);
+ method public void onStarted();
+ method public void onStopped();
+ }
+
+ @Deprecated public final class GpsSatellite {
+ method @Deprecated public float getAzimuth();
+ method @Deprecated public float getElevation();
+ method @Deprecated public int getPrn();
+ method @Deprecated public float getSnr();
+ method @Deprecated public boolean hasAlmanac();
+ method @Deprecated public boolean hasEphemeris();
+ method @Deprecated public boolean usedInFix();
+ }
+
+ @Deprecated public final class GpsStatus {
+ method @Deprecated @NonNull public static android.location.GpsStatus create(@NonNull android.location.GnssStatus, int);
+ method @Deprecated public int getMaxSatellites();
+ method @Deprecated public Iterable<android.location.GpsSatellite> getSatellites();
+ method @Deprecated public int getTimeToFirstFix();
+ field @Deprecated public static final int GPS_EVENT_FIRST_FIX = 3; // 0x3
+ field @Deprecated public static final int GPS_EVENT_SATELLITE_STATUS = 4; // 0x4
+ field @Deprecated public static final int GPS_EVENT_STARTED = 1; // 0x1
+ field @Deprecated public static final int GPS_EVENT_STOPPED = 2; // 0x2
+ }
+
+ @Deprecated public static interface GpsStatus.Listener {
+ method @Deprecated public void onGpsStatusChanged(int);
+ }
+
+ @Deprecated public static interface GpsStatus.NmeaListener {
+ method @Deprecated public void onNmeaReceived(long, String);
+ }
+
+ public interface LocationListener {
+ method public default void onFlushComplete(int);
+ method public void onLocationChanged(@NonNull android.location.Location);
+ method public default void onLocationChanged(@NonNull java.util.List<android.location.Location>);
+ method public default void onProviderDisabled(@NonNull String);
+ method public default void onProviderEnabled(@NonNull String);
+ method @Deprecated public default void onStatusChanged(String, int, android.os.Bundle);
+ }
+
+ public class LocationManager {
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addGpsStatusListener(android.location.GpsStatus.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.GpsStatus.NmeaListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.OnNmeaMessageListener);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull android.location.OnNmeaMessageListener, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean addNmeaListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.OnNmeaMessageListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void addProximityAlert(double, double, float, long, @NonNull android.app.PendingIntent);
+ method public void addTestProvider(@NonNull String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int);
+ method public void addTestProvider(@NonNull String, @NonNull android.location.provider.ProviderProperties);
+ method public void addTestProvider(@NonNull String, @NonNull android.location.provider.ProviderProperties, @NonNull java.util.Set<java.lang.String>);
+ method @Deprecated public void clearTestProviderEnabled(@NonNull String);
+ method @Deprecated public void clearTestProviderLocation(@NonNull String);
+ method @Deprecated public void clearTestProviderStatus(@NonNull String);
+ method @NonNull public java.util.List<java.lang.String> getAllProviders();
+ method @Deprecated @Nullable public String getBestProvider(@NonNull android.location.Criteria, boolean);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull String, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull String, @NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @Nullable public java.util.List<android.location.GnssAntennaInfo> getGnssAntennaInfos();
+ method @NonNull public android.location.GnssCapabilities getGnssCapabilities();
+ method @Nullable public String getGnssHardwareModelName();
+ method public int getGnssYearOfHardware();
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.location.GpsStatus getGpsStatus(@Nullable android.location.GpsStatus);
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String);
+ method @Deprecated @Nullable public android.location.LocationProvider getProvider(@NonNull String);
+ method @Nullable public android.location.provider.ProviderProperties getProviderProperties(@NonNull String);
+ method @NonNull public java.util.List<java.lang.String> getProviders(boolean);
+ method @Deprecated @NonNull public java.util.List<java.lang.String> getProviders(@NonNull android.location.Criteria, boolean);
+ method public boolean hasProvider(@NonNull String);
+ method public boolean isLocationEnabled();
+ method public boolean isProviderEnabled(@NonNull String);
+ method public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @Deprecated public boolean registerGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssNavigationMessageCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssNavigationMessage.Callback);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull android.location.GnssStatus.Callback);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull android.location.GnssStatus.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssStatusCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssStatus.Callback);
+ method @Deprecated public void removeGpsStatusListener(android.location.GpsStatus.Listener);
+ method @Deprecated public void removeNmeaListener(@NonNull android.location.GpsStatus.NmeaListener);
+ method public void removeNmeaListener(@NonNull android.location.OnNmeaMessageListener);
+ method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeProximityAlert(@NonNull android.app.PendingIntent);
+ method public void removeTestProvider(@NonNull String);
+ method @RequiresPermission(anyOf={"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, apis="..22") public void removeUpdates(@NonNull android.location.LocationListener);
+ method public void removeUpdates(@NonNull android.app.PendingIntent);
+ method public void requestFlush(@NonNull String, @NonNull android.location.LocationListener, int);
+ method public void requestFlush(@NonNull String, @NonNull android.app.PendingIntent, int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
+ method public boolean sendExtraCommand(@NonNull String, @NonNull String, @Nullable android.os.Bundle);
+ method public void setTestProviderEnabled(@NonNull String, boolean);
+ method public void setTestProviderLocation(@NonNull String, @NonNull android.location.Location);
+ method @Deprecated public void setTestProviderStatus(@NonNull String, int, @Nullable android.os.Bundle, long);
+ method public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener);
+ method public void unregisterGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback);
+ method public void unregisterGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback);
+ method public void unregisterGnssStatusCallback(@NonNull android.location.GnssStatus.Callback);
+ field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED";
+ field public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES";
+ field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED";
+ field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED";
+ field public static final String EXTRA_PROVIDER_NAME = "android.location.extra.PROVIDER_NAME";
+ field public static final String FUSED_PROVIDER = "fused";
+ field public static final String GPS_PROVIDER = "gps";
+ field public static final String KEY_FLUSH_COMPLETE = "flushComplete";
+ field public static final String KEY_LOCATIONS = "locations";
+ field public static final String KEY_LOCATION_CHANGED = "location";
+ field public static final String KEY_PROVIDER_ENABLED = "providerEnabled";
+ field public static final String KEY_PROXIMITY_ENTERING = "entering";
+ field @Deprecated public static final String KEY_STATUS_CHANGED = "status";
+ field public static final String MODE_CHANGED_ACTION = "android.location.MODE_CHANGED";
+ field public static final String NETWORK_PROVIDER = "network";
+ field public static final String PASSIVE_PROVIDER = "passive";
+ field public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED";
+ }
+
+ @Deprecated public class LocationProvider {
+ method @Deprecated public int getAccuracy();
+ method @Deprecated public String getName();
+ method @Deprecated public int getPowerRequirement();
+ method @Deprecated public boolean hasMonetaryCost();
+ method @Deprecated public boolean meetsCriteria(android.location.Criteria);
+ method @Deprecated public boolean requiresCell();
+ method @Deprecated public boolean requiresNetwork();
+ method @Deprecated public boolean requiresSatellite();
+ method @Deprecated public boolean supportsAltitude();
+ method @Deprecated public boolean supportsBearing();
+ method @Deprecated public boolean supportsSpeed();
+ field @Deprecated public static final int AVAILABLE = 2; // 0x2
+ field @Deprecated public static final int OUT_OF_SERVICE = 0; // 0x0
+ field @Deprecated public static final int TEMPORARILY_UNAVAILABLE = 1; // 0x1
+ }
+
+ public final class LocationRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=1) public long getDurationMillis();
+ method @IntRange(from=0) public long getIntervalMillis();
+ method @IntRange(from=0) public long getMaxUpdateDelayMillis();
+ method @IntRange(from=1, to=java.lang.Integer.MAX_VALUE) public int getMaxUpdates();
+ method @FloatRange(from=0, to=java.lang.Float.MAX_VALUE) public float getMinUpdateDistanceMeters();
+ method @IntRange(from=0) public long getMinUpdateIntervalMillis();
+ method public int getQuality();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.LocationRequest> CREATOR;
+ field public static final long PASSIVE_INTERVAL = 9223372036854775807L; // 0x7fffffffffffffffL
+ field public static final int QUALITY_BALANCED_POWER_ACCURACY = 102; // 0x66
+ field public static final int QUALITY_HIGH_ACCURACY = 100; // 0x64
+ field public static final int QUALITY_LOW_POWER = 104; // 0x68
+ }
+
+ public static final class LocationRequest.Builder {
+ ctor public LocationRequest.Builder(long);
+ ctor public LocationRequest.Builder(@NonNull android.location.LocationRequest);
+ method @NonNull public android.location.LocationRequest build();
+ method @NonNull public android.location.LocationRequest.Builder clearMinUpdateIntervalMillis();
+ method @NonNull public android.location.LocationRequest.Builder setDurationMillis(@IntRange(from=1) long);
+ method @NonNull public android.location.LocationRequest.Builder setIntervalMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.LocationRequest.Builder setMaxUpdateDelayMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.LocationRequest.Builder setMaxUpdates(@IntRange(from=1, to=java.lang.Integer.MAX_VALUE) int);
+ method @NonNull public android.location.LocationRequest.Builder setMinUpdateDistanceMeters(@FloatRange(from=0, to=java.lang.Float.MAX_VALUE) float);
+ method @NonNull public android.location.LocationRequest.Builder setMinUpdateIntervalMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.LocationRequest.Builder setQuality(int);
+ }
+
+ public interface OnNmeaMessageListener {
+ method public void onNmeaMessage(String, long);
+ }
+
+ public abstract class SettingInjectorService extends android.app.Service {
+ ctor public SettingInjectorService(String);
+ method public final android.os.IBinder onBind(android.content.Intent);
+ method protected abstract boolean onGetEnabled();
+ method protected abstract String onGetSummary();
+ method public final void onStart(android.content.Intent, int);
+ method public final int onStartCommand(android.content.Intent, int, int);
+ method public static final void refreshSettings(@NonNull android.content.Context);
+ field public static final String ACTION_INJECTED_SETTING_CHANGED = "android.location.InjectedSettingChanged";
+ field public static final String ACTION_SERVICE_INTENT = "android.location.SettingInjectorService";
+ field public static final String ATTRIBUTES_NAME = "injected-location-setting";
+ field public static final String META_DATA_NAME = "android.location.SettingInjectorService";
+ }
+
+}
+
+package android.location.altitude {
+
+ public final class AltitudeConverter {
+ ctor public AltitudeConverter();
+ method @WorkerThread public void addMslAltitudeToLocation(@NonNull android.content.Context, @NonNull android.location.Location) throws java.io.IOException;
+ }
+
+}
+
+package android.location.provider {
+
+ public final class ProviderProperties implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAccuracy();
+ method public int getPowerUsage();
+ method public boolean hasAltitudeSupport();
+ method public boolean hasBearingSupport();
+ method public boolean hasCellRequirement();
+ method public boolean hasMonetaryCost();
+ method public boolean hasNetworkRequirement();
+ method public boolean hasSatelliteRequirement();
+ method public boolean hasSpeedSupport();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int ACCURACY_COARSE = 2; // 0x2
+ field public static final int ACCURACY_FINE = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ProviderProperties> CREATOR;
+ field public static final int POWER_USAGE_HIGH = 3; // 0x3
+ field public static final int POWER_USAGE_LOW = 1; // 0x1
+ field public static final int POWER_USAGE_MEDIUM = 2; // 0x2
+ }
+
+ public static final class ProviderProperties.Builder {
+ ctor public ProviderProperties.Builder();
+ ctor public ProviderProperties.Builder(@NonNull android.location.provider.ProviderProperties);
+ method @NonNull public android.location.provider.ProviderProperties build();
+ method @NonNull public android.location.provider.ProviderProperties.Builder setAccuracy(int);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasAltitudeSupport(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasBearingSupport(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasCellRequirement(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasMonetaryCost(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasNetworkRequirement(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasSatelliteRequirement(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setHasSpeedSupport(boolean);
+ method @NonNull public android.location.provider.ProviderProperties.Builder setPowerUsage(int);
+ }
+
+}
+
diff --git a/location/api/module-lib-current.txt b/location/api/module-lib-current.txt
index d802177..8c14b864 100644
--- a/location/api/module-lib-current.txt
+++ b/location/api/module-lib-current.txt
@@ -1 +1,11 @@
// Signature format: 2.0
+package android.location {
+
+ public class LocationManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public boolean injectLocation(@NonNull android.location.Location);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_AUTOMOTIVE_GNSS) public boolean isAutomotiveGnssSuspended();
+ method @RequiresPermission(android.Manifest.permission.CONTROL_AUTOMOTIVE_GNSS) public void setAutomotiveGnssSuspended(boolean);
+ }
+
+}
+
diff --git a/location/api/module-lib-lint-baseline.txt b/location/api/module-lib-lint-baseline.txt
new file mode 100644
index 0000000..7cd6a86
--- /dev/null
+++ b/location/api/module-lib-lint-baseline.txt
@@ -0,0 +1,13 @@
+// Baseline format: 1.0
+SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.location.LocationManager.addNmeaListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(android.location.LocationRequest, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
diff --git a/location/api/system-current.txt b/location/api/system-current.txt
index d802177..a1d6ab5 100644
--- a/location/api/system-current.txt
+++ b/location/api/system-current.txt
@@ -1 +1,646 @@
// Signature format: 2.0
+package android.location {
+
+ public abstract class BatchedLocationCallback {
+ ctor public BatchedLocationCallback();
+ method public void onLocationBatch(java.util.List<android.location.Location>);
+ }
+
+ public final class CorrelationVector implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f) public double getFrequencyOffsetMetersPerSecond();
+ method @NonNull public int[] getMagnitude();
+ method @FloatRange(from=0.0f) public double getSamplingStartMeters();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getSamplingWidthMeters();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.CorrelationVector> CREATOR;
+ }
+
+ public static final class CorrelationVector.Builder {
+ ctor public CorrelationVector.Builder();
+ method @NonNull public android.location.CorrelationVector build();
+ method @NonNull public android.location.CorrelationVector.Builder setFrequencyOffsetMetersPerSecond(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.CorrelationVector.Builder setMagnitude(@NonNull int[]);
+ method @NonNull public android.location.CorrelationVector.Builder setSamplingStartMeters(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.CorrelationVector.Builder setSamplingWidthMeters(@FloatRange(from=0.0f, fromInclusive=false) double);
+ }
+
+ public final class Country implements android.os.Parcelable {
+ ctor public Country(@NonNull String, int);
+ method public int describeContents();
+ method @NonNull public String getCountryCode();
+ method public int getSource();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int COUNTRY_SOURCE_LOCALE = 3; // 0x3
+ field public static final int COUNTRY_SOURCE_LOCATION = 1; // 0x1
+ field public static final int COUNTRY_SOURCE_NETWORK = 0; // 0x0
+ field public static final int COUNTRY_SOURCE_SIM = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.Country> CREATOR;
+ }
+
+ public class CountryDetector {
+ method public void registerCountryDetectorCallback(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Country>);
+ method public void unregisterCountryDetectorCallback(@NonNull java.util.function.Consumer<android.location.Country>);
+ }
+
+ public final class GnssCapabilities implements android.os.Parcelable {
+ method @Deprecated public boolean hasMeasurementCorrectionsReflectingPane();
+ method @Deprecated public boolean hasNavMessages();
+ method @Deprecated public boolean hasSatelliteBlacklist();
+ }
+
+ public final class GnssExcessPathInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f) public float getAttenuationDb();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
+ method @NonNull public android.location.GnssReflectingPlane getReflectingPlane();
+ method public boolean hasAttenuation();
+ method public boolean hasExcessPathLength();
+ method public boolean hasExcessPathLengthUncertainty();
+ method public boolean hasReflectingPlane();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssExcessPathInfo> CREATOR;
+ }
+
+ public static final class GnssExcessPathInfo.Builder {
+ ctor public GnssExcessPathInfo.Builder();
+ method @NonNull public android.location.GnssExcessPathInfo build();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder clearAttenuationDb();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder clearExcessPathLengthMeters();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder clearExcessPathLengthUncertaintyMeters();
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setAttenuationDb(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssExcessPathInfo.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
+ }
+
+ public final class GnssMeasurement implements android.os.Parcelable {
+ method @Nullable public java.util.Collection<android.location.CorrelationVector> getCorrelationVectors();
+ method @Nullable public android.location.SatellitePvt getSatellitePvt();
+ method public boolean hasCorrelationVectors();
+ method public boolean hasSatellitePvt();
+ }
+
+ public final class GnssMeasurementCorrections implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+ method @FloatRange(from=0.0f, to=360.0f) public float getEnvironmentBearingDegrees();
+ method @FloatRange(from=0.0f, to=180.0f) public float getEnvironmentBearingUncertaintyDegrees();
+ method @FloatRange(from=0.0f) public double getHorizontalPositionUncertaintyMeters();
+ method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
+ method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
+ method @NonNull public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
+ method @IntRange(from=0) public long getToaGpsNanosecondsOfWeek();
+ method @FloatRange(from=0.0f) public double getVerticalPositionUncertaintyMeters();
+ method public boolean hasEnvironmentBearing();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
+ }
+
+ public static final class GnssMeasurementCorrections.Builder {
+ ctor public GnssMeasurementCorrections.Builder();
+ method @NonNull public android.location.GnssMeasurementCorrections build();
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingDegrees(@FloatRange(from=0.0f, to=360.0f) float);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingUncertaintyDegrees(@FloatRange(from=0.0f, to=180.0f) float);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@NonNull java.util.List<android.location.GnssSingleSatCorrection>);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(@IntRange(from=0) long);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
+ }
+
+ public final class GnssMeasurementRequest implements android.os.Parcelable {
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isCorrelationVectorOutputsEnabled();
+ }
+
+ public static final class GnssMeasurementRequest.Builder {
+ method @NonNull public android.location.GnssMeasurementRequest.Builder setCorrelationVectorOutputsEnabled(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.GnssMeasurementRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
+ }
+
+ public final class GnssReflectingPlane implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+ method @FloatRange(from=0.0f, to=360.0f) public double getAzimuthDegrees();
+ method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
+ method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
+ }
+
+ public static final class GnssReflectingPlane.Builder {
+ ctor public GnssReflectingPlane.Builder();
+ method @NonNull public android.location.GnssReflectingPlane build();
+ method @NonNull public android.location.GnssReflectingPlane.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(@FloatRange(from=0.0f, to=360.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
+ }
+
+ public final class GnssRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean isFullTracking();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssRequest> CREATOR;
+ }
+
+ public static final class GnssRequest.Builder {
+ ctor public GnssRequest.Builder();
+ ctor public GnssRequest.Builder(@NonNull android.location.GnssRequest);
+ method @NonNull public android.location.GnssRequest build();
+ method @NonNull public android.location.GnssRequest.Builder setFullTracking(boolean);
+ }
+
+ public final class GnssSingleSatCorrection implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public float getCarrierFrequencyHz();
+ method @FloatRange(from=0.0f) public float getCombinedAttenuationDb();
+ method public int getConstellationType();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
+ method @NonNull public java.util.List<android.location.GnssExcessPathInfo> getGnssExcessPathInfoList();
+ method @FloatRange(from=0.0f, to=1.0f) public float getProbabilityLineOfSight();
+ method @Deprecated @Nullable public android.location.GnssReflectingPlane getReflectingPlane();
+ method @IntRange(from=0) public int getSatelliteId();
+ method public boolean hasCombinedAttenuation();
+ method public boolean hasExcessPathLength();
+ method public boolean hasExcessPathLengthUncertainty();
+ method @Deprecated public boolean hasReflectingPlane();
+ method public boolean hasValidSatelliteLineOfSight();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
+ }
+
+ public static final class GnssSingleSatCorrection.Builder {
+ ctor public GnssSingleSatCorrection.Builder();
+ method @NonNull public android.location.GnssSingleSatCorrection build();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearCombinedAttenuationDb();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearExcessPathLengthMeters();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearExcessPathLengthUncertaintyMeters();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder clearProbabilityLineOfSight();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(@FloatRange(from=0.0f, fromInclusive=false) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setCombinedAttenuationDb(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setGnssExcessPathInfoList(@NonNull java.util.List<android.location.GnssExcessPathInfo>);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
+ method @Deprecated @NonNull public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setSatelliteId(@IntRange(from=0) int);
+ }
+
+ @Deprecated public class GpsClock implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated public double getBiasInNs();
+ method @Deprecated public double getBiasUncertaintyInNs();
+ method @Deprecated public double getDriftInNsPerSec();
+ method @Deprecated public double getDriftUncertaintyInNsPerSec();
+ method @Deprecated public long getFullBiasInNs();
+ method @Deprecated public short getLeapSecond();
+ method @Deprecated public long getTimeInNs();
+ method @Deprecated public double getTimeUncertaintyInNs();
+ method @Deprecated public byte getType();
+ method @Deprecated public boolean hasBiasInNs();
+ method @Deprecated public boolean hasBiasUncertaintyInNs();
+ method @Deprecated public boolean hasDriftInNsPerSec();
+ method @Deprecated public boolean hasDriftUncertaintyInNsPerSec();
+ method @Deprecated public boolean hasFullBiasInNs();
+ method @Deprecated public boolean hasLeapSecond();
+ method @Deprecated public boolean hasTimeUncertaintyInNs();
+ method @Deprecated public void reset();
+ method @Deprecated public void resetBiasInNs();
+ method @Deprecated public void resetBiasUncertaintyInNs();
+ method @Deprecated public void resetDriftInNsPerSec();
+ method @Deprecated public void resetDriftUncertaintyInNsPerSec();
+ method @Deprecated public void resetFullBiasInNs();
+ method @Deprecated public void resetLeapSecond();
+ method @Deprecated public void resetTimeUncertaintyInNs();
+ method @Deprecated public void set(android.location.GpsClock);
+ method @Deprecated public void setBiasInNs(double);
+ method @Deprecated public void setBiasUncertaintyInNs(double);
+ method @Deprecated public void setDriftInNsPerSec(double);
+ method @Deprecated public void setDriftUncertaintyInNsPerSec(double);
+ method @Deprecated public void setFullBiasInNs(long);
+ method @Deprecated public void setLeapSecond(short);
+ method @Deprecated public void setTimeInNs(long);
+ method @Deprecated public void setTimeUncertaintyInNs(double);
+ method @Deprecated public void setType(byte);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsClock> CREATOR;
+ field @Deprecated public static final byte TYPE_GPS_TIME = 2; // 0x2
+ field @Deprecated public static final byte TYPE_LOCAL_HW_TIME = 1; // 0x1
+ field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsMeasurement implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated public double getAccumulatedDeltaRangeInMeters();
+ method @Deprecated public short getAccumulatedDeltaRangeState();
+ method @Deprecated public double getAccumulatedDeltaRangeUncertaintyInMeters();
+ method @Deprecated public double getAzimuthInDeg();
+ method @Deprecated public double getAzimuthUncertaintyInDeg();
+ method @Deprecated public int getBitNumber();
+ method @Deprecated public long getCarrierCycles();
+ method @Deprecated public float getCarrierFrequencyInHz();
+ method @Deprecated public double getCarrierPhase();
+ method @Deprecated public double getCarrierPhaseUncertainty();
+ method @Deprecated public double getCn0InDbHz();
+ method @Deprecated public double getCodePhaseInChips();
+ method @Deprecated public double getCodePhaseUncertaintyInChips();
+ method @Deprecated public double getDopplerShiftInHz();
+ method @Deprecated public double getDopplerShiftUncertaintyInHz();
+ method @Deprecated public double getElevationInDeg();
+ method @Deprecated public double getElevationUncertaintyInDeg();
+ method @Deprecated public byte getLossOfLock();
+ method @Deprecated public byte getMultipathIndicator();
+ method @Deprecated public byte getPrn();
+ method @Deprecated public double getPseudorangeInMeters();
+ method @Deprecated public double getPseudorangeRateInMetersPerSec();
+ method @Deprecated public double getPseudorangeRateUncertaintyInMetersPerSec();
+ method @Deprecated public double getPseudorangeUncertaintyInMeters();
+ method @Deprecated public long getReceivedGpsTowInNs();
+ method @Deprecated public long getReceivedGpsTowUncertaintyInNs();
+ method @Deprecated public double getSnrInDb();
+ method @Deprecated public short getState();
+ method @Deprecated public short getTimeFromLastBitInMs();
+ method @Deprecated public double getTimeOffsetInNs();
+ method @Deprecated public boolean hasAzimuthInDeg();
+ method @Deprecated public boolean hasAzimuthUncertaintyInDeg();
+ method @Deprecated public boolean hasBitNumber();
+ method @Deprecated public boolean hasCarrierCycles();
+ method @Deprecated public boolean hasCarrierFrequencyInHz();
+ method @Deprecated public boolean hasCarrierPhase();
+ method @Deprecated public boolean hasCarrierPhaseUncertainty();
+ method @Deprecated public boolean hasCodePhaseInChips();
+ method @Deprecated public boolean hasCodePhaseUncertaintyInChips();
+ method @Deprecated public boolean hasDopplerShiftInHz();
+ method @Deprecated public boolean hasDopplerShiftUncertaintyInHz();
+ method @Deprecated public boolean hasElevationInDeg();
+ method @Deprecated public boolean hasElevationUncertaintyInDeg();
+ method @Deprecated public boolean hasPseudorangeInMeters();
+ method @Deprecated public boolean hasPseudorangeUncertaintyInMeters();
+ method @Deprecated public boolean hasSnrInDb();
+ method @Deprecated public boolean hasTimeFromLastBitInMs();
+ method @Deprecated public boolean isPseudorangeRateCorrected();
+ method @Deprecated public boolean isUsedInFix();
+ method @Deprecated public void reset();
+ method @Deprecated public void resetAzimuthInDeg();
+ method @Deprecated public void resetAzimuthUncertaintyInDeg();
+ method @Deprecated public void resetBitNumber();
+ method @Deprecated public void resetCarrierCycles();
+ method @Deprecated public void resetCarrierFrequencyInHz();
+ method @Deprecated public void resetCarrierPhase();
+ method @Deprecated public void resetCarrierPhaseUncertainty();
+ method @Deprecated public void resetCodePhaseInChips();
+ method @Deprecated public void resetCodePhaseUncertaintyInChips();
+ method @Deprecated public void resetDopplerShiftInHz();
+ method @Deprecated public void resetDopplerShiftUncertaintyInHz();
+ method @Deprecated public void resetElevationInDeg();
+ method @Deprecated public void resetElevationUncertaintyInDeg();
+ method @Deprecated public void resetPseudorangeInMeters();
+ method @Deprecated public void resetPseudorangeUncertaintyInMeters();
+ method @Deprecated public void resetSnrInDb();
+ method @Deprecated public void resetTimeFromLastBitInMs();
+ method @Deprecated public void set(android.location.GpsMeasurement);
+ method @Deprecated public void setAccumulatedDeltaRangeInMeters(double);
+ method @Deprecated public void setAccumulatedDeltaRangeState(short);
+ method @Deprecated public void setAccumulatedDeltaRangeUncertaintyInMeters(double);
+ method @Deprecated public void setAzimuthInDeg(double);
+ method @Deprecated public void setAzimuthUncertaintyInDeg(double);
+ method @Deprecated public void setBitNumber(int);
+ method @Deprecated public void setCarrierCycles(long);
+ method @Deprecated public void setCarrierFrequencyInHz(float);
+ method @Deprecated public void setCarrierPhase(double);
+ method @Deprecated public void setCarrierPhaseUncertainty(double);
+ method @Deprecated public void setCn0InDbHz(double);
+ method @Deprecated public void setCodePhaseInChips(double);
+ method @Deprecated public void setCodePhaseUncertaintyInChips(double);
+ method @Deprecated public void setDopplerShiftInHz(double);
+ method @Deprecated public void setDopplerShiftUncertaintyInHz(double);
+ method @Deprecated public void setElevationInDeg(double);
+ method @Deprecated public void setElevationUncertaintyInDeg(double);
+ method @Deprecated public void setLossOfLock(byte);
+ method @Deprecated public void setMultipathIndicator(byte);
+ method @Deprecated public void setPrn(byte);
+ method @Deprecated public void setPseudorangeInMeters(double);
+ method @Deprecated public void setPseudorangeRateInMetersPerSec(double);
+ method @Deprecated public void setPseudorangeRateUncertaintyInMetersPerSec(double);
+ method @Deprecated public void setPseudorangeUncertaintyInMeters(double);
+ method @Deprecated public void setReceivedGpsTowInNs(long);
+ method @Deprecated public void setReceivedGpsTowUncertaintyInNs(long);
+ method @Deprecated public void setSnrInDb(double);
+ method @Deprecated public void setState(short);
+ method @Deprecated public void setTimeFromLastBitInMs(short);
+ method @Deprecated public void setTimeOffsetInNs(double);
+ method @Deprecated public void setUsedInFix(boolean);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated public static final short ADR_STATE_CYCLE_SLIP = 4; // 0x4
+ field @Deprecated public static final short ADR_STATE_RESET = 2; // 0x2
+ field @Deprecated public static final short ADR_STATE_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final short ADR_STATE_VALID = 1; // 0x1
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurement> CREATOR;
+ field @Deprecated public static final byte LOSS_OF_LOCK_CYCLE_SLIP = 2; // 0x2
+ field @Deprecated public static final byte LOSS_OF_LOCK_OK = 1; // 0x1
+ field @Deprecated public static final byte LOSS_OF_LOCK_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_NOT_USED = 2; // 0x2
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final short STATE_BIT_SYNC = 2; // 0x2
+ field @Deprecated public static final short STATE_CODE_LOCK = 1; // 0x1
+ field @Deprecated public static final short STATE_MSEC_AMBIGUOUS = 16; // 0x10
+ field @Deprecated public static final short STATE_SUBFRAME_SYNC = 4; // 0x4
+ field @Deprecated public static final short STATE_TOW_DECODED = 8; // 0x8
+ field @Deprecated public static final short STATE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsMeasurementsEvent implements android.os.Parcelable {
+ ctor @Deprecated public GpsMeasurementsEvent(android.location.GpsClock, android.location.GpsMeasurement[]);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public android.location.GpsClock getClock();
+ method @Deprecated @NonNull public java.util.Collection<android.location.GpsMeasurement> getMeasurements();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurementsEvent> CREATOR;
+ field @Deprecated public static final int STATUS_GPS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ @Deprecated public static interface GpsMeasurementsEvent.Listener {
+ method @Deprecated public void onGpsMeasurementsReceived(android.location.GpsMeasurementsEvent);
+ method @Deprecated public void onStatusChanged(int);
+ }
+
+ @Deprecated public class GpsNavigationMessage implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public byte[] getData();
+ method @Deprecated public short getMessageId();
+ method @Deprecated public byte getPrn();
+ method @Deprecated public short getStatus();
+ method @Deprecated public short getSubmessageId();
+ method @Deprecated public byte getType();
+ method @Deprecated public void reset();
+ method @Deprecated public void set(android.location.GpsNavigationMessage);
+ method @Deprecated public void setData(byte[]);
+ method @Deprecated public void setMessageId(short);
+ method @Deprecated public void setPrn(byte);
+ method @Deprecated public void setStatus(short);
+ method @Deprecated public void setSubmessageId(short);
+ method @Deprecated public void setType(byte);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessage> CREATOR;
+ field @Deprecated public static final short STATUS_PARITY_PASSED = 1; // 0x1
+ field @Deprecated public static final short STATUS_PARITY_REBUILT = 2; // 0x2
+ field @Deprecated public static final short STATUS_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final byte TYPE_CNAV2 = 4; // 0x4
+ field @Deprecated public static final byte TYPE_L1CA = 1; // 0x1
+ field @Deprecated public static final byte TYPE_L2CNAV = 2; // 0x2
+ field @Deprecated public static final byte TYPE_L5CNAV = 3; // 0x3
+ field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsNavigationMessageEvent implements android.os.Parcelable {
+ ctor @Deprecated public GpsNavigationMessageEvent(android.location.GpsNavigationMessage);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public android.location.GpsNavigationMessage getNavigationMessage();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessageEvent> CREATOR;
+ field @Deprecated public static int STATUS_GPS_LOCATION_DISABLED;
+ field @Deprecated public static int STATUS_NOT_SUPPORTED;
+ field @Deprecated public static int STATUS_READY;
+ }
+
+ @Deprecated public static interface GpsNavigationMessageEvent.Listener {
+ method @Deprecated public void onGpsNavigationMessageReceived(android.location.GpsNavigationMessageEvent);
+ method @Deprecated public void onStatusChanged(int);
+ }
+
+ public final class LastLocationRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean isAdasGnssBypass();
+ method public boolean isHiddenFromAppOps();
+ method public boolean isLocationSettingsIgnored();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.LastLocationRequest> CREATOR;
+ }
+
+ public static final class LastLocationRequest.Builder {
+ ctor public LastLocationRequest.Builder();
+ ctor public LastLocationRequest.Builder(@NonNull android.location.LastLocationRequest);
+ method @NonNull public android.location.LastLocationRequest build();
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LastLocationRequest.Builder setAdasGnssBypass(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LastLocationRequest.Builder setHiddenFromAppOps(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LastLocationRequest.Builder setLocationSettingsIgnored(boolean);
+ }
+
+ public class LocationManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.INTERACT_ACROSS_USERS}) public void addProviderRequestChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.provider.ProviderRequest.ChangedListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @Nullable public String getExtraLocationControllerPackage();
+ method @Deprecated public int getGnssBatchSize();
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.location.Location getLastKnownLocation(@NonNull String, @NonNull android.location.LastLocationRequest);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void injectGnssMeasurementCorrections(@NonNull android.location.GnssMeasurementCorrections);
+ method public boolean isAdasGnssLocationEnabled();
+ method public boolean isExtraLocationControllerPackageEnabled();
+ method public boolean isLocationEnabledForUser(@NonNull android.os.UserHandle);
+ method public boolean isProviderEnabledForUser(@NonNull String, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String, @Nullable String);
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.UPDATE_APP_OPS_STATS}) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void removeProviderRequestChangedListener(@NonNull android.location.provider.ProviderRequest.ChangedListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public void setAdasGnssLocationEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackage(@Nullable String);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackageEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
+ field public static final String ACTION_ADAS_GNSS_ENABLED_CHANGED = "android.location.action.ADAS_GNSS_ENABLED_CHANGED";
+ field public static final String EXTRA_ADAS_GNSS_ENABLED = "android.location.extra.ADAS_GNSS_ENABLED";
+ field @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public static final String GPS_HARDWARE_PROVIDER = "gps_hardware";
+ }
+
+ public final class LocationRequest implements android.os.Parcelable {
+ method @Deprecated @NonNull public static android.location.LocationRequest create();
+ method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedCriteria(@NonNull android.location.Criteria, long, float, boolean);
+ method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedProvider(@NonNull String, long, float, boolean);
+ method @Deprecated public long getExpireAt();
+ method @Deprecated public long getExpireIn();
+ method @Deprecated public long getFastestInterval();
+ method @Deprecated public boolean getHideFromAppOps();
+ method @Deprecated public long getInterval();
+ method @Deprecated public int getNumUpdates();
+ method @Deprecated @NonNull public String getProvider();
+ method @Deprecated public float getSmallestDisplacement();
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isAdasGnssBypass();
+ method public boolean isHiddenFromAppOps();
+ method public boolean isLocationSettingsIgnored();
+ method public boolean isLowPower();
+ method @Deprecated public boolean isLowPowerMode();
+ method @Deprecated @NonNull public android.location.LocationRequest setExpireAt(long);
+ method @Deprecated @NonNull public android.location.LocationRequest setExpireIn(long);
+ method @Deprecated @NonNull public android.location.LocationRequest setFastestInterval(long);
+ method @Deprecated public void setHideFromAppOps(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setInterval(long);
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest setLocationSettingsIgnored(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setLowPowerMode(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setNumUpdates(int);
+ method @Deprecated @NonNull public android.location.LocationRequest setProvider(@NonNull String);
+ method @Deprecated @NonNull public android.location.LocationRequest setQuality(int);
+ method @Deprecated @NonNull public android.location.LocationRequest setSmallestDisplacement(float);
+ method @Deprecated public void setWorkSource(@Nullable android.os.WorkSource);
+ field @Deprecated public static final int ACCURACY_BLOCK = 102; // 0x66
+ field @Deprecated public static final int ACCURACY_CITY = 104; // 0x68
+ field @Deprecated public static final int ACCURACY_FINE = 100; // 0x64
+ field @Deprecated public static final int POWER_HIGH = 203; // 0xcb
+ field @Deprecated public static final int POWER_LOW = 201; // 0xc9
+ field @Deprecated public static final int POWER_NONE = 200; // 0xc8
+ }
+
+ public static final class LocationRequest.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest.Builder setAdasGnssBypass(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LocationRequest.Builder setHiddenFromAppOps(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_BYPASS) public android.location.LocationRequest.Builder setLocationSettingsIgnored(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.location.LocationRequest.Builder setLowPower(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.LocationRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
+ }
+
+ public final class SatellitePvt implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.location.SatellitePvt.ClockInfo getClockInfo();
+ method public int getEphemerisSource();
+ method @FloatRange public double getIonoDelayMeters();
+ method @IntRange(from=0, to=1023) public int getIssueOfDataClock();
+ method @IntRange(from=0, to=1023) public int getIssueOfDataEphemeris();
+ method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef();
+ method @IntRange(from=0) public long getTimeOfClockSeconds();
+ method @IntRange(from=0) public long getTimeOfEphemerisSeconds();
+ method @FloatRange public double getTropoDelayMeters();
+ method @Nullable public android.location.SatellitePvt.VelocityEcef getVelocityEcef();
+ method public boolean hasIono();
+ method public boolean hasIssueOfDataClock();
+ method public boolean hasIssueOfDataEphemeris();
+ method public boolean hasPositionVelocityClockInfo();
+ method public boolean hasTimeOfClockSeconds();
+ method public boolean hasTimeOfEphemerisSeconds();
+ method public boolean hasTropo();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt> CREATOR;
+ field public static final int EPHEMERIS_SOURCE_DEMODULATED = 0; // 0x0
+ field public static final int EPHEMERIS_SOURCE_OTHER = 3; // 0x3
+ field public static final int EPHEMERIS_SOURCE_SERVER_LONG_TERM = 2; // 0x2
+ field public static final int EPHEMERIS_SOURCE_SERVER_NORMAL = 1; // 0x1
+ }
+
+ public static final class SatellitePvt.Builder {
+ ctor public SatellitePvt.Builder();
+ method @NonNull public android.location.SatellitePvt build();
+ method @NonNull public android.location.SatellitePvt.Builder setClockInfo(@NonNull android.location.SatellitePvt.ClockInfo);
+ method @NonNull public android.location.SatellitePvt.Builder setEphemerisSource(int);
+ method @NonNull public android.location.SatellitePvt.Builder setIonoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
+ method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataClock(@IntRange(from=0, to=1023) int);
+ method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=1023) int);
+ method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef);
+ method @NonNull public android.location.SatellitePvt.Builder setTimeOfClockSeconds(@IntRange(from=0) long);
+ method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemerisSeconds(@IntRange(from=0) long);
+ method @NonNull public android.location.SatellitePvt.Builder setTropoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
+ method @NonNull public android.location.SatellitePvt.Builder setVelocityEcef(@NonNull android.location.SatellitePvt.VelocityEcef);
+ }
+
+ public static final class SatellitePvt.ClockInfo implements android.os.Parcelable {
+ ctor public SatellitePvt.ClockInfo(double, double, double);
+ method public int describeContents();
+ method @FloatRange public double getClockDriftMetersPerSecond();
+ method @FloatRange public double getHardwareCodeBiasMeters();
+ method @FloatRange public double getTimeCorrectionMeters();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.ClockInfo> CREATOR;
+ }
+
+ public static final class SatellitePvt.PositionEcef implements android.os.Parcelable {
+ ctor public SatellitePvt.PositionEcef(double, double, double, double);
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getUreMeters();
+ method @FloatRange public double getXMeters();
+ method @FloatRange public double getYMeters();
+ method @FloatRange public double getZMeters();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.PositionEcef> CREATOR;
+ }
+
+ public static final class SatellitePvt.VelocityEcef implements android.os.Parcelable {
+ ctor public SatellitePvt.VelocityEcef(double, double, double, double);
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public double getUreRateMetersPerSecond();
+ method @FloatRange public double getXMetersPerSecond();
+ method @FloatRange public double getYMetersPerSecond();
+ method @FloatRange public double getZMetersPerSecond();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt.VelocityEcef> CREATOR;
+ }
+
+}
+
+package android.location.provider {
+
+ public abstract class LocationProviderBase {
+ ctor public LocationProviderBase(@NonNull android.content.Context, @NonNull String, @NonNull android.location.provider.ProviderProperties);
+ method @Nullable public final android.os.IBinder getBinder();
+ method @NonNull public android.location.provider.ProviderProperties getProperties();
+ method public boolean isAllowed();
+ method public abstract void onFlush(@NonNull android.location.provider.LocationProviderBase.OnFlushCompleteCallback);
+ method public abstract void onSendExtraCommand(@NonNull String, @Nullable android.os.Bundle);
+ method public abstract void onSetRequest(@NonNull android.location.provider.ProviderRequest);
+ method public void reportLocation(@NonNull android.location.Location);
+ method public void reportLocations(@NonNull java.util.List<android.location.Location>);
+ method public void setAllowed(boolean);
+ method public void setProperties(@NonNull android.location.provider.ProviderProperties);
+ field public static final String ACTION_FUSED_PROVIDER = "com.android.location.service.FusedLocationProvider";
+ field public static final String ACTION_GNSS_PROVIDER = "android.location.provider.action.GNSS_PROVIDER";
+ field public static final String ACTION_NETWORK_PROVIDER = "com.android.location.service.v3.NetworkLocationProvider";
+ }
+
+ public static interface LocationProviderBase.OnFlushCompleteCallback {
+ method public void onFlushComplete();
+ }
+
+ public final class ProviderRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public long getIntervalMillis();
+ method @IntRange(from=0) public long getMaxUpdateDelayMillis();
+ method public int getQuality();
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isActive();
+ method public boolean isLocationSettingsIgnored();
+ method public boolean isLowPower();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ProviderRequest> CREATOR;
+ field @NonNull public static final android.location.provider.ProviderRequest EMPTY_REQUEST;
+ field public static final long INTERVAL_DISABLED = 9223372036854775807L; // 0x7fffffffffffffffL
+ }
+
+ public static final class ProviderRequest.Builder {
+ ctor public ProviderRequest.Builder();
+ method @NonNull public android.location.provider.ProviderRequest build();
+ method @NonNull public android.location.provider.ProviderRequest.Builder setIntervalMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setLocationSettingsIgnored(boolean);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setLowPower(boolean);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setMaxUpdateDelayMillis(@IntRange(from=0) long);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setQuality(int);
+ method @NonNull public android.location.provider.ProviderRequest.Builder setWorkSource(@NonNull android.os.WorkSource);
+ }
+
+ public static interface ProviderRequest.ChangedListener {
+ method public void onProviderRequestChanged(@NonNull String, @NonNull android.location.provider.ProviderRequest);
+ }
+
+}
+
diff --git a/location/api/system-lint-baseline.txt b/location/api/system-lint-baseline.txt
new file mode 100644
index 0000000..a5e5752
--- /dev/null
+++ b/location/api/system-lint-baseline.txt
@@ -0,0 +1,11 @@
+// Baseline format: 1.0
+SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.location.LocationManager.addNmeaListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 4, "listener", in android.location.LocationManager.requestLocationUpdates) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
+ SAM-compatible parameters (such as parameter 2, "listener", in android.location.LocationManager.requestSingleUpdate) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
diff --git a/location/api/system-removed.txt b/location/api/system-removed.txt
index d802177..2755a9f 100644
--- a/location/api/system-removed.txt
+++ b/location/api/system-removed.txt
@@ -1 +1,15 @@
// Signature format: 2.0
+package android.location {
+
+ public class LocationManager {
+ method @Deprecated public boolean addGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
+ method @Deprecated public boolean addGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String);
+ method @Deprecated public void removeGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
+ method @Deprecated public void removeGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setLocationControllerExtraPackage(String);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setLocationControllerExtraPackageEnabled(boolean);
+ }
+
+}
+
diff --git a/location/api/test-current.txt b/location/api/test-current.txt
index d802177..bdcb00a 100644
--- a/location/api/test-current.txt
+++ b/location/api/test-current.txt
@@ -1 +1,104 @@
// Signature format: 2.0
+package android.location {
+
+ public final class GnssClock implements android.os.Parcelable {
+ ctor public GnssClock();
+ method public void reset();
+ method public void resetBiasNanos();
+ method public void resetBiasUncertaintyNanos();
+ method public void resetDriftNanosPerSecond();
+ method public void resetDriftUncertaintyNanosPerSecond();
+ method public void resetElapsedRealtimeNanos();
+ method public void resetElapsedRealtimeUncertaintyNanos();
+ method public void resetFullBiasNanos();
+ method public void resetLeapSecond();
+ method public void resetReferenceCarrierFrequencyHzForIsb();
+ method public void resetReferenceCodeTypeForIsb();
+ method public void resetReferenceConstellationTypeForIsb();
+ method public void resetTimeUncertaintyNanos();
+ method public void set(android.location.GnssClock);
+ method public void setBiasNanos(double);
+ method public void setBiasUncertaintyNanos(@FloatRange(from=0.0f) double);
+ method public void setDriftNanosPerSecond(double);
+ method public void setDriftUncertaintyNanosPerSecond(@FloatRange(from=0.0f) double);
+ method public void setElapsedRealtimeNanos(long);
+ method public void setElapsedRealtimeUncertaintyNanos(@FloatRange(from=0.0f) double);
+ method public void setFullBiasNanos(long);
+ method public void setHardwareClockDiscontinuityCount(int);
+ method public void setLeapSecond(int);
+ method public void setReferenceCarrierFrequencyHzForIsb(@FloatRange(from=0.0) double);
+ method public void setReferenceCodeTypeForIsb(@NonNull String);
+ method public void setReferenceConstellationTypeForIsb(int);
+ method public void setTimeNanos(long);
+ method public void setTimeUncertaintyNanos(@FloatRange(from=0.0f) double);
+ }
+
+ public final class GnssMeasurement implements android.os.Parcelable {
+ ctor public GnssMeasurement();
+ method public void reset();
+ method public void resetAutomaticGainControlLevel();
+ method public void resetBasebandCn0DbHz();
+ method @Deprecated public void resetCarrierCycles();
+ method public void resetCarrierFrequencyHz();
+ method @Deprecated public void resetCarrierPhase();
+ method @Deprecated public void resetCarrierPhaseUncertainty();
+ method public void resetCodeType();
+ method public void resetCorrelationVectors();
+ method public void resetFullInterSignalBiasNanos();
+ method public void resetFullInterSignalBiasUncertaintyNanos();
+ method public void resetSatelliteInterSignalBiasNanos();
+ method public void resetSatelliteInterSignalBiasUncertaintyNanos();
+ method public void resetSatellitePvt();
+ method public void resetSnrInDb();
+ method public void set(android.location.GnssMeasurement);
+ method public void setAccumulatedDeltaRangeMeters(double);
+ method public void setAccumulatedDeltaRangeState(int);
+ method public void setAccumulatedDeltaRangeUncertaintyMeters(double);
+ method @Deprecated public void setAutomaticGainControlLevelInDb(double);
+ method public void setBasebandCn0DbHz(double);
+ method @Deprecated public void setCarrierCycles(long);
+ method public void setCarrierFrequencyHz(float);
+ method @Deprecated public void setCarrierPhase(double);
+ method @Deprecated public void setCarrierPhaseUncertainty(double);
+ method public void setCn0DbHz(double);
+ method public void setCodeType(@NonNull String);
+ method public void setConstellationType(int);
+ method public void setCorrelationVectors(@Nullable java.util.Collection<android.location.CorrelationVector>);
+ method public void setFullInterSignalBiasNanos(double);
+ method public void setFullInterSignalBiasUncertaintyNanos(@FloatRange(from=0.0) double);
+ method public void setMultipathIndicator(int);
+ method public void setPseudorangeRateMetersPerSecond(double);
+ method public void setPseudorangeRateUncertaintyMetersPerSecond(double);
+ method public void setReceivedSvTimeNanos(long);
+ method public void setReceivedSvTimeUncertaintyNanos(long);
+ method public void setSatelliteInterSignalBiasNanos(double);
+ method public void setSatelliteInterSignalBiasUncertaintyNanos(@FloatRange(from=0.0) double);
+ method public void setSatellitePvt(@Nullable android.location.SatellitePvt);
+ method public void setSnrInDb(double);
+ method public void setState(int);
+ method public void setSvid(int);
+ method public void setTimeOffsetNanos(double);
+ field public static final int ADR_STATE_ALL = 31; // 0x1f
+ }
+
+ public final class GnssNavigationMessage implements android.os.Parcelable {
+ ctor public GnssNavigationMessage();
+ method public void reset();
+ method public void set(android.location.GnssNavigationMessage);
+ method public void setData(byte[]);
+ method public void setMessageId(@IntRange(from=0xffffffff, to=120) int);
+ method public void setStatus(int);
+ method public void setSubmessageId(@IntRange(from=1) int);
+ method public void setSvid(@IntRange(from=1, to=200) int);
+ method public void setType(int);
+ }
+
+ public class LocationManager {
+ method @NonNull public String[] getBackgroundThrottlingWhitelist();
+ method @NonNull public android.os.PackageTagsList getIgnoreSettingsAllowlist();
+ method @Deprecated @NonNull public String[] getIgnoreSettingsWhitelist();
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
+ }
+
+}
+
diff --git a/location/api/test-lint-baseline.txt b/location/api/test-lint-baseline.txt
new file mode 100644
index 0000000..189588e
--- /dev/null
+++ b/location/api/test-lint-baseline.txt
@@ -0,0 +1,54 @@
+// Baseline format: 1.0
+GetterSetterNames: android.location.GnssClock#setBiasNanos(double):
+ Symmetric method for `hasBiasNanos` must be named `setHasBiasNanos`; was `setBiasNanos`
+GetterSetterNames: android.location.GnssClock#setBiasUncertaintyNanos(double):
+ Symmetric method for `hasBiasUncertaintyNanos` must be named `setHasBiasUncertaintyNanos`; was `setBiasUncertaintyNanos`
+GetterSetterNames: android.location.GnssClock#setDriftNanosPerSecond(double):
+ Symmetric method for `hasDriftNanosPerSecond` must be named `setHasDriftNanosPerSecond`; was `setDriftNanosPerSecond`
+GetterSetterNames: android.location.GnssClock#setDriftUncertaintyNanosPerSecond(double):
+ Symmetric method for `hasDriftUncertaintyNanosPerSecond` must be named `setHasDriftUncertaintyNanosPerSecond`; was `setDriftUncertaintyNanosPerSecond`
+GetterSetterNames: android.location.GnssClock#setElapsedRealtimeNanos(long):
+ Symmetric method for `hasElapsedRealtimeNanos` must be named `setHasElapsedRealtimeNanos`; was `setElapsedRealtimeNanos`
+GetterSetterNames: android.location.GnssClock#setElapsedRealtimeUncertaintyNanos(double):
+ Symmetric method for `hasElapsedRealtimeUncertaintyNanos` must be named `setHasElapsedRealtimeUncertaintyNanos`; was `setElapsedRealtimeUncertaintyNanos`
+GetterSetterNames: android.location.GnssClock#setFullBiasNanos(long):
+ Symmetric method for `hasFullBiasNanos` must be named `setHasFullBiasNanos`; was `setFullBiasNanos`
+GetterSetterNames: android.location.GnssClock#setLeapSecond(int):
+ Symmetric method for `hasLeapSecond` must be named `setHasLeapSecond`; was `setLeapSecond`
+GetterSetterNames: android.location.GnssClock#setReferenceCarrierFrequencyHzForIsb(double):
+ Symmetric method for `hasReferenceCarrierFrequencyHzForIsb` must be named `setHasReferenceCarrierFrequencyHzForIsb`; was `setReferenceCarrierFrequencyHzForIsb`
+GetterSetterNames: android.location.GnssClock#setReferenceCodeTypeForIsb(String):
+ Symmetric method for `hasReferenceCodeTypeForIsb` must be named `setHasReferenceCodeTypeForIsb`; was `setReferenceCodeTypeForIsb`
+GetterSetterNames: android.location.GnssClock#setReferenceConstellationTypeForIsb(int):
+ Symmetric method for `hasReferenceConstellationTypeForIsb` must be named `setHasReferenceConstellationTypeForIsb`; was `setReferenceConstellationTypeForIsb`
+GetterSetterNames: android.location.GnssClock#setTimeUncertaintyNanos(double):
+ Symmetric method for `hasTimeUncertaintyNanos` must be named `setHasTimeUncertaintyNanos`; was `setTimeUncertaintyNanos`
+GetterSetterNames: android.location.GnssMeasurement#setBasebandCn0DbHz(double):
+ Symmetric method for `hasBasebandCn0DbHz` must be named `setHasBasebandCn0DbHz`; was `setBasebandCn0DbHz`
+GetterSetterNames: android.location.GnssMeasurement#setCarrierFrequencyHz(float):
+ Symmetric method for `hasCarrierFrequencyHz` must be named `setHasCarrierFrequencyHz`; was `setCarrierFrequencyHz`
+GetterSetterNames: android.location.GnssMeasurement#setCodeType(String):
+ Symmetric method for `hasCodeType` must be named `setHasCodeType`; was `setCodeType`
+GetterSetterNames: android.location.GnssMeasurement#setCorrelationVectors(java.util.Collection<android.location.CorrelationVector>):
+ Symmetric method for `hasCorrelationVectors` must be named `setHasCorrelationVectors`; was `setCorrelationVectors`
+GetterSetterNames: android.location.GnssMeasurement#setFullInterSignalBiasNanos(double):
+ Symmetric method for `hasFullInterSignalBiasNanos` must be named `setHasFullInterSignalBiasNanos`; was `setFullInterSignalBiasNanos`
+GetterSetterNames: android.location.GnssMeasurement#setFullInterSignalBiasUncertaintyNanos(double):
+ Symmetric method for `hasFullInterSignalBiasUncertaintyNanos` must be named `setHasFullInterSignalBiasUncertaintyNanos`; was `setFullInterSignalBiasUncertaintyNanos`
+GetterSetterNames: android.location.GnssMeasurement#setSatelliteInterSignalBiasNanos(double):
+ Symmetric method for `hasSatelliteInterSignalBiasNanos` must be named `setHasSatelliteInterSignalBiasNanos`; was `setSatelliteInterSignalBiasNanos`
+GetterSetterNames: android.location.GnssMeasurement#setSatelliteInterSignalBiasUncertaintyNanos(double):
+ Symmetric method for `hasSatelliteInterSignalBiasUncertaintyNanos` must be named `setHasSatelliteInterSignalBiasUncertaintyNanos`; was `setSatelliteInterSignalBiasUncertaintyNanos`
+GetterSetterNames: android.location.GnssMeasurement#setSatellitePvt(android.location.SatellitePvt):
+ Symmetric method for `hasSatellitePvt` must be named `setHasSatellitePvt`; was `setSatellitePvt`
+GetterSetterNames: android.location.GnssMeasurement#setSnrInDb(double):
+ Symmetric method for `hasSnrInDb` must be named `setHasSnrInDb`; was `setSnrInDb`
+
+MissingNullability: android.location.GnssClock#set(android.location.GnssClock) parameter #0:
+ Missing nullability on parameter `clock` in method `set`
+MissingNullability: android.location.GnssMeasurement#set(android.location.GnssMeasurement) parameter #0:
+ Missing nullability on parameter `measurement` in method `set`
+MissingNullability: android.location.GnssNavigationMessage#set(android.location.GnssNavigationMessage) parameter #0:
+ Missing nullability on parameter `navigationMessage` in method `set`
+MissingNullability: android.location.GnssNavigationMessage#setData(byte[]) parameter #0:
+ Missing nullability on parameter `value` in method `setData`
diff --git a/location/java/Android.bp b/location/java/Android.bp
deleted file mode 100644
index 543f2b1..0000000
--- a/location/java/Android.bp
+++ /dev/null
@@ -1,17 +0,0 @@
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "frameworks_base_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["frameworks_base_license"],
-}
-
-filegroup {
- name: "framework-location-sources",
- srcs: [
- "**/*.java",
- "**/*.aidl",
- ],
- visibility: ["//frameworks/base"],
-}
diff --git a/location/java/android/location/GeocoderParams.java b/location/java/android/location/GeocoderParams.java
deleted file mode 100644
index 3ea6364..0000000
--- a/location/java/android/location/GeocoderParams.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.content.Context;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.Process;
-
-import java.util.Locale;
-import java.util.Objects;
-
-/**
- * This class contains extra parameters to pass to an IGeocodeProvider
- * implementation from the Geocoder class. Currently this contains the
- * language, country and variant information from the Geocoder's locale
- * as well as the Geocoder client's package name for geocoder server
- * logging. This information is kept in a separate class to allow for
- * future expansion of the IGeocodeProvider interface.
- *
- * @hide
- */
-public class GeocoderParams implements Parcelable {
-
- private final int mUid;
- private final String mPackageName;
- private final @Nullable String mAttributionTag;
- private final Locale mLocale;
-
- public GeocoderParams(Context context) {
- this(context, Locale.getDefault());
- }
-
- public GeocoderParams(Context context, Locale locale) {
- this(Process.myUid(), context.getPackageName(), context.getAttributionTag(), locale);
- }
-
- private GeocoderParams(int uid, String packageName, String attributionTag, Locale locale) {
- mUid = uid;
- mPackageName = Objects.requireNonNull(packageName);
- mAttributionTag = attributionTag;
- mLocale = Objects.requireNonNull(locale);
- }
-
- /**
- * Returns the client UID.
- */
- @UnsupportedAppUsage
- public int getClientUid() {
- return mUid;
- }
-
- /**
- * Returns the client package name.
- */
- @UnsupportedAppUsage
- public @NonNull String getClientPackage() {
- return mPackageName;
- }
-
- /**
- * Returns the client attribution tag.
- */
- @UnsupportedAppUsage
- public @Nullable String getClientAttributionTag() {
- return mAttributionTag;
- }
-
- /**
- * Returns the locale.
- */
- @UnsupportedAppUsage
- public @NonNull Locale getLocale() {
- return mLocale;
- }
-
- public static final @NonNull Parcelable.Creator<GeocoderParams> CREATOR =
- new Parcelable.Creator<GeocoderParams>() {
- public GeocoderParams createFromParcel(Parcel in) {
- int uid = in.readInt();
- String packageName = in.readString8();
- String attributionTag = in.readString8();
- String language = in.readString8();
- String country = in.readString8();
- String variant = in.readString8();
-
- return new GeocoderParams(uid, packageName, attributionTag,
- new Locale(language, country, variant));
- }
-
- public GeocoderParams[] newArray(int size) {
- return new GeocoderParams[size];
- }
- };
-
- public int describeContents() {
- return 0;
- }
-
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeInt(mUid);
- parcel.writeString8(mPackageName);
- parcel.writeString8(mAttributionTag);
- parcel.writeString8(mLocale.getLanguage());
- parcel.writeString8(mLocale.getCountry());
- parcel.writeString8(mLocale.getVariant());
- }
-}
diff --git a/location/java/android/location/Geofence.java b/location/java/android/location/Geofence.java
deleted file mode 100644
index 10773f8..0000000
--- a/location/java/android/location/Geofence.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-import android.annotation.NonNull;
-import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.SystemClock;
-import android.util.TimeUtils;
-
-import com.android.internal.util.Preconditions;
-
-import java.util.Objects;
-
-/**
- * Represents a geographical boundary, also known as a geofence.
- *
- * <p>Currently only circular geofences are supported and they do not support altitude changes.
- *
- * @hide
- */
-public final class Geofence implements Parcelable {
-
- private final double mLatitude;
- private final double mLongitude;
- private final float mRadius;
- private long mExpirationRealtimeMs;
-
- /**
- * Create a circular geofence (on a flat, horizontal plane).
- *
- * @param latitude latitude in degrees, between -90 and +90 inclusive
- * @param longitude longitude in degrees, between -180 and +180 inclusive
- * @param radius radius in meters
- * @return a new geofence
- * @throws IllegalArgumentException if any parameters are out of range
- */
- public static Geofence createCircle(double latitude, double longitude, float radius,
- long expirationRealtimeMs) {
- return new Geofence(latitude, longitude, radius, expirationRealtimeMs);
- }
-
- Geofence(double latitude, double longitude, float radius, long expirationRealtimeMs) {
- Preconditions.checkArgumentInRange(latitude, -90.0, 90.0, "latitude");
- Preconditions.checkArgumentInRange(longitude, -180.0, 180.0, "latitude");
- Preconditions.checkArgument(radius > 0, "invalid radius: %f", radius);
-
- mLatitude = latitude;
- mLongitude = longitude;
- mRadius = radius;
- mExpirationRealtimeMs = expirationRealtimeMs;
- }
-
- public double getLatitude() {
- return mLatitude;
- }
-
- public double getLongitude() {
- return mLongitude;
- }
-
- public float getRadius() {
- return mRadius;
- }
-
- public boolean isExpired() {
- return isExpired(SystemClock.elapsedRealtime());
- }
-
- /**
- * Returns true if this geofence is expired with reference to the given realtime.
- */
- public boolean isExpired(long referenceRealtimeMs) {
- return referenceRealtimeMs >= mExpirationRealtimeMs;
- }
-
- @UnsupportedAppUsage
- public static final @NonNull Parcelable.Creator<Geofence> CREATOR =
- new Parcelable.Creator<Geofence>() {
- @Override
- public Geofence createFromParcel(Parcel in) {
- return new Geofence(
- in.readDouble(),
- in.readDouble(),
- in.readFloat(),
- in.readLong());
- }
-
- @Override
- public Geofence[] newArray(int size) {
- return new Geofence[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeDouble(mLatitude);
- parcel.writeDouble(mLongitude);
- parcel.writeFloat(mRadius);
- parcel.writeLong(mExpirationRealtimeMs);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof Geofence)) {
- return false;
- }
- Geofence geofence = (Geofence) o;
- return Double.compare(geofence.mLatitude, mLatitude) == 0
- && Double.compare(geofence.mLongitude, mLongitude) == 0
- && Float.compare(geofence.mRadius, mRadius) == 0
- && mExpirationRealtimeMs == geofence.mExpirationRealtimeMs;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mLatitude, mLongitude, mRadius);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("Geofence[(").append(mLatitude).append(", ").append(mLongitude).append(")");
- builder.append(" ").append(mRadius).append("m");
- if (mExpirationRealtimeMs < Long.MAX_VALUE) {
- if (isExpired()) {
- builder.append(" expired");
- } else {
- builder.append(" expires=");
- TimeUtils.formatDuration(mExpirationRealtimeMs, builder);
- }
- }
- builder.append("]");
- return builder.toString();
- }
-}
diff --git a/location/java/android/location/GnssSignalQuality.java b/location/java/android/location/GnssSignalQuality.java
deleted file mode 100644
index 7945f3e..0000000
--- a/location/java/android/location/GnssSignalQuality.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-import android.server.location.ServerLocationProtoEnums;
-
-/**
- * Gnss signal quality information.
- *
- * @hide
- */
-public interface GnssSignalQuality {
-
- int GNSS_SIGNAL_QUALITY_UNKNOWN =
- ServerLocationProtoEnums.GPS_SIGNAL_QUALITY_UNKNOWN; // -1
-
- int GNSS_SIGNAL_QUALITY_POOR =
- ServerLocationProtoEnums.GPS_SIGNAL_QUALITY_POOR; // 0
-
- int GNSS_SIGNAL_QUALITY_GOOD =
- ServerLocationProtoEnums.GPS_SIGNAL_QUALITY_GOOD; // 1
-
- int NUM_GNSS_SIGNAL_QUALITY_LEVELS = GNSS_SIGNAL_QUALITY_GOOD + 1;
-}
diff --git a/location/java/android/location/IFusedGeofenceHardware.aidl b/location/java/android/location/IFusedGeofenceHardware.aidl
deleted file mode 100644
index d8c3585..0000000
--- a/location/java/android/location/IFusedGeofenceHardware.aidl
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2013, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/license/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-import android.hardware.location.GeofenceHardwareRequestParcelable;
-
-/**
- * Fused Geofence Hardware interface.
- *
- * <p>This interface is the basic set of supported functionality by Fused Hardware modules that offer
- * Geofencing capabilities.
- *
- * All operations are asynchronous and the status codes can be obtained via a set of callbacks.
- *
- * @hide
- */
-interface IFusedGeofenceHardware {
- /**
- * Flags if the interface functionality is supported by the platform.
- *
- * @return true if the functionality is supported, false otherwise.
- */
- boolean isSupported();
-
- /**
- * Adds a given list of geofences to the system.
- *
- * @param geofenceRequestsArray The list of geofences to add.
- */
- void addGeofences(in GeofenceHardwareRequestParcelable[] geofenceRequestsArray);
-
- /**
- * Removes a give list of geofences from the system.
- *
- * @param geofences The list of geofences to remove.
- */
- void removeGeofences(in int[] geofenceIds);
-
- /**
- * Pauses monitoring a particular geofence.
- *
- * @param geofenceId The geofence to pause monitoring.
- */
- void pauseMonitoringGeofence(in int geofenceId);
-
- /**
- * Resumes monitoring a particular geofence.
- *
- * @param geofenceid The geofence to resume monitoring.
- * @param transitionsToMonitor The transitions to monitor upon resume.
- *
- * Remarks: keep naming of geofence request options consistent with the naming used in
- * GeofenceHardwareRequest
- */
- void resumeMonitoringGeofence(in int geofenceId, in int monitorTransitions);
-
- /**
- * Modifies the request options if a geofence that is already known by the
- * system.
- *
- * @param geofenceId The geofence to modify.
- * @param lastTransition The last known transition state of
- * the geofence.
- * @param monitorTransitions The set of transitions to monitor.
- * @param notificationResponsiveness The notification responsivness needed.
- * @param unknownTimer The time span associated with the.
- * @param sourcesToUse The source technologies to use.
- *
- * Remarks: keep the options as separate fields to be able to leverage the class
- * GeofenceHardwareRequest without any changes
- */
- void modifyGeofenceOptions(
- in int geofenceId,
- in int lastTransition,
- in int monitorTransitions,
- in int notificationResponsiveness,
- in int unknownTimer,
- in int sourcesToUse);
-}
diff --git a/location/java/android/location/IGpsGeofenceHardware.aidl b/location/java/android/location/IGpsGeofenceHardware.aidl
deleted file mode 100644
index 764bf8e..0000000
--- a/location/java/android/location/IGpsGeofenceHardware.aidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2013, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-/**
- * GPS hardware geofence
- *
- * @hide
- */
-interface IGpsGeofenceHardware
-{
- boolean isHardwareGeofenceSupported();
- boolean addCircularHardwareGeofence(int geofenceId, double latitude, double
- longitude, double radius, int lastTransition, int monitorTransition,
- int notificationResponsiveness, int unknownTimer);
- boolean removeHardwareGeofence(int geofenceId);
- boolean pauseHardwareGeofence(int geofenceId);
- boolean resumeHardwareGeofence(int geofenceId, int monitorTransition);
-}
diff --git a/location/java/android/location/Location.aidl b/location/java/android/location/Location.aidl
deleted file mode 100644
index f47b488..0000000
--- a/location/java/android/location/Location.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2007, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-parcelable Location;
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
deleted file mode 100644
index fd3e5a2..0000000
--- a/location/java/android/location/Location.java
+++ /dev/null
@@ -1,1357 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-import static java.util.concurrent.TimeUnit.NANOSECONDS;
-
-import android.annotation.FloatRange;
-import android.annotation.IntDef;
-import android.annotation.IntRange;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SystemApi;
-import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.SystemClock;
-import android.util.Printer;
-import android.util.TimeUtils;
-
-import com.android.internal.util.Preconditions;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.text.DecimalFormat;
-import java.util.Locale;
-import java.util.Objects;
-import java.util.StringTokenizer;
-
-/**
- * A data class representing a geographic location. A location consists of a latitude, longitude,
- * timestamp, accuracy, and other information such as bearing, altitude and velocity.
- *
- * <p>All locations generated through {@link LocationManager} are guaranteed to have a valid
- * latitude, longitude, timestamp (both Unix epoch time and elapsed realtime since boot), and
- * accuracy. All other parameters are optional.
- *
- * <p class="note">Note that Android provides the ability for applications to submit "mock" or faked
- * locations through {@link LocationManager}, and that these locations can then be received by
- * applications using LocationManager to obtain location information. These locations can be
- * identified via the {@link #isMock()} API. Applications that wish to determine if a given location
- * represents the best estimate of the real position of the device as opposed to a fake location
- * coming from another application or the user should use this API. Keep in mind that the user may
- * have a good reason for mocking their location, and thus apps should generally reject mock
- * locations only when it is essential to their use case that only real locations are accepted.
- */
-public class Location implements Parcelable {
-
- /**
- * Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD.DDDDD
- * where D indicates degrees.
- */
- public static final int FORMAT_DEGREES = 0;
-
- /**
- * Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD:MM.MMMMM"
- * where D indicates degrees and M indicates minutes of arc (1 minute = 1/60th of a degree).
- */
- public static final int FORMAT_MINUTES = 1;
-
- /**
- * Constant used to specify formatting of a latitude or longitude in the form "DDD:MM:SS.SSSSS"
- * where D indicates degrees, M indicates minutes of arc, and S indicates seconds of arc (1
- * minute = 1/60th of a degree, 1 second = 1/3600th of a degree).
- */
- public static final int FORMAT_SECONDS = 2;
-
- /** @hide */
- @Retention(RetentionPolicy.SOURCE)
- @IntDef({FORMAT_DEGREES, FORMAT_MINUTES, FORMAT_SECONDS})
- public @interface Format {}
-
- /**
- * Bundle key for a version of the location containing no GPS data.
- *
- * @hide
- * @deprecated As of Android R, this extra is longer in use, since it is not necessary to keep
- * gps locations separate from other locations for coarsening. Providers that do not need to
- * support platforms below Android R should not use this constant.
- */
- @SystemApi
- @Deprecated
- public static final String EXTRA_NO_GPS_LOCATION = "noGPSLocation";
-
- private static final int HAS_ALTITUDE_MASK = 1 << 0;
- private static final int HAS_SPEED_MASK = 1 << 1;
- private static final int HAS_BEARING_MASK = 1 << 2;
- private static final int HAS_HORIZONTAL_ACCURACY_MASK = 1 << 3;
- private static final int HAS_MOCK_PROVIDER_MASK = 1 << 4;
- private static final int HAS_ALTITUDE_ACCURACY_MASK = 1 << 5;
- private static final int HAS_SPEED_ACCURACY_MASK = 1 << 6;
- private static final int HAS_BEARING_ACCURACY_MASK = 1 << 7;
- private static final int HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK = 1 << 8;
- private static final int HAS_MSL_ALTITUDE_MASK = 1 << 9;
- private static final int HAS_MSL_ALTITUDE_ACCURACY_MASK = 1 << 10;
-
- // Cached data to make bearing/distance computations more efficient for the case
- // where distanceTo and bearingTo are called in sequence. Assume this typically happens
- // on the same thread for caching purposes.
- private static final ThreadLocal<BearingDistanceCache> sBearingDistanceCache =
- ThreadLocal.withInitial(BearingDistanceCache::new);
-
- // A bitmask of fields present in this object (see HAS_* constants defined above).
- private int mFieldsMask = 0;
-
- private @Nullable String mProvider;
- private long mTimeMs;
- private long mElapsedRealtimeNs;
- private double mElapsedRealtimeUncertaintyNs;
- private double mLatitudeDegrees;
- private double mLongitudeDegrees;
- private float mHorizontalAccuracyMeters;
- private double mAltitudeMeters;
- private float mAltitudeAccuracyMeters;
- private float mSpeedMetersPerSecond;
- private float mSpeedAccuracyMetersPerSecond;
- private float mBearingDegrees;
- private float mBearingAccuracyDegrees;
- private double mMslAltitudeMeters;
- private float mMslAltitudeAccuracyMeters;
-
- private Bundle mExtras = null;
-
- /**
- * Constructs a new location with a named provider. By default all values are zero, and no
- * optional values are present.
- *
- * @param provider the location provider name associated with this location
- */
- public Location(@Nullable String provider) {
- mProvider = provider;
- }
-
- /**
- * Constructs a new location copied from the given location.
- */
- public Location(@NonNull Location location) {
- set(location);
- }
-
- /**
- * Turns this location into a copy of the given location.
- */
- public void set(@NonNull Location location) {
- mFieldsMask = location.mFieldsMask;
- mProvider = location.mProvider;
- mTimeMs = location.mTimeMs;
- mElapsedRealtimeNs = location.mElapsedRealtimeNs;
- mElapsedRealtimeUncertaintyNs = location.mElapsedRealtimeUncertaintyNs;
- mLatitudeDegrees = location.mLatitudeDegrees;
- mLongitudeDegrees = location.mLongitudeDegrees;
- mHorizontalAccuracyMeters = location.mHorizontalAccuracyMeters;
- mAltitudeMeters = location.mAltitudeMeters;
- mAltitudeAccuracyMeters = location.mAltitudeAccuracyMeters;
- mSpeedMetersPerSecond = location.mSpeedMetersPerSecond;
- mSpeedAccuracyMetersPerSecond = location.mSpeedAccuracyMetersPerSecond;
- mBearingDegrees = location.mBearingDegrees;
- mBearingAccuracyDegrees = location.mBearingAccuracyDegrees;
- mMslAltitudeMeters = location.mMslAltitudeMeters;
- mMslAltitudeAccuracyMeters = location.mMslAltitudeAccuracyMeters;
- mExtras = (location.mExtras == null) ? null : new Bundle(location.mExtras);
- }
-
- /**
- * Sets the provider to null, removes all optional fields, and sets the values of all other
- * fields to zero.
- */
- public void reset() {
- mProvider = null;
- mTimeMs = 0;
- mElapsedRealtimeNs = 0;
- mElapsedRealtimeUncertaintyNs = 0.0;
- mFieldsMask = 0;
- mLatitudeDegrees = 0;
- mLongitudeDegrees = 0;
- mAltitudeMeters = 0;
- mSpeedMetersPerSecond = 0;
- mBearingDegrees = 0;
- mHorizontalAccuracyMeters = 0;
- mAltitudeAccuracyMeters = 0;
- mSpeedAccuracyMetersPerSecond = 0;
- mBearingAccuracyDegrees = 0;
- mMslAltitudeMeters = 0;
- mMslAltitudeAccuracyMeters = 0;
- mExtras = null;
- }
-
- /**
- * Returns the approximate distance in meters between this location and the given location.
- * Distance is defined using the WGS84 ellipsoid.
- *
- * @param dest the destination location
- * @return the approximate distance in meters
- */
- public @FloatRange(from = 0.0) float distanceTo(@NonNull Location dest) {
- BearingDistanceCache cache = sBearingDistanceCache.get();
- // See if we already have the result
- if (mLatitudeDegrees != cache.mLat1 || mLongitudeDegrees != cache.mLon1
- || dest.mLatitudeDegrees != cache.mLat2 || dest.mLongitudeDegrees != cache.mLon2) {
- computeDistanceAndBearing(mLatitudeDegrees, mLongitudeDegrees,
- dest.mLatitudeDegrees, dest.mLongitudeDegrees, cache);
- }
- return cache.mDistance;
- }
-
- /**
- * Returns the approximate initial bearing in degrees east of true north when traveling along
- * the shortest path between this location and the given location. The shortest path is defined
- * using the WGS84 ellipsoid. Locations that are (nearly) antipodal may produce meaningless
- * results.
- *
- * @param dest the destination location
- * @return the initial bearing in degrees
- */
- public float bearingTo(@NonNull Location dest) {
- BearingDistanceCache cache = sBearingDistanceCache.get();
- // See if we already have the result
- if (mLatitudeDegrees != cache.mLat1 || mLongitudeDegrees != cache.mLon1
- || dest.mLatitudeDegrees != cache.mLat2 || dest.mLongitudeDegrees != cache.mLon2) {
- computeDistanceAndBearing(mLatitudeDegrees, mLongitudeDegrees,
- dest.mLatitudeDegrees, dest.mLongitudeDegrees, cache);
- }
- return cache.mInitialBearing;
- }
-
- /**
- * Returns the name of the provider associated with this location.
- *
- * @return the name of the provider
- */
- public @Nullable String getProvider() {
- return mProvider;
- }
-
- /**
- * Sets the name of the provider associated with this location
- *
- * @param provider the name of the provider
- */
- public void setProvider(@Nullable String provider) {
- mProvider = provider;
- }
-
- /**
- * Returns the Unix epoch time of this location fix, in milliseconds since the start of the Unix
- * epoch (00:00:00 January 1, 1970 UTC).
- *
- * <p>There is no guarantee that different locations have times set from the same clock.
- * Locations derived from the {@link LocationManager#GPS_PROVIDER} are guaranteed to have their
- * time originate from the clock in use by the satellite constellation that provided the fix.
- * Locations derived from other providers may use any clock to set their time, though it is most
- * common to use the device's Unix epoch time system clock (which may be incorrect).
- *
- * <p>Note that the device's Unix epoch time system clock is not monotonic; it can jump forwards
- * or backwards unpredictably and may be changed at any time by the user, so this time should
- * not be used to order or compare locations. Prefer {@link #getElapsedRealtimeNanos} for that
- * purpose, as the elapsed realtime clock is guaranteed to be monotonic.
- *
- * <p>On the other hand, this method may be useful for presenting a human-readable time to the
- * user, or as a heuristic for comparing location fixes across reboot or across devices.
- *
- * <p>All locations generated by the {@link LocationManager} are guaranteed to have this time
- * set, however remember that the device's system clock may have changed since the location was
- * generated.
- *
- * @return the Unix epoch time of this location
- */
- public @IntRange(from = 0) long getTime() {
- return mTimeMs;
- }
-
- /**
- * Sets the Unix epoch time of this location fix, in milliseconds since the start of the Unix
- * epoch (00:00:00 January 1 1970 UTC).
- *
- * @param timeMs the Unix epoch time of this location
- */
- public void setTime(@IntRange(from = 0) long timeMs) {
- mTimeMs = timeMs;
- }
-
- /**
- * Return the time of this fix in nanoseconds of elapsed realtime since system boot.
- *
- * <p>This value can be compared with {@link android.os.SystemClock#elapsedRealtimeNanos} to
- * reliably order or compare locations. This is reliable because elapsed realtime is guaranteed
- * to be monotonic and continues to increment even when the system is in deep sleep (unlike
- * {@link #getTime}). However, since elapsed realtime is with reference to system boot, it does
- * not make sense to use this value to order or compare locations across boot cycles or devices.
- *
- * <p>All locations generated by the {@link LocationManager} are guaranteed to have a valid
- * elapsed realtime set.
- *
- * @return elapsed realtime of this location in nanoseconds
- */
- public @IntRange(from = 0) long getElapsedRealtimeNanos() {
- return mElapsedRealtimeNs;
- }
-
- /**
- * Return the time of this fix in milliseconds of elapsed realtime since system boot.
- *
- * @return elapsed realtime of this location in milliseconds
- * @see #getElapsedRealtimeNanos()
- */
- public @IntRange(from = 0) long getElapsedRealtimeMillis() {
- return NANOSECONDS.toMillis(mElapsedRealtimeNs);
- }
-
- /**
- * A convenience methods that returns the age of this location in milliseconds with respect to
- * the current elapsed realtime.
- *
- * @return age of this location in milliseconds
- */
- public @IntRange(from = 0) long getElapsedRealtimeAgeMillis() {
- return getElapsedRealtimeAgeMillis(SystemClock.elapsedRealtime());
- }
-
- /**
- * A convenience method that returns the age of this location with respect to the given
- * reference elapsed realtime.
- *
- * @param referenceRealtimeMs reference realtime in milliseconds
- * @return age of this location in milliseconds
- */
- public long getElapsedRealtimeAgeMillis(
- @IntRange(from = 0) long referenceRealtimeMs) {
- return referenceRealtimeMs - getElapsedRealtimeMillis();
- }
-
- /**
- * Set the time of this location in nanoseconds of elapsed realtime since system boot.
- *
- * @param elapsedRealtimeNs elapsed realtime in nanoseconds
- */
- public void setElapsedRealtimeNanos(@IntRange(from = 0) long elapsedRealtimeNs) {
- mElapsedRealtimeNs = elapsedRealtimeNs;
- }
-
- /**
- * Get the uncertainty in nanoseconds of the precision of {@link #getElapsedRealtimeNanos()} at
- * the 68th percentile confidence level. This means that there is 68% chance that the true
- * elapsed realtime of this location is within {@link #getElapsedRealtimeNanos()} +/- this
- * uncertainty.
- *
- * <p>This is only valid if {@link #hasElapsedRealtimeUncertaintyNanos()} is true.
- *
- * @return uncertainty in nanoseconds of the elapsed realtime of this location
- */
- public @FloatRange(from = 0.0) double getElapsedRealtimeUncertaintyNanos() {
- return mElapsedRealtimeUncertaintyNs;
- }
-
- /**
- * Sets the uncertainty in nanoseconds of the precision of the elapsed realtime timestamp at a
- * 68% confidence level.
- *
- * @param elapsedRealtimeUncertaintyNs uncertainty in nanoseconds of the elapsed realtime of
- * this location
- */
- public void setElapsedRealtimeUncertaintyNanos(
- @FloatRange(from = 0.0) double elapsedRealtimeUncertaintyNs) {
- mElapsedRealtimeUncertaintyNs = elapsedRealtimeUncertaintyNs;
- mFieldsMask |= HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK;
- }
-
- /**
- * True if this location has an elapsed realtime uncertainty, false otherwise.
- */
- public boolean hasElapsedRealtimeUncertaintyNanos() {
- return (mFieldsMask & HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK) != 0;
- }
-
- /**
- * Removes the elapsed realtime uncertainty from this location.
- */
- public void removeElapsedRealtimeUncertaintyNanos() {
- mFieldsMask &= ~HAS_ELAPSED_REALTIME_UNCERTAINTY_MASK;
- }
-
- /**
- * Get the latitude in degrees. All locations generated by the {@link LocationManager} will have
- * a valid latitude.
- *
- * @return latitude of this location
- */
- public @FloatRange(from = -90.0, to = 90.0) double getLatitude() {
- return mLatitudeDegrees;
- }
-
- /**
- * Set the latitude of this location.
- *
- * @param latitudeDegrees latitude in degrees
- */
- public void setLatitude(@FloatRange(from = -90.0, to = 90.0) double latitudeDegrees) {
- mLatitudeDegrees = latitudeDegrees;
- }
-
- /**
- * Get the longitude in degrees. All locations generated by the {@link LocationManager} will
- * have a valid longitude.
- *
- * @return longitude of this location
- */
- public @FloatRange(from = -180.0, to = 180.0) double getLongitude() {
- return mLongitudeDegrees;
- }
-
- /**
- * Set the longitude of this location.
- *
- * @param longitudeDegrees longitude in degrees
- */
- public void setLongitude(@FloatRange(from = -180.0, to = 180.0) double longitudeDegrees) {
- mLongitudeDegrees = longitudeDegrees;
- }
-
- /**
- * Returns the estimated horizontal accuracy radius in meters of this location at the 68th
- * percentile confidence level. This means that there is a 68% chance that the true location of
- * the device is within a distance of this uncertainty of the reported location. Another way of
- * putting this is that if a circle with a radius equal to this accuracy is drawn around the
- * reported location, there is a 68% chance that the true location falls within this circle.
- * This accuracy value is only valid for horizontal positioning, and not vertical positioning.
- *
- * <p>This is only valid if {@link #hasAccuracy()} is true. All locations generated by the
- * {@link LocationManager} include horizontal accuracy.
- *
- * @return horizontal accuracy of this location
- */
- public @FloatRange(from = 0.0) float getAccuracy() {
- return mHorizontalAccuracyMeters;
- }
-
- /**
- * Set the horizontal accuracy in meters of this location.
- *
- * @param horizontalAccuracyMeters horizontal altitude in meters
- */
- public void setAccuracy(@FloatRange(from = 0.0) float horizontalAccuracyMeters) {
- mHorizontalAccuracyMeters = horizontalAccuracyMeters;
- mFieldsMask |= HAS_HORIZONTAL_ACCURACY_MASK;
- }
-
- /**
- * Returns true if this location has a horizontal accuracy, false otherwise.
- */
- public boolean hasAccuracy() {
- return (mFieldsMask & HAS_HORIZONTAL_ACCURACY_MASK) != 0;
- }
-
- /**
- * Remove the horizontal accuracy from this location.
- */
- public void removeAccuracy() {
- mFieldsMask &= ~HAS_HORIZONTAL_ACCURACY_MASK;
- }
-
- /**
- * The altitude of this location in meters above the WGS84 reference ellipsoid.
- *
- * <p>This is only valid if {@link #hasAltitude()} is true.
- *
- * @return altitude of this location
- */
- public @FloatRange double getAltitude() {
- return mAltitudeMeters;
- }
-
- /**
- * Set the altitude of this location in meters above the WGS84 reference ellipsoid.
- *
- * @param altitudeMeters altitude in meters
- */
- public void setAltitude(@FloatRange double altitudeMeters) {
- mAltitudeMeters = altitudeMeters;
- mFieldsMask |= HAS_ALTITUDE_MASK;
- }
-
- /**
- * Returns true if this location has an altitude, false otherwise.
- */
- public boolean hasAltitude() {
- return (mFieldsMask & HAS_ALTITUDE_MASK) != 0;
- }
-
- /**
- * Removes the altitude from this location.
- */
- public void removeAltitude() {
- mFieldsMask &= ~HAS_ALTITUDE_MASK;
- }
-
- /**
- * Returns the estimated altitude accuracy in meters of this location at the 68th percentile
- * confidence level. This means that there is 68% chance that the true altitude of this location
- * falls within {@link #getAltitude()} ()} +/- this uncertainty.
- *
- * <p>This is only valid if {@link #hasVerticalAccuracy()} is true.
- *
- * @return vertical accuracy of this location
- */
- public @FloatRange(from = 0.0) float getVerticalAccuracyMeters() {
- return mAltitudeAccuracyMeters;
- }
-
- /**
- * Set the altitude accuracy of this location in meters.
- *
- * @param altitudeAccuracyMeters altitude accuracy in meters
- */
- public void setVerticalAccuracyMeters(@FloatRange(from = 0.0) float altitudeAccuracyMeters) {
- mAltitudeAccuracyMeters = altitudeAccuracyMeters;
- mFieldsMask |= HAS_ALTITUDE_ACCURACY_MASK;
- }
-
- /**
- * Returns true if this location has a vertical accuracy, false otherwise.
- */
- public boolean hasVerticalAccuracy() {
- return (mFieldsMask & HAS_ALTITUDE_ACCURACY_MASK) != 0;
- }
-
- /**
- * Remove the vertical accuracy from this location.
- */
- public void removeVerticalAccuracy() {
- mFieldsMask &= ~HAS_ALTITUDE_ACCURACY_MASK;
- }
-
- /**
- * Returns the speed at the time of this location in meters per second. Note that the speed
- * returned here may be more accurate than would be obtained simply by calculating
- * {@code distance / time} for sequential positions, such as if the Doppler measurements from
- * GNSS satellites are taken into account.
- *
- * <p>This is only valid if {@link #hasSpeed()} is true.
- *
- * @return speed at the time of this location
- */
- public @FloatRange(from = 0.0) float getSpeed() {
- return mSpeedMetersPerSecond;
- }
-
- /**
- * Set the speed at the time of this location, in meters per second.
- *
- * @param speedMetersPerSecond speed in meters per second
- */
- public void setSpeed(@FloatRange(from = 0.0) float speedMetersPerSecond) {
- mSpeedMetersPerSecond = speedMetersPerSecond;
- mFieldsMask |= HAS_SPEED_MASK;
- }
-
- /**
- * True if this location has a speed, false otherwise.
- */
- public boolean hasSpeed() {
- return (mFieldsMask & HAS_SPEED_MASK) != 0;
- }
-
- /**
- * Remove the speed from this location.
- */
- public void removeSpeed() {
- mFieldsMask &= ~HAS_SPEED_MASK;
- }
-
- /**
- * Returns the estimated speed accuracy in meters per second of this location at the 68th
- * percentile confidence level. This means that there is 68% chance that the true speed at the
- * time of this location falls within {@link #getSpeed()} ()} +/- this uncertainty.
- *
- * <p>This is only valid if {@link #hasSpeedAccuracy()} is true.
- *
- * @return vertical accuracy of this location
- */
- public @FloatRange(from = 0.0) float getSpeedAccuracyMetersPerSecond() {
- return mSpeedAccuracyMetersPerSecond;
- }
-
- /**
- * Set the speed accuracy of this location in meters per second.
- *
- * @param speedAccuracyMeterPerSecond speed accuracy in meters per second
- */
- public void setSpeedAccuracyMetersPerSecond(
- @FloatRange(from = 0.0) float speedAccuracyMeterPerSecond) {
- mSpeedAccuracyMetersPerSecond = speedAccuracyMeterPerSecond;
- mFieldsMask |= HAS_SPEED_ACCURACY_MASK;
- }
-
- /**
- * Returns true if this location has a speed accuracy, false otherwise.
- */
- public boolean hasSpeedAccuracy() {
- return (mFieldsMask & HAS_SPEED_ACCURACY_MASK) != 0;
- }
-
- /**
- * Remove the speed accuracy from this location.
- */
- public void removeSpeedAccuracy() {
- mFieldsMask &= ~HAS_SPEED_ACCURACY_MASK;
- }
-
- /**
- * Returns the bearing at the time of this location in degrees. Bearing is the horizontal
- * direction of travel of this device and is unrelated to the device orientation. The bearing
- * is guaranteed to be in the range [0, 360).
- *
- * <p>This is only valid if {@link #hasBearing()} is true.
- *
- * @return bearing at the time of this location
- */
- public @FloatRange(from = 0.0, to = 360.0, toInclusive = false) float getBearing() {
- return mBearingDegrees;
- }
-
- /**
- * Set the bearing at the time of this location, in degrees. The given bearing will be converted
- * into the range [0, 360).
- *
- * <p class="note">Note: passing in extremely high or low floating point values to this function
- * may produce strange results due to the intricacies of floating point math.
- *
- * @param bearingDegrees bearing in degrees
- */
- public void setBearing(
- @FloatRange(fromInclusive = false, toInclusive = false) float bearingDegrees) {
- Preconditions.checkArgument(Float.isFinite(bearingDegrees));
-
- // final addition of zero is to remove -0 results. while these are technically within the
- // range [0, 360) according to IEEE semantics, this eliminates possible user confusion.
- float modBearing = bearingDegrees % 360f + 0f;
- if (modBearing < 0) {
- modBearing += 360f;
- }
- mBearingDegrees = modBearing;
- mFieldsMask |= HAS_BEARING_MASK;
- }
-
- /**
- * True if this location has a bearing, false otherwise.
- */
- public boolean hasBearing() {
- return (mFieldsMask & HAS_BEARING_MASK) != 0;
- }
-
- /**
- * Remove the bearing from this location.
- */
- public void removeBearing() {
- mFieldsMask &= ~HAS_BEARING_MASK;
- }
-
- /**
- * Returns the estimated bearing accuracy in degrees of this location at the 68th percentile
- * confidence level. This means that there is 68% chance that the true bearing at the
- * time of this location falls within {@link #getBearing()} ()} +/- this uncertainty.
- *
- * <p>This is only valid if {@link #hasBearingAccuracy()} ()} is true.
- *
- * @return bearing accuracy in degrees of this location
- */
- public @FloatRange(from = 0.0) float getBearingAccuracyDegrees() {
- return mBearingAccuracyDegrees;
- }
-
- /**
- * Set the bearing accuracy in degrees of this location.
- *
- * @param bearingAccuracyDegrees bearing accuracy in degrees
- */
- public void setBearingAccuracyDegrees(@FloatRange(from = 0.0) float bearingAccuracyDegrees) {
- mBearingAccuracyDegrees = bearingAccuracyDegrees;
- mFieldsMask |= HAS_BEARING_ACCURACY_MASK;
- }
-
- /**
- * Returns true if this location has a bearing accuracy, false otherwise.
- */
- public boolean hasBearingAccuracy() {
- return (mFieldsMask & HAS_BEARING_ACCURACY_MASK) != 0;
- }
-
- /**
- * Remove the bearing accuracy from this location.
- */
- public void removeBearingAccuracy() {
- mFieldsMask &= ~HAS_BEARING_ACCURACY_MASK;
- }
-
- /**
- * Returns the Mean Sea Level altitude of this location in meters.
- *
- * <p>This is only valid if {@link #hasMslAltitude()} is true.
- */
- public @FloatRange double getMslAltitudeMeters() {
- return mMslAltitudeMeters;
- }
-
- /**
- * Sets the Mean Sea Level altitude of this location in meters.
- */
- public void setMslAltitudeMeters(@FloatRange double mslAltitudeMeters) {
- mMslAltitudeMeters = mslAltitudeMeters;
- mFieldsMask |= HAS_MSL_ALTITUDE_MASK;
- }
-
- /**
- * Returns true if this location has a Mean Sea Level altitude, false otherwise.
- */
- public boolean hasMslAltitude() {
- return (mFieldsMask & HAS_MSL_ALTITUDE_MASK) != 0;
- }
-
- /**
- * Removes the Mean Sea Level altitude from this location.
- */
- public void removeMslAltitude() {
- mFieldsMask &= ~HAS_MSL_ALTITUDE_MASK;
- }
-
- /**
- * Returns the estimated Mean Sea Level altitude accuracy in meters of this location at the 68th
- * percentile confidence level. This means that there is 68% chance that the true Mean Sea Level
- * altitude of this location falls within {@link #getMslAltitudeMeters()} +/- this uncertainty.
- *
- * <p>This is only valid if {@link #hasMslAltitudeAccuracy()} is true.
- */
- public @FloatRange(from = 0.0) float getMslAltitudeAccuracyMeters() {
- return mMslAltitudeAccuracyMeters;
- }
-
- /**
- * Sets the Mean Sea Level altitude accuracy of this location in meters.
- */
- public void setMslAltitudeAccuracyMeters(
- @FloatRange(from = 0.0) float mslAltitudeAccuracyMeters) {
- mMslAltitudeAccuracyMeters = mslAltitudeAccuracyMeters;
- mFieldsMask |= HAS_MSL_ALTITUDE_ACCURACY_MASK;
- }
-
- /**
- * Returns true if this location has a Mean Sea Level altitude accuracy, false otherwise.
- */
- public boolean hasMslAltitudeAccuracy() {
- return (mFieldsMask & HAS_MSL_ALTITUDE_ACCURACY_MASK) != 0;
- }
-
- /**
- * Removes the Mean Sea Level altitude accuracy from this location.
- */
- public void removeMslAltitudeAccuracy() {
- mFieldsMask &= ~HAS_MSL_ALTITUDE_ACCURACY_MASK;
- }
-
- /**
- * Returns true if this is a mock location. If this location comes from the Android framework,
- * this indicates that the location was provided by a test location provider, and thus may not
- * be related to the actual location of the device.
- *
- * @return true if this location came from a mock provider, false otherwise
- * @deprecated Prefer {@link #isMock()} instead.
- */
- @Deprecated
- public boolean isFromMockProvider() {
- return isMock();
- }
-
- /**
- * Flag this location as having come from a mock provider or not.
- *
- * @param isFromMockProvider true if this location came from a mock provider, false otherwise
- * @deprecated Prefer {@link #setMock(boolean)} instead.
- * @hide
- */
- @Deprecated
- @SystemApi
- public void setIsFromMockProvider(boolean isFromMockProvider) {
- setMock(isFromMockProvider);
- }
-
- /**
- * Returns true if this location is marked as a mock location. If this location comes from the
- * Android framework, this indicates that the location was provided by a test location provider,
- * and thus may not be related to the actual location of the device.
- *
- * @see LocationManager#addTestProvider
- */
- public boolean isMock() {
- return (mFieldsMask & HAS_MOCK_PROVIDER_MASK) != 0;
- }
-
- /**
- * Sets whether this location is marked as a mock location.
- */
- public void setMock(boolean mock) {
- if (mock) {
- mFieldsMask |= HAS_MOCK_PROVIDER_MASK;
- } else {
- mFieldsMask &= ~HAS_MOCK_PROVIDER_MASK;
- }
- }
-
- /**
- * Returns an optional bundle of additional information associated with this location. The keys
- * and values within the bundle are determined by the location provider.
- *
- * <p> Common key/value pairs are listed below. There is no guarantee that these key/value pairs
- * will be present for any location.
- *
- * <ul>
- * <li> satellites - the number of satellites used to derive a GNSS fix. This key was deprecated
- * in API 34 because the information can be obtained through more accurate means, such as by
- * referencing {@link GnssStatus#usedInFix}.
- * </ul>
- */
- public @Nullable Bundle getExtras() {
- return mExtras;
- }
-
- /**
- * Sets the extra information associated with this fix to the given Bundle.
- *
- * <p>Note this stores a copy of the given extras, so any changes to extras after calling this
- * method won't be reflected in the location bundle.
- */
- public void setExtras(@Nullable Bundle extras) {
- mExtras = (extras == null) ? null : new Bundle(extras);
- }
-
- /**
- * Return true if this location is considered complete. A location is considered complete if it
- * has a non-null provider, accuracy, and non-zero time and elapsed realtime. The exact
- * definition of completeness may change over time.
- *
- * <p>All locations supplied by the {@link LocationManager} are guaranteed to be complete.
- */
- public boolean isComplete() {
- return mProvider != null && hasAccuracy() && mTimeMs != 0 && mElapsedRealtimeNs != 0;
- }
-
- /**
- * Helper to fill incomplete fields with valid (but likely nonsensical) values.
- *
- * @hide
- */
- @SystemApi
- public void makeComplete() {
- if (mProvider == null) {
- mProvider = "";
- }
- if (!hasAccuracy()) {
- mFieldsMask |= HAS_HORIZONTAL_ACCURACY_MASK;
- mHorizontalAccuracyMeters = 100.0f;
- }
- if (mTimeMs == 0) {
- mTimeMs = System.currentTimeMillis();
- }
- if (mElapsedRealtimeNs == 0) {
- mElapsedRealtimeNs = SystemClock.elapsedRealtimeNanos();
- }
- }
-
- /**
- * Location equality is provided primarily for test purposes. Comparing locations for equality
- * in production may indicate incorrect assumptions, and should be avoided whenever possible.
- *
- * <p>{@inheritDoc}
- */
- @Override
- public boolean equals(@Nullable Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof Location)) {
- return false;
- }
-
- Location location = (Location) o;
- return mTimeMs == location.mTimeMs
- && mElapsedRealtimeNs == location.mElapsedRealtimeNs
- && hasElapsedRealtimeUncertaintyNanos()
- == location.hasElapsedRealtimeUncertaintyNanos()
- && (!hasElapsedRealtimeUncertaintyNanos() || Double.compare(
- location.mElapsedRealtimeUncertaintyNs, mElapsedRealtimeUncertaintyNs) == 0)
- && Double.compare(location.mLatitudeDegrees, mLatitudeDegrees) == 0
- && Double.compare(location.mLongitudeDegrees, mLongitudeDegrees) == 0
- && hasAltitude() == location.hasAltitude()
- && (!hasAltitude() || Double.compare(location.mAltitudeMeters, mAltitudeMeters)
- == 0)
- && hasSpeed() == location.hasSpeed()
- && (!hasSpeed() || Float.compare(location.mSpeedMetersPerSecond,
- mSpeedMetersPerSecond) == 0)
- && hasBearing() == location.hasBearing()
- && (!hasBearing() || Float.compare(location.mBearingDegrees, mBearingDegrees) == 0)
- && hasAccuracy() == location.hasAccuracy()
- && (!hasAccuracy() || Float.compare(location.mHorizontalAccuracyMeters,
- mHorizontalAccuracyMeters) == 0)
- && hasVerticalAccuracy() == location.hasVerticalAccuracy()
- && (!hasVerticalAccuracy() || Float.compare(location.mAltitudeAccuracyMeters,
- mAltitudeAccuracyMeters) == 0)
- && hasSpeedAccuracy() == location.hasSpeedAccuracy()
- && (!hasSpeedAccuracy() || Float.compare(location.mSpeedAccuracyMetersPerSecond,
- mSpeedAccuracyMetersPerSecond) == 0)
- && hasBearingAccuracy() == location.hasBearingAccuracy()
- && (!hasBearingAccuracy() || Float.compare(location.mBearingAccuracyDegrees,
- mBearingAccuracyDegrees) == 0)
- && hasMslAltitude() == location.hasMslAltitude()
- && (!hasMslAltitude() || Double.compare(location.mMslAltitudeMeters,
- mMslAltitudeMeters)
- == 0)
- && hasMslAltitudeAccuracy() == location.hasMslAltitudeAccuracy()
- && (!hasMslAltitudeAccuracy() || Float.compare(
- location.mMslAltitudeAccuracyMeters,
- mMslAltitudeAccuracyMeters) == 0)
- && Objects.equals(mProvider, location.mProvider)
- && areExtrasEqual(mExtras, location.mExtras);
- }
-
- private static boolean areExtrasEqual(@Nullable Bundle extras1, @Nullable Bundle extras2) {
- if ((extras1 == null || extras1.isEmpty()) && (extras2 == null || extras2.isEmpty())) {
- return true;
- } else if (extras1 == null || extras2 == null) {
- return false;
- } else {
- return extras1.kindofEquals(extras2);
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mProvider, mElapsedRealtimeNs, mLatitudeDegrees, mLongitudeDegrees);
- }
-
- @Override
- public @NonNull String toString() {
- StringBuilder s = new StringBuilder();
- s.append("Location[");
- s.append(mProvider);
- s.append(" ").append(String.format(Locale.ROOT, "%.6f,%.6f", mLatitudeDegrees,
- mLongitudeDegrees));
- if (hasAccuracy()) {
- s.append(" hAcc=").append(mHorizontalAccuracyMeters);
- }
- s.append(" et=");
- TimeUtils.formatDuration(getElapsedRealtimeMillis(), s);
- if (hasAltitude()) {
- s.append(" alt=").append(mAltitudeMeters);
- if (hasVerticalAccuracy()) {
- s.append(" vAcc=").append(mAltitudeAccuracyMeters);
- }
- }
- if (hasMslAltitude()) {
- s.append(" mslAlt=").append(mMslAltitudeMeters);
- if (hasMslAltitudeAccuracy()) {
- s.append(" mslAltAcc=").append(mMslAltitudeAccuracyMeters);
- }
- }
- if (hasSpeed()) {
- s.append(" vel=").append(mSpeedMetersPerSecond);
- if (hasSpeedAccuracy()) {
- s.append(" sAcc=").append(mSpeedAccuracyMetersPerSecond);
- }
- }
- if (hasBearing()) {
- s.append(" bear=").append(mBearingDegrees);
- if (hasBearingAccuracy()) {
- s.append(" bAcc=").append(mBearingAccuracyDegrees);
- }
- }
- if (isMock()) {
- s.append(" mock");
- }
-
- if (mExtras != null && !mExtras.isEmpty()) {
- s.append(" {").append(mExtras).append('}');
- }
- s.append(']');
- return s.toString();
- }
-
- /**
- * Dumps location information to the given Printer.
- *
- * @deprecated Prefer to use {@link #toString()} along with whatever custom formatting is
- * required instead of this method. It is not this class's job to manage print representations.
- */
- @Deprecated
- public void dump(@NonNull Printer pw, @Nullable String prefix) {
- pw.println(prefix + this);
- }
-
- public static final @NonNull Parcelable.Creator<Location> CREATOR =
- new Parcelable.Creator<Location>() {
- @Override
- public Location createFromParcel(Parcel in) {
- Location l = new Location(in.readString8());
- l.mFieldsMask = in.readInt();
- l.mTimeMs = in.readLong();
- l.mElapsedRealtimeNs = in.readLong();
- if (l.hasElapsedRealtimeUncertaintyNanos()) {
- l.mElapsedRealtimeUncertaintyNs = in.readDouble();
- }
- l.mLatitudeDegrees = in.readDouble();
- l.mLongitudeDegrees = in.readDouble();
- if (l.hasAltitude()) {
- l.mAltitudeMeters = in.readDouble();
- }
- if (l.hasSpeed()) {
- l.mSpeedMetersPerSecond = in.readFloat();
- }
- if (l.hasBearing()) {
- l.mBearingDegrees = in.readFloat();
- }
- if (l.hasAccuracy()) {
- l.mHorizontalAccuracyMeters = in.readFloat();
- }
- if (l.hasVerticalAccuracy()) {
- l.mAltitudeAccuracyMeters = in.readFloat();
- }
- if (l.hasSpeedAccuracy()) {
- l.mSpeedAccuracyMetersPerSecond = in.readFloat();
- }
- if (l.hasBearingAccuracy()) {
- l.mBearingAccuracyDegrees = in.readFloat();
- }
- if (l.hasMslAltitude()) {
- l.mMslAltitudeMeters = in.readDouble();
- }
- if (l.hasMslAltitudeAccuracy()) {
- l.mMslAltitudeAccuracyMeters = in.readFloat();
- }
- l.mExtras = Bundle.setDefusable(in.readBundle(), true);
- return l;
- }
-
- @Override
- public Location[] newArray(int size) {
- return new Location[size];
- }
- };
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel parcel, int flags) {
- parcel.writeString8(mProvider);
- parcel.writeInt(mFieldsMask);
- parcel.writeLong(mTimeMs);
- parcel.writeLong(mElapsedRealtimeNs);
- if (hasElapsedRealtimeUncertaintyNanos()) {
- parcel.writeDouble(mElapsedRealtimeUncertaintyNs);
- }
- parcel.writeDouble(mLatitudeDegrees);
- parcel.writeDouble(mLongitudeDegrees);
- if (hasAltitude()) {
- parcel.writeDouble(mAltitudeMeters);
- }
- if (hasSpeed()) {
- parcel.writeFloat(mSpeedMetersPerSecond);
- }
- if (hasBearing()) {
- parcel.writeFloat(mBearingDegrees);
- }
- if (hasAccuracy()) {
- parcel.writeFloat(mHorizontalAccuracyMeters);
- }
- if (hasVerticalAccuracy()) {
- parcel.writeFloat(mAltitudeAccuracyMeters);
- }
- if (hasSpeedAccuracy()) {
- parcel.writeFloat(mSpeedAccuracyMetersPerSecond);
- }
- if (hasBearingAccuracy()) {
- parcel.writeFloat(mBearingAccuracyDegrees);
- }
- if (hasMslAltitude()) {
- parcel.writeDouble(mMslAltitudeMeters);
- }
- if (hasMslAltitudeAccuracy()) {
- parcel.writeFloat(mMslAltitudeAccuracyMeters);
- }
- parcel.writeBundle(mExtras);
- }
-
- /**
- * Converts a latitude/longitude coordinate to a String representation. The outputType must be
- * one of {@link #FORMAT_DEGREES}, {@link #FORMAT_MINUTES}, or {@link #FORMAT_SECONDS}. The
- * coordinate must be a number between -180.0 and 180.0, inclusive. This conversion is performed
- * in a method that is dependent on the default locale, and so is not guaranteed to round-trip
- * with {@link #convert(String)}.
- *
- * @throws IllegalArgumentException if coordinate is less than -180.0, greater than 180.0, or is
- * not a number.
- * @throws IllegalArgumentException if outputType is not a recognized value.
- */
- public static @NonNull String convert(@FloatRange double coordinate, @Format int outputType) {
- Preconditions.checkArgumentInRange(coordinate, -180D, 180D, "coordinate");
- Preconditions.checkArgument(outputType == FORMAT_DEGREES || outputType == FORMAT_MINUTES
- || outputType == FORMAT_SECONDS, "%d is an unrecognized format", outputType);
-
- StringBuilder sb = new StringBuilder();
-
- if (coordinate < 0) {
- sb.append('-');
- coordinate = -coordinate;
- }
-
- DecimalFormat df = new DecimalFormat("###.#####");
- if (outputType == FORMAT_MINUTES || outputType == FORMAT_SECONDS) {
- int degrees = (int) Math.floor(coordinate);
- sb.append(degrees);
- sb.append(':');
- coordinate -= degrees;
- coordinate *= 60.0;
- if (outputType == FORMAT_SECONDS) {
- int minutes = (int) Math.floor(coordinate);
- sb.append(minutes);
- sb.append(':');
- coordinate -= minutes;
- coordinate *= 60.0;
- }
- }
- sb.append(df.format(coordinate));
- return sb.toString();
- }
-
- /**
- * Converts a String in one of the formats described by {@link #FORMAT_DEGREES},
- * {@link #FORMAT_MINUTES}, or {@link #FORMAT_SECONDS} into a double. This conversion is
- * performed in a locale agnostic method, and so is not guaranteed to round-trip with
- * {@link #convert(double, int)}.
- *
- * @throws NullPointerException if coordinate is null
- * @throws IllegalArgumentException if the coordinate is not
- * in one of the valid formats.
- */
- public static @FloatRange double convert(@NonNull String coordinate) {
- Objects.requireNonNull(coordinate);
-
- boolean negative = false;
- if (coordinate.charAt(0) == '-') {
- coordinate = coordinate.substring(1);
- negative = true;
- }
-
- StringTokenizer st = new StringTokenizer(coordinate, ":");
- int tokens = st.countTokens();
- if (tokens < 1) {
- throw new IllegalArgumentException("coordinate=" + coordinate);
- }
- try {
- String degrees = st.nextToken();
- double val;
- if (tokens == 1) {
- val = Double.parseDouble(degrees);
- return negative ? -val : val;
- }
-
- String minutes = st.nextToken();
- int deg = Integer.parseInt(degrees);
- double min;
- double sec = 0.0;
- boolean secPresent = false;
-
- if (st.hasMoreTokens()) {
- min = Integer.parseInt(minutes);
- String seconds = st.nextToken();
- sec = Double.parseDouble(seconds);
- secPresent = true;
- } else {
- min = Double.parseDouble(minutes);
- }
-
- boolean isNegative180 = negative && deg == 180 && min == 0 && sec == 0;
-
- // deg must be in [0, 179] except for the case of -180 degrees
- if (deg < 0.0 || (deg > 179 && !isNegative180)) {
- throw new IllegalArgumentException("coordinate=" + coordinate);
- }
-
- // min must be in [0, 59] if seconds are present, otherwise [0.0, 60.0)
- if (min < 0 || min >= 60 || (secPresent && min > 59)) {
- throw new IllegalArgumentException("coordinate=" + coordinate);
- }
-
- // sec must be in [0.0, 60.0)
- if (sec < 0 || sec >= 60) {
- throw new IllegalArgumentException("coordinate=" + coordinate);
- }
-
- val = deg * 3600.0 + min * 60.0 + sec;
- val /= 3600.0;
- return negative ? -val : val;
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("coordinate=" + coordinate, e);
- }
- }
-
- private static void computeDistanceAndBearing(double lat1, double lon1,
- double lat2, double lon2, BearingDistanceCache results) {
- // Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
- // using the "Inverse Formula" (section 4)
-
- // Convert lat/long to radians
- lat1 *= Math.PI / 180.0;
- lat2 *= Math.PI / 180.0;
- lon1 *= Math.PI / 180.0;
- lon2 *= Math.PI / 180.0;
-
- double a = 6378137.0; // WGS84 major axis
- double b = 6356752.3142; // WGS84 semi-major axis
- double f = (a - b) / a;
- double aSqMinusBSqOverBSq = (a * a - b * b) / (b * b);
-
- double l = lon2 - lon1;
- double aA = 0.0;
- double u1 = Math.atan((1.0 - f) * Math.tan(lat1));
- double u2 = Math.atan((1.0 - f) * Math.tan(lat2));
-
- double cosU1 = Math.cos(u1);
- double cosU2 = Math.cos(u2);
- double sinU1 = Math.sin(u1);
- double sinU2 = Math.sin(u2);
- double cosU1cosU2 = cosU1 * cosU2;
- double sinU1sinU2 = sinU1 * sinU2;
-
- double sigma = 0.0;
- double deltaSigma = 0.0;
- double cosSqAlpha;
- double cos2SM;
- double cosSigma;
- double sinSigma;
- double cosLambda = 0.0;
- double sinLambda = 0.0;
-
- double lambda = l; // initial guess
- for (int iter = 0; iter < 20; iter++) {
- double lambdaOrig = lambda;
- cosLambda = Math.cos(lambda);
- sinLambda = Math.sin(lambda);
- double t1 = cosU2 * sinLambda;
- double t2 = cosU1 * sinU2 - sinU1 * cosU2 * cosLambda;
- double sinSqSigma = t1 * t1 + t2 * t2;
- sinSigma = Math.sqrt(sinSqSigma);
- cosSigma = sinU1sinU2 + cosU1cosU2 * cosLambda;
- sigma = Math.atan2(sinSigma, cosSigma);
- double sinAlpha = (sinSigma == 0) ? 0.0 :
- cosU1cosU2 * sinLambda / sinSigma;
- cosSqAlpha = 1.0 - sinAlpha * sinAlpha;
- cos2SM = (cosSqAlpha == 0) ? 0.0 : cosSigma - 2.0 * sinU1sinU2 / cosSqAlpha;
-
- double uSquared = cosSqAlpha * aSqMinusBSqOverBSq;
- aA = 1 + (uSquared / 16384.0) * (4096.0 + uSquared * (-768 + uSquared * (320.0
- - 175.0 * uSquared)));
- double bB = (uSquared / 1024.0) * (256.0 + uSquared * (-128.0 + uSquared * (74.0
- - 47.0 * uSquared)));
- double cC = (f / 16.0) * cosSqAlpha * (4.0 + f * (4.0 - 3.0 * cosSqAlpha));
- double cos2SMSq = cos2SM * cos2SM;
- deltaSigma = bB * sinSigma * (cos2SM + (bB / 4.0) * (cosSigma * (-1.0 + 2.0 * cos2SMSq)
- - (bB / 6.0) * cos2SM * (-3.0 + 4.0 * sinSigma * sinSigma) * (-3.0
- + 4.0 * cos2SMSq)));
-
- lambda = l + (1.0 - cC) * f * sinAlpha * (sigma + cC * sinSigma * (cos2SM
- + cC * cosSigma * (-1.0 + 2.0 * cos2SM * cos2SM)));
-
- double delta = (lambda - lambdaOrig) / lambda;
- if (Math.abs(delta) < 1.0e-12) {
- break;
- }
- }
-
- results.mDistance = (float) (b * aA * (sigma - deltaSigma));
- float initialBearing = (float) Math.atan2(cosU2 * sinLambda,
- cosU1 * sinU2 - sinU1 * cosU2 * cosLambda);
- initialBearing = (float) (initialBearing * (180.0 / Math.PI));
- results.mInitialBearing = initialBearing;
- float finalBearing = (float) Math.atan2(cosU1 * sinLambda,
- -sinU1 * cosU2 + cosU1 * sinU2 * cosLambda);
- finalBearing = (float) (finalBearing * (180.0 / Math.PI));
- results.mFinalBearing = finalBearing;
- results.mLat1 = lat1;
- results.mLat2 = lat2;
- results.mLon1 = lon1;
- results.mLon2 = lon2;
- }
-
- /**
- * Computes the approximate distance in meters between two
- * locations, and optionally the initial and final bearings of the
- * shortest path between them. Distance and bearing are defined using the
- * WGS84 ellipsoid.
- *
- * <p> The computed distance is stored in results[0]. If results has length
- * 2 or greater, the initial bearing is stored in results[1]. If results has
- * length 3 or greater, the final bearing is stored in results[2].
- *
- * @param startLatitude the starting latitude
- * @param startLongitude the starting longitude
- * @param endLatitude the ending latitude
- * @param endLongitude the ending longitude
- * @param results an array of floats to hold the results
- *
- * @throws IllegalArgumentException if results is null or has length < 1
- */
- public static void distanceBetween(
- @FloatRange(from = -90.0, to = 90.0) double startLatitude,
- @FloatRange(from = -180.0, to = 180.0) double startLongitude,
- @FloatRange(from = -90.0, to = 90.0) double endLatitude,
- @FloatRange(from = -180.0, to = 180.0) double endLongitude,
- float[] results) {
- if (results == null || results.length < 1) {
- throw new IllegalArgumentException("results is null or has length < 1");
- }
- BearingDistanceCache cache = sBearingDistanceCache.get();
- computeDistanceAndBearing(startLatitude, startLongitude,
- endLatitude, endLongitude, cache);
- results[0] = cache.mDistance;
- if (results.length > 1) {
- results[1] = cache.mInitialBearing;
- if (results.length > 2) {
- results[2] = cache.mFinalBearing;
- }
- }
- }
-
- private static class BearingDistanceCache {
- double mLat1 = 0.0;
- double mLon1 = 0.0;
- double mLat2 = 0.0;
- double mLon2 = 0.0;
- float mDistance = 0.0f;
- float mInitialBearing = 0.0f;
- float mFinalBearing = 0.0f;
- }
-}
diff --git a/location/java/android/location/LocationTime.java b/location/java/android/location/LocationTime.java
deleted file mode 100644
index 2f03508..0000000
--- a/location/java/android/location/LocationTime.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.location;
-
-import android.annotation.NonNull;
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import java.time.Duration;
-import java.time.Instant;
-
-/**
- * Data class for passing GNSS-derived time.
- * @hide
- */
-public final class LocationTime implements Parcelable {
-
- private final long mUnixEpochTimeMillis;
- private final long mElapsedRealtimeNanos;
-
- public LocationTime(long unixEpochTimeMillis, long elapsedRealtimeNanos) {
- mUnixEpochTimeMillis = unixEpochTimeMillis;
- mElapsedRealtimeNanos = elapsedRealtimeNanos;
- }
-
- /**
- * The Unix epoch time in millis, according to the Gnss location provider.
- */
- public long getUnixEpochTimeMillis() {
- return mUnixEpochTimeMillis;
- }
-
- /**
- * The elapsed nanos since boot when {@link #getUnixEpochTimeMillis} was the current time.
- */
- public long getElapsedRealtimeNanos() {
- return mElapsedRealtimeNanos;
- }
-
- @Override
- public void writeToParcel(Parcel out, int flags) {
- out.writeLong(mUnixEpochTimeMillis);
- out.writeLong(mElapsedRealtimeNanos);
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public String toString() {
- return "LocationTime{"
- + "mUnixEpochTimeMillis=" + Instant.ofEpochMilli(mUnixEpochTimeMillis)
- + "(" + mUnixEpochTimeMillis + ")"
- + ", mElapsedRealtimeNanos=" + Duration.ofNanos(mElapsedRealtimeNanos)
- + "(" + mElapsedRealtimeNanos + ")"
- + '}';
- }
-
- public static final @NonNull Parcelable.Creator<LocationTime> CREATOR =
- new Parcelable.Creator<>() {
- public LocationTime createFromParcel(Parcel in) {
- long time = in.readLong();
- long elapsedRealtimeNanos = in.readLong();
- return new LocationTime(time, elapsedRealtimeNanos);
- }
-
- public LocationTime[] newArray(int size) {
- return new LocationTime[size];
- }
- };
-}