Loading core/api/current.txt +21 −14 Original line number Diff line number Diff line Loading @@ -18942,7 +18942,9 @@ package android.location { } public static class GnssAntennaInfo.Builder { ctor public 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); Loading @@ -18950,8 +18952,8 @@ package android.location { 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>); @Deprecated public static interface GnssAntennaInfo.Listener { method @Deprecated public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>); } public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable { Loading Loading @@ -19124,11 +19126,11 @@ package android.location { public abstract static class GnssMeasurementsEvent.Callback { ctor public GnssMeasurementsEvent.Callback(); method public void onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent); method public void onStatusChanged(int); field public static final int STATUS_LOCATION_DISABLED = 2; // 0x2 field public static final int STATUS_NOT_ALLOWED = 3; // 0x3 field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0 field public static final int STATUS_READY = 1; // 0x1 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 { Loading Loading @@ -19164,10 +19166,10 @@ package android.location { public abstract static class GnssNavigationMessage.Callback { ctor public GnssNavigationMessage.Callback(); method public void onGnssNavigationMessageReceived(android.location.GnssNavigationMessage); method public void onStatusChanged(int); field public static final int STATUS_LOCATION_DISABLED = 2; // 0x2 field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0 field public static final int STATUS_READY = 1; // 0x1 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 GnssStatus implements android.os.Parcelable { Loading Loading @@ -19325,6 +19327,7 @@ package android.location { method @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(); Loading @@ -19337,7 +19340,7 @@ package android.location { method public boolean hasProvider(@NonNull String); method public boolean isLocationEnabled(); method public boolean isProviderEnabled(@NonNull String); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener); method @Deprecated 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); Loading Loading @@ -19374,10 +19377,14 @@ package android.location { 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 @Deprecated 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_ANTENNA_INFOS_CHANGED = "android.location.action.GNSS_ANTENNA_INFOS_CHANGED"; field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED"; field public static final String EXTRA_GNSS_ANTENNA_INFOS = "android.location.extra.GNSS_ANTENNA_INFOS"; 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"; location/java/android/location/GnssAntennaInfo.java +149 −74 Original line number Diff line number Diff line Loading @@ -34,17 +34,19 @@ import java.util.Objects; public final class GnssAntennaInfo implements Parcelable { private final double mCarrierFrequencyMHz; private final PhaseCenterOffset mPhaseCenterOffset; private final SphericalCorrections mPhaseCenterVariationCorrections; private final SphericalCorrections mSignalGainCorrections; private final @Nullable SphericalCorrections mPhaseCenterVariationCorrections; private final @Nullable SphericalCorrections mSignalGainCorrections; /** * Used for receiving GNSS antenna info from the GNSS engine. You can implement this interface * and call {@link LocationManager#registerAntennaInfoListener}; * Used for receiving GNSS antenna info from the GNSS engine. * * @deprecated Prefer to use a broadcast receiver for * {@link LocationManager#ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public interface Listener { /** * Returns the latest GNSS antenna info. This event is triggered when a listener is * registered, and whenever the antenna info changes (due to a device configuration change). * Invoked on a change to GNSS antenna info. */ void onGnssAntennaInfoReceived(@NonNull List<GnssAntennaInfo> gnssAntennaInfos); } Loading Loading @@ -172,6 +174,28 @@ public final class GnssAntennaInfo implements Parcelable { + ", OffsetZMm=" + mOffsetZMm + " +/-" + mOffsetZUncertaintyMm + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PhaseCenterOffset)) { return false; } PhaseCenterOffset that = (PhaseCenterOffset) o; return Double.compare(that.mOffsetXMm, mOffsetXMm) == 0 && Double.compare(that.mOffsetXUncertaintyMm, mOffsetXUncertaintyMm) == 0 && Double.compare(that.mOffsetYMm, mOffsetYMm) == 0 && Double.compare(that.mOffsetYUncertaintyMm, mOffsetYUncertaintyMm) == 0 && Double.compare(that.mOffsetZMm, mOffsetZMm) == 0 && Double.compare(that.mOffsetZUncertaintyMm, mOffsetZUncertaintyMm) == 0; } @Override public int hashCode() { return Objects.hash(mOffsetXMm, mOffsetYMm, mOffsetZMm); } } /** Loading @@ -190,38 +214,34 @@ public final class GnssAntennaInfo implements Parcelable { * i.e., deltaPhi = 180 / (number of columns - 1). */ public static final class SphericalCorrections implements Parcelable { private final double[][] mCorrections; private final double[][] mCorrectionUncertainties; private final double mDeltaTheta; private final double mDeltaPhi; private final int mNumRows; private final int mNumColumns; private final double[][] mCorrections; private final double[][] mCorrectionUncertainties; public SphericalCorrections(@NonNull double[][] corrections, @NonNull double[][] correctionUncertainties) { if (corrections.length != correctionUncertainties.length || corrections[0].length != correctionUncertainties[0].length) { throw new IllegalArgumentException("Correction and correction uncertainty arrays " + "must have the same dimensions."); if (corrections.length != correctionUncertainties.length || corrections.length < 1) { throw new IllegalArgumentException("correction and uncertainty arrays must have " + "the same (non-zero) dimensions"); } mNumRows = corrections.length; if (mNumRows < 1) { throw new IllegalArgumentException("Arrays must have at least one row."); } mNumColumns = corrections[0].length; if (mNumColumns < 2) { throw new IllegalArgumentException("Arrays must have at least two columns."); for (int i = 0; i < corrections.length; i++) { if (corrections[i].length != mNumColumns || correctionUncertainties[i].length != mNumColumns || mNumColumns < 2) { throw new IllegalArgumentException("correction and uncertainty arrays must all " + " have the same (greater than 2) number of columns"); } } mCorrections = corrections; mCorrectionUncertainties = correctionUncertainties; mDeltaTheta = 360.0d / mNumRows; mDeltaPhi = 180.0d / (mNumColumns - 1); } SphericalCorrections(Parcel in) { private SphericalCorrections(Parcel in) { int numRows = in.readInt(); int numColumns = in.readInt(); Loading @@ -231,19 +251,16 @@ public final class GnssAntennaInfo implements Parcelable { new double[numRows][numColumns]; for (int row = 0; row < numRows; row++) { in.readDoubleArray(corrections[row]); for (int col = 0; col < numColumns; col++) { corrections[row][col] = in.readDouble(); correctionUncertainties[row][col] = in.readDouble(); } for (int row = 0; row < numRows; row++) { in.readDoubleArray(correctionUncertainties[row]); } mNumRows = numRows; mNumColumns = numColumns; mCorrections = corrections; mCorrectionUncertainties = correctionUncertainties; mDeltaTheta = 360.0d / mNumRows; mDeltaPhi = 180.0d / (mNumColumns - 1); } /** Loading Loading @@ -286,7 +303,7 @@ public final class GnssAntennaInfo implements Parcelable { */ @FloatRange(from = 0.0f, to = 360.0f) public double getDeltaTheta() { return mDeltaTheta; return 360.0D / mNumRows; } /** Loading @@ -294,7 +311,7 @@ public final class GnssAntennaInfo implements Parcelable { */ @FloatRange(from = 0.0f, to = 180.0f) public double getDeltaPhi() { return mDeltaPhi; return 180.0D / (mNumColumns - 1); } Loading @@ -320,11 +337,11 @@ public final class GnssAntennaInfo implements Parcelable { public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mNumRows); dest.writeInt(mNumColumns); for (double[] row : mCorrections) { dest.writeDoubleArray(row); for (int row = 0; row < mNumRows; row++) { for (int col = 0; col < mNumColumns; col++) { dest.writeDouble(mCorrections[row][col]); dest.writeDouble(mCorrectionUncertainties[row][col]); } for (double[] row : mCorrectionUncertainties) { dest.writeDoubleArray(row); } } Loading @@ -333,22 +350,41 @@ public final class GnssAntennaInfo implements Parcelable { return "SphericalCorrections{" + "Corrections=" + Arrays.toString(mCorrections) + ", CorrectionUncertainties=" + Arrays.toString(mCorrectionUncertainties) + ", DeltaTheta=" + mDeltaTheta + ", DeltaPhi=" + mDeltaPhi + ", DeltaTheta=" + getDeltaTheta() + ", DeltaPhi=" + getDeltaPhi() + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SphericalCorrections)) { return false; } SphericalCorrections that = (SphericalCorrections) o; return mNumRows == that.mNumRows && mNumColumns == that.mNumColumns && Arrays.deepEquals(mCorrections, that.mCorrections) && Arrays.deepEquals(mCorrectionUncertainties, that.mCorrectionUncertainties); } @Override public int hashCode() { int result = Arrays.deepHashCode(mCorrections); result = 31 * result + Arrays.deepHashCode(mCorrectionUncertainties); return result; } } private GnssAntennaInfo( double carrierFrequencyMHz, @NonNull PhaseCenterOffset phaseCenterOffset, PhaseCenterOffset phaseCenterOffset, @Nullable SphericalCorrections phaseCenterVariationCorrections, @Nullable SphericalCorrections signalGainCorrectionDbi) { if (phaseCenterOffset == null) { throw new IllegalArgumentException("Phase Center Offset Coordinates cannot be null."); } mCarrierFrequencyMHz = carrierFrequencyMHz; mPhaseCenterOffset = phaseCenterOffset; mPhaseCenterOffset = Objects.requireNonNull(phaseCenterOffset); mPhaseCenterVariationCorrections = phaseCenterVariationCorrections; mSignalGainCorrections = signalGainCorrectionDbi; } Loading @@ -359,8 +395,28 @@ public final class GnssAntennaInfo implements Parcelable { public static class Builder { private double mCarrierFrequencyMHz; private PhaseCenterOffset mPhaseCenterOffset; private SphericalCorrections mPhaseCenterVariationCorrections; private SphericalCorrections mSignalGainCorrections; private @Nullable SphericalCorrections mPhaseCenterVariationCorrections; private @Nullable SphericalCorrections mSignalGainCorrections; /** * @deprecated Prefer {@link #Builder(double, PhaseCenterOffset)}. */ @Deprecated public Builder() { this(0, new PhaseCenterOffset(0, 0, 0, 0, 0, 0)); } public Builder(double carrierFrequencyMHz, @NonNull PhaseCenterOffset phaseCenterOffset) { mCarrierFrequencyMHz = carrierFrequencyMHz; mPhaseCenterOffset = Objects.requireNonNull(phaseCenterOffset); } public Builder(@NonNull GnssAntennaInfo antennaInfo) { mCarrierFrequencyMHz = antennaInfo.mCarrierFrequencyMHz; mPhaseCenterOffset = antennaInfo.mPhaseCenterOffset; mPhaseCenterVariationCorrections = antennaInfo.mPhaseCenterVariationCorrections; mSignalGainCorrections = antennaInfo.mSignalGainCorrections; } /** * Set antenna carrier frequency (MHz). Loading Loading @@ -462,19 +518,16 @@ public final class GnssAntennaInfo implements Parcelable { return mSignalGainCorrections; } public static final @android.annotation.NonNull Creator<GnssAntennaInfo> CREATOR = new Creator<GnssAntennaInfo>() { public static final @NonNull Creator<GnssAntennaInfo> CREATOR = new Creator<GnssAntennaInfo>() { @Override public GnssAntennaInfo createFromParcel(Parcel in) { double carrierFrequencyMHz = in.readDouble(); ClassLoader classLoader = getClass().getClassLoader(); PhaseCenterOffset phaseCenterOffset = in.readParcelable(classLoader); in.readTypedObject(PhaseCenterOffset.CREATOR); SphericalCorrections phaseCenterVariationCorrections = in.readParcelable(classLoader); in.readTypedObject(SphericalCorrections.CREATOR); SphericalCorrections signalGainCorrections = in.readParcelable(classLoader); in.readTypedObject(SphericalCorrections.CREATOR); return new GnssAntennaInfo( carrierFrequencyMHz, Loading @@ -497,9 +550,9 @@ public final class GnssAntennaInfo implements Parcelable { @Override public void writeToParcel(@NonNull Parcel parcel, int flags) { parcel.writeDouble(mCarrierFrequencyMHz); parcel.writeParcelable(mPhaseCenterOffset, flags); parcel.writeParcelable(mPhaseCenterVariationCorrections, flags); parcel.writeParcelable(mSignalGainCorrections, flags); parcel.writeTypedObject(mPhaseCenterOffset, flags); parcel.writeTypedObject(mPhaseCenterVariationCorrections, flags); parcel.writeTypedObject(mSignalGainCorrections, flags); } @Override Loading @@ -511,4 +564,26 @@ public final class GnssAntennaInfo implements Parcelable { + ", SignalGainCorrections=" + mSignalGainCorrections + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof GnssAntennaInfo)) { return false; } GnssAntennaInfo that = (GnssAntennaInfo) o; return Double.compare(that.mCarrierFrequencyMHz, mCarrierFrequencyMHz) == 0 && mPhaseCenterOffset.equals(that.mPhaseCenterOffset) && Objects.equals(mPhaseCenterVariationCorrections, that.mPhaseCenterVariationCorrections) && Objects.equals(mSignalGainCorrections, that.mSignalGainCorrections); } @Override public int hashCode() { return Objects.hash(mCarrierFrequencyMHz, mPhaseCenterOffset, mPhaseCenterVariationCorrections, mSignalGainCorrections); } } location/java/android/location/GnssMeasurementsEvent.java +21 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package android.location; import android.annotation.TestApi; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; Loading Loading @@ -46,8 +46,10 @@ public final class GnssMeasurementsEvent implements Parcelable { public static abstract class Callback { /** * The status of the GNSS measurements event. * @deprecated Do not use. * @hide */ @Deprecated @Retention(RetentionPolicy.SOURCE) @IntDef({STATUS_NOT_SUPPORTED, STATUS_READY, STATUS_LOCATION_DISABLED, STATUS_NOT_ALLOWED}) public @interface GnssMeasurementsStatus {} Loading @@ -56,19 +58,28 @@ public final class GnssMeasurementsEvent implements Parcelable { * The system does not support tracking of GNSS Measurements. * * <p>This status will not change in the future. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; /** * GNSS Measurements are successfully being tracked, it will receive updates once they are * available. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_READY = 1; /** * GPS provider or Location is disabled, updates will not be received until they are * enabled. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; /** Loading @@ -81,7 +92,10 @@ public final class GnssMeasurementsEvent implements Parcelable { * * <p>If such a status is received, one would try again at a later time point where no * other client is having a conflicting request. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_NOT_ALLOWED = 3; /** Loading @@ -91,7 +105,13 @@ public final class GnssMeasurementsEvent implements Parcelable { /** * Reports the latest status of the GNSS Measurements sub-system. * * @deprecated Do not rely on this callback. From Android S onwards this callback will be * invoked once with {@link #STATUS_READY} in all cases for backwards compatibility, and * then never invoked again. Use LocationManager APIs if you need to determine if * GNSS measurements are supported or if location is off, etc... */ @Deprecated public void onStatusChanged(@GnssMeasurementsStatus int status) {} } Loading location/java/android/location/GnssNavigationMessage.java +16 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ public final class GnssNavigationMessage implements Parcelable { public static abstract class Callback { /** * The status of GNSS Navigation Message event. * @deprecated Do not use. * @hide */ @Retention(RetentionPolicy.SOURCE) Loading @@ -120,19 +121,28 @@ public final class GnssNavigationMessage implements Parcelable { * The system does not support tracking of GNSS Navigation Messages. * * This status will not change in the future. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; /** * GNSS Navigation Messages are successfully being tracked, it will receive updates once * they are available. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_READY = 1; /** * GNSS provider or Location is disabled, updated will not be received until they are * enabled. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; /** Loading @@ -142,7 +152,13 @@ public final class GnssNavigationMessage implements Parcelable { /** * Returns the latest status of the GNSS Navigation Messages sub-system. * * @deprecated Do not rely on this callback. From Android S onwards this callback will be * invoked once with {@link #STATUS_READY} in all cases for backwards compatibility, and * then never invoked again. Use LocationManager APIs if you need to determine if * GNSS navigation messages are supported or if location is off, etc... */ @Deprecated public void onStatusChanged(@GnssNavigationMessageStatus int status) {} } Loading location/java/android/location/GnssStatus.java +0 −20 Original line number Diff line number Diff line Loading @@ -391,20 +391,10 @@ public final class GnssStatus implements Parcelable { float[] basebandCn0DbHzs = new float[svCount]; for (int i = 0; i < svCount; i++) { svidWithFlags[i] = in.readInt(); } for (int i = 0; i < svCount; i++) { cn0DbHzs[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { elevations[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { azimuths[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { carrierFrequencies[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { basebandCn0DbHzs[i] = in.readFloat(); } Loading @@ -428,20 +418,10 @@ public final class GnssStatus implements Parcelable { parcel.writeInt(mSvCount); for (int i = 0; i < mSvCount; i++) { parcel.writeInt(mSvidWithFlags[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mCn0DbHzs[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mElevations[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mAzimuths[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mCarrierFrequencies[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mBasebandCn0DbHzs[i]); } } Loading Loading
core/api/current.txt +21 −14 Original line number Diff line number Diff line Loading @@ -18942,7 +18942,9 @@ package android.location { } public static class GnssAntennaInfo.Builder { ctor public 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); Loading @@ -18950,8 +18952,8 @@ package android.location { 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>); @Deprecated public static interface GnssAntennaInfo.Listener { method @Deprecated public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>); } public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable { Loading Loading @@ -19124,11 +19126,11 @@ package android.location { public abstract static class GnssMeasurementsEvent.Callback { ctor public GnssMeasurementsEvent.Callback(); method public void onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent); method public void onStatusChanged(int); field public static final int STATUS_LOCATION_DISABLED = 2; // 0x2 field public static final int STATUS_NOT_ALLOWED = 3; // 0x3 field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0 field public static final int STATUS_READY = 1; // 0x1 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 { Loading Loading @@ -19164,10 +19166,10 @@ package android.location { public abstract static class GnssNavigationMessage.Callback { ctor public GnssNavigationMessage.Callback(); method public void onGnssNavigationMessageReceived(android.location.GnssNavigationMessage); method public void onStatusChanged(int); field public static final int STATUS_LOCATION_DISABLED = 2; // 0x2 field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0 field public static final int STATUS_READY = 1; // 0x1 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 GnssStatus implements android.os.Parcelable { Loading Loading @@ -19325,6 +19327,7 @@ package android.location { method @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(); Loading @@ -19337,7 +19340,7 @@ package android.location { method public boolean hasProvider(@NonNull String); method public boolean isLocationEnabled(); method public boolean isProviderEnabled(@NonNull String); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener); method @Deprecated 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); Loading Loading @@ -19374,10 +19377,14 @@ package android.location { 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 @Deprecated 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_ANTENNA_INFOS_CHANGED = "android.location.action.GNSS_ANTENNA_INFOS_CHANGED"; field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED"; field public static final String EXTRA_GNSS_ANTENNA_INFOS = "android.location.extra.GNSS_ANTENNA_INFOS"; 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";
location/java/android/location/GnssAntennaInfo.java +149 −74 Original line number Diff line number Diff line Loading @@ -34,17 +34,19 @@ import java.util.Objects; public final class GnssAntennaInfo implements Parcelable { private final double mCarrierFrequencyMHz; private final PhaseCenterOffset mPhaseCenterOffset; private final SphericalCorrections mPhaseCenterVariationCorrections; private final SphericalCorrections mSignalGainCorrections; private final @Nullable SphericalCorrections mPhaseCenterVariationCorrections; private final @Nullable SphericalCorrections mSignalGainCorrections; /** * Used for receiving GNSS antenna info from the GNSS engine. You can implement this interface * and call {@link LocationManager#registerAntennaInfoListener}; * Used for receiving GNSS antenna info from the GNSS engine. * * @deprecated Prefer to use a broadcast receiver for * {@link LocationManager#ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public interface Listener { /** * Returns the latest GNSS antenna info. This event is triggered when a listener is * registered, and whenever the antenna info changes (due to a device configuration change). * Invoked on a change to GNSS antenna info. */ void onGnssAntennaInfoReceived(@NonNull List<GnssAntennaInfo> gnssAntennaInfos); } Loading Loading @@ -172,6 +174,28 @@ public final class GnssAntennaInfo implements Parcelable { + ", OffsetZMm=" + mOffsetZMm + " +/-" + mOffsetZUncertaintyMm + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PhaseCenterOffset)) { return false; } PhaseCenterOffset that = (PhaseCenterOffset) o; return Double.compare(that.mOffsetXMm, mOffsetXMm) == 0 && Double.compare(that.mOffsetXUncertaintyMm, mOffsetXUncertaintyMm) == 0 && Double.compare(that.mOffsetYMm, mOffsetYMm) == 0 && Double.compare(that.mOffsetYUncertaintyMm, mOffsetYUncertaintyMm) == 0 && Double.compare(that.mOffsetZMm, mOffsetZMm) == 0 && Double.compare(that.mOffsetZUncertaintyMm, mOffsetZUncertaintyMm) == 0; } @Override public int hashCode() { return Objects.hash(mOffsetXMm, mOffsetYMm, mOffsetZMm); } } /** Loading @@ -190,38 +214,34 @@ public final class GnssAntennaInfo implements Parcelable { * i.e., deltaPhi = 180 / (number of columns - 1). */ public static final class SphericalCorrections implements Parcelable { private final double[][] mCorrections; private final double[][] mCorrectionUncertainties; private final double mDeltaTheta; private final double mDeltaPhi; private final int mNumRows; private final int mNumColumns; private final double[][] mCorrections; private final double[][] mCorrectionUncertainties; public SphericalCorrections(@NonNull double[][] corrections, @NonNull double[][] correctionUncertainties) { if (corrections.length != correctionUncertainties.length || corrections[0].length != correctionUncertainties[0].length) { throw new IllegalArgumentException("Correction and correction uncertainty arrays " + "must have the same dimensions."); if (corrections.length != correctionUncertainties.length || corrections.length < 1) { throw new IllegalArgumentException("correction and uncertainty arrays must have " + "the same (non-zero) dimensions"); } mNumRows = corrections.length; if (mNumRows < 1) { throw new IllegalArgumentException("Arrays must have at least one row."); } mNumColumns = corrections[0].length; if (mNumColumns < 2) { throw new IllegalArgumentException("Arrays must have at least two columns."); for (int i = 0; i < corrections.length; i++) { if (corrections[i].length != mNumColumns || correctionUncertainties[i].length != mNumColumns || mNumColumns < 2) { throw new IllegalArgumentException("correction and uncertainty arrays must all " + " have the same (greater than 2) number of columns"); } } mCorrections = corrections; mCorrectionUncertainties = correctionUncertainties; mDeltaTheta = 360.0d / mNumRows; mDeltaPhi = 180.0d / (mNumColumns - 1); } SphericalCorrections(Parcel in) { private SphericalCorrections(Parcel in) { int numRows = in.readInt(); int numColumns = in.readInt(); Loading @@ -231,19 +251,16 @@ public final class GnssAntennaInfo implements Parcelable { new double[numRows][numColumns]; for (int row = 0; row < numRows; row++) { in.readDoubleArray(corrections[row]); for (int col = 0; col < numColumns; col++) { corrections[row][col] = in.readDouble(); correctionUncertainties[row][col] = in.readDouble(); } for (int row = 0; row < numRows; row++) { in.readDoubleArray(correctionUncertainties[row]); } mNumRows = numRows; mNumColumns = numColumns; mCorrections = corrections; mCorrectionUncertainties = correctionUncertainties; mDeltaTheta = 360.0d / mNumRows; mDeltaPhi = 180.0d / (mNumColumns - 1); } /** Loading Loading @@ -286,7 +303,7 @@ public final class GnssAntennaInfo implements Parcelable { */ @FloatRange(from = 0.0f, to = 360.0f) public double getDeltaTheta() { return mDeltaTheta; return 360.0D / mNumRows; } /** Loading @@ -294,7 +311,7 @@ public final class GnssAntennaInfo implements Parcelable { */ @FloatRange(from = 0.0f, to = 180.0f) public double getDeltaPhi() { return mDeltaPhi; return 180.0D / (mNumColumns - 1); } Loading @@ -320,11 +337,11 @@ public final class GnssAntennaInfo implements Parcelable { public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mNumRows); dest.writeInt(mNumColumns); for (double[] row : mCorrections) { dest.writeDoubleArray(row); for (int row = 0; row < mNumRows; row++) { for (int col = 0; col < mNumColumns; col++) { dest.writeDouble(mCorrections[row][col]); dest.writeDouble(mCorrectionUncertainties[row][col]); } for (double[] row : mCorrectionUncertainties) { dest.writeDoubleArray(row); } } Loading @@ -333,22 +350,41 @@ public final class GnssAntennaInfo implements Parcelable { return "SphericalCorrections{" + "Corrections=" + Arrays.toString(mCorrections) + ", CorrectionUncertainties=" + Arrays.toString(mCorrectionUncertainties) + ", DeltaTheta=" + mDeltaTheta + ", DeltaPhi=" + mDeltaPhi + ", DeltaTheta=" + getDeltaTheta() + ", DeltaPhi=" + getDeltaPhi() + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SphericalCorrections)) { return false; } SphericalCorrections that = (SphericalCorrections) o; return mNumRows == that.mNumRows && mNumColumns == that.mNumColumns && Arrays.deepEquals(mCorrections, that.mCorrections) && Arrays.deepEquals(mCorrectionUncertainties, that.mCorrectionUncertainties); } @Override public int hashCode() { int result = Arrays.deepHashCode(mCorrections); result = 31 * result + Arrays.deepHashCode(mCorrectionUncertainties); return result; } } private GnssAntennaInfo( double carrierFrequencyMHz, @NonNull PhaseCenterOffset phaseCenterOffset, PhaseCenterOffset phaseCenterOffset, @Nullable SphericalCorrections phaseCenterVariationCorrections, @Nullable SphericalCorrections signalGainCorrectionDbi) { if (phaseCenterOffset == null) { throw new IllegalArgumentException("Phase Center Offset Coordinates cannot be null."); } mCarrierFrequencyMHz = carrierFrequencyMHz; mPhaseCenterOffset = phaseCenterOffset; mPhaseCenterOffset = Objects.requireNonNull(phaseCenterOffset); mPhaseCenterVariationCorrections = phaseCenterVariationCorrections; mSignalGainCorrections = signalGainCorrectionDbi; } Loading @@ -359,8 +395,28 @@ public final class GnssAntennaInfo implements Parcelable { public static class Builder { private double mCarrierFrequencyMHz; private PhaseCenterOffset mPhaseCenterOffset; private SphericalCorrections mPhaseCenterVariationCorrections; private SphericalCorrections mSignalGainCorrections; private @Nullable SphericalCorrections mPhaseCenterVariationCorrections; private @Nullable SphericalCorrections mSignalGainCorrections; /** * @deprecated Prefer {@link #Builder(double, PhaseCenterOffset)}. */ @Deprecated public Builder() { this(0, new PhaseCenterOffset(0, 0, 0, 0, 0, 0)); } public Builder(double carrierFrequencyMHz, @NonNull PhaseCenterOffset phaseCenterOffset) { mCarrierFrequencyMHz = carrierFrequencyMHz; mPhaseCenterOffset = Objects.requireNonNull(phaseCenterOffset); } public Builder(@NonNull GnssAntennaInfo antennaInfo) { mCarrierFrequencyMHz = antennaInfo.mCarrierFrequencyMHz; mPhaseCenterOffset = antennaInfo.mPhaseCenterOffset; mPhaseCenterVariationCorrections = antennaInfo.mPhaseCenterVariationCorrections; mSignalGainCorrections = antennaInfo.mSignalGainCorrections; } /** * Set antenna carrier frequency (MHz). Loading Loading @@ -462,19 +518,16 @@ public final class GnssAntennaInfo implements Parcelable { return mSignalGainCorrections; } public static final @android.annotation.NonNull Creator<GnssAntennaInfo> CREATOR = new Creator<GnssAntennaInfo>() { public static final @NonNull Creator<GnssAntennaInfo> CREATOR = new Creator<GnssAntennaInfo>() { @Override public GnssAntennaInfo createFromParcel(Parcel in) { double carrierFrequencyMHz = in.readDouble(); ClassLoader classLoader = getClass().getClassLoader(); PhaseCenterOffset phaseCenterOffset = in.readParcelable(classLoader); in.readTypedObject(PhaseCenterOffset.CREATOR); SphericalCorrections phaseCenterVariationCorrections = in.readParcelable(classLoader); in.readTypedObject(SphericalCorrections.CREATOR); SphericalCorrections signalGainCorrections = in.readParcelable(classLoader); in.readTypedObject(SphericalCorrections.CREATOR); return new GnssAntennaInfo( carrierFrequencyMHz, Loading @@ -497,9 +550,9 @@ public final class GnssAntennaInfo implements Parcelable { @Override public void writeToParcel(@NonNull Parcel parcel, int flags) { parcel.writeDouble(mCarrierFrequencyMHz); parcel.writeParcelable(mPhaseCenterOffset, flags); parcel.writeParcelable(mPhaseCenterVariationCorrections, flags); parcel.writeParcelable(mSignalGainCorrections, flags); parcel.writeTypedObject(mPhaseCenterOffset, flags); parcel.writeTypedObject(mPhaseCenterVariationCorrections, flags); parcel.writeTypedObject(mSignalGainCorrections, flags); } @Override Loading @@ -511,4 +564,26 @@ public final class GnssAntennaInfo implements Parcelable { + ", SignalGainCorrections=" + mSignalGainCorrections + '}'; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof GnssAntennaInfo)) { return false; } GnssAntennaInfo that = (GnssAntennaInfo) o; return Double.compare(that.mCarrierFrequencyMHz, mCarrierFrequencyMHz) == 0 && mPhaseCenterOffset.equals(that.mPhaseCenterOffset) && Objects.equals(mPhaseCenterVariationCorrections, that.mPhaseCenterVariationCorrections) && Objects.equals(mSignalGainCorrections, that.mSignalGainCorrections); } @Override public int hashCode() { return Objects.hash(mCarrierFrequencyMHz, mPhaseCenterOffset, mPhaseCenterVariationCorrections, mSignalGainCorrections); } }
location/java/android/location/GnssMeasurementsEvent.java +21 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package android.location; import android.annotation.TestApi; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; Loading Loading @@ -46,8 +46,10 @@ public final class GnssMeasurementsEvent implements Parcelable { public static abstract class Callback { /** * The status of the GNSS measurements event. * @deprecated Do not use. * @hide */ @Deprecated @Retention(RetentionPolicy.SOURCE) @IntDef({STATUS_NOT_SUPPORTED, STATUS_READY, STATUS_LOCATION_DISABLED, STATUS_NOT_ALLOWED}) public @interface GnssMeasurementsStatus {} Loading @@ -56,19 +58,28 @@ public final class GnssMeasurementsEvent implements Parcelable { * The system does not support tracking of GNSS Measurements. * * <p>This status will not change in the future. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; /** * GNSS Measurements are successfully being tracked, it will receive updates once they are * available. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_READY = 1; /** * GPS provider or Location is disabled, updates will not be received until they are * enabled. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; /** Loading @@ -81,7 +92,10 @@ public final class GnssMeasurementsEvent implements Parcelable { * * <p>If such a status is received, one would try again at a later time point where no * other client is having a conflicting request. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_NOT_ALLOWED = 3; /** Loading @@ -91,7 +105,13 @@ public final class GnssMeasurementsEvent implements Parcelable { /** * Reports the latest status of the GNSS Measurements sub-system. * * @deprecated Do not rely on this callback. From Android S onwards this callback will be * invoked once with {@link #STATUS_READY} in all cases for backwards compatibility, and * then never invoked again. Use LocationManager APIs if you need to determine if * GNSS measurements are supported or if location is off, etc... */ @Deprecated public void onStatusChanged(@GnssMeasurementsStatus int status) {} } Loading
location/java/android/location/GnssNavigationMessage.java +16 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ public final class GnssNavigationMessage implements Parcelable { public static abstract class Callback { /** * The status of GNSS Navigation Message event. * @deprecated Do not use. * @hide */ @Retention(RetentionPolicy.SOURCE) Loading @@ -120,19 +121,28 @@ public final class GnssNavigationMessage implements Parcelable { * The system does not support tracking of GNSS Navigation Messages. * * This status will not change in the future. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; /** * GNSS Navigation Messages are successfully being tracked, it will receive updates once * they are available. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_READY = 1; /** * GNSS provider or Location is disabled, updated will not be received until they are * enabled. * * @deprecated Do not use. */ @Deprecated public static final int STATUS_LOCATION_DISABLED = 2; /** Loading @@ -142,7 +152,13 @@ public final class GnssNavigationMessage implements Parcelable { /** * Returns the latest status of the GNSS Navigation Messages sub-system. * * @deprecated Do not rely on this callback. From Android S onwards this callback will be * invoked once with {@link #STATUS_READY} in all cases for backwards compatibility, and * then never invoked again. Use LocationManager APIs if you need to determine if * GNSS navigation messages are supported or if location is off, etc... */ @Deprecated public void onStatusChanged(@GnssNavigationMessageStatus int status) {} } Loading
location/java/android/location/GnssStatus.java +0 −20 Original line number Diff line number Diff line Loading @@ -391,20 +391,10 @@ public final class GnssStatus implements Parcelable { float[] basebandCn0DbHzs = new float[svCount]; for (int i = 0; i < svCount; i++) { svidWithFlags[i] = in.readInt(); } for (int i = 0; i < svCount; i++) { cn0DbHzs[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { elevations[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { azimuths[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { carrierFrequencies[i] = in.readFloat(); } for (int i = 0; i < svCount; i++) { basebandCn0DbHzs[i] = in.readFloat(); } Loading @@ -428,20 +418,10 @@ public final class GnssStatus implements Parcelable { parcel.writeInt(mSvCount); for (int i = 0; i < mSvCount; i++) { parcel.writeInt(mSvidWithFlags[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mCn0DbHzs[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mElevations[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mAzimuths[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mCarrierFrequencies[i]); } for (int i = 0; i < mSvCount; i++) { parcel.writeFloat(mBasebandCn0DbHzs[i]); } } Loading