// 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 @FlaggedApi(Flags.FLAG_GNSS_API_MEASUREMENT_REQUEST_WORK_SOURCE) @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 @FlaggedApi(Flags.FLAG_GNSS_API_MEASUREMENT_REQUEST_WORK_SOURCE) @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);
  }

}

