Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 091f9b53 authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

Append 'Seconds' to timeOfClock and timeOfEphemeris

Bug: 219575003
Test: atest SatellitePvtTest
Change-Id: I28d1e5b16db8b5f75015c54bcfcc391a6a50082b
parent e15d10f3
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -5908,16 +5908,16 @@ package android.location {
    method @IntRange(from=0, to=1023) public int getIssueOfDataClock();
    method @IntRange(from=0, to=255) public int getIssueOfDataEphemeris();
    method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef();
    method @IntRange(from=0) public long getTimeOfClock();
    method @IntRange(from=0) public long getTimeOfEphemeris();
    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 hasTimeOfClock();
    method public boolean hasTimeOfEphemeris();
    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;
@@ -5936,8 +5936,8 @@ package android.location {
    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=255) int);
    method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef);
    method @NonNull public android.location.SatellitePvt.Builder setTimeOfClock(@IntRange(from=0) long);
    method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemeris(@IntRange(from=0) int);
    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);
  }
+34 −33
Original line number Diff line number Diff line
@@ -144,8 +144,8 @@ public final class SatellitePvt implements Parcelable {
    private final ClockInfo mClockInfo;
    private final double mIonoDelayMeters;
    private final double mTropoDelayMeters;
    private final long mTimeOfClock;
    private final long mTimeOfEphemeris;
    private final long mTimeOfClockSeconds;
    private final long mTimeOfEphemerisSeconds;
    private final int mIssueOfDataClock;
    private final int mIssueOfDataEphemeris;
    @EphemerisSource
@@ -457,8 +457,8 @@ public final class SatellitePvt implements Parcelable {
            @Nullable ClockInfo clockInfo,
            double ionoDelayMeters,
            double tropoDelayMeters,
            long timeOfClock,
            long timeOfEphemeris,
            long timeOfClockSeconds,
            long timeOfEphemerisSeconds,
            int issueOfDataClock,
            int issueOfDataEphemeris,
            @EphemerisSource int ephemerisSource) {
@@ -468,8 +468,8 @@ public final class SatellitePvt implements Parcelable {
        mClockInfo = clockInfo;
        mIonoDelayMeters = ionoDelayMeters;
        mTropoDelayMeters = tropoDelayMeters;
        mTimeOfClock = timeOfClock;
        mTimeOfEphemeris = timeOfEphemeris;
        mTimeOfClockSeconds = timeOfClockSeconds;
        mTimeOfEphemerisSeconds = timeOfEphemerisSeconds;
        mIssueOfDataClock = issueOfDataClock;
        mIssueOfDataEphemeris = issueOfDataEphemeris;
        mEphemerisSource = ephemerisSource;
@@ -545,31 +545,31 @@ public final class SatellitePvt implements Parcelable {
    }

    /**
     * Time of Clock.
     * Time of Clock in seconds.
     *
     * <p>The value is in seconds since GPS epoch, regardless of the constellation.
     *
     * <p>The value is not encoded as in GPS ICD200 documentation.
     *
     * <p>This field is valid if {@link #hasTimeOfClock()} is true.
     * <p>This field is valid if {@link #hasTimeOfClockSeconds()} is true.
     */
    @IntRange(from = 0)
    public long getTimeOfClock() {
        return mTimeOfClock;
    public long getTimeOfClockSeconds() {
        return mTimeOfClockSeconds;
    }

    /**
     * Time of ephemeris.
     * Time of ephemeris in seconds.
     *
     * <p>The value is in seconds since GPS epoch, regardless of the constellation.
     *
     * <p>The value is not encoded as in GPS ICD200 documentation.
     *
     * <p>This field is valid if {@link #hasTimeOfEphemeris()} is true.
     * <p>This field is valid if {@link #hasTimeOfEphemerisSeconds()} is true.
     */
    @IntRange(from = 0)
    public long getTimeOfEphemeris() {
        return mTimeOfEphemeris;
    public long getTimeOfEphemerisSeconds() {
        return mTimeOfEphemerisSeconds;
    }

    /**
@@ -607,13 +607,13 @@ public final class SatellitePvt implements Parcelable {
        return (mFlags & HAS_ISSUE_OF_DATA_EPHEMERIS) != 0;
    }

    /** Returns {@code true} if {@link #getTimeOfClock()} ()} is valid. */
    public boolean hasTimeOfClock() {
    /** Returns {@code true} if {@link #getTimeOfClockSeconds()} ()} is valid. */
    public boolean hasTimeOfClockSeconds() {
        return (mFlags & HAS_TIME_OF_CLOCK) != 0;
    }

    /** Returns {@code true} if {@link #getTimeOfEphemeris()} is valid. */
    public boolean hasTimeOfEphemeris() {
    /** Returns {@code true} if {@link #getTimeOfEphemerisSeconds()} is valid. */
    public boolean hasTimeOfEphemerisSeconds() {
        return (mFlags & HAS_TIME_OF_EPHEMERIS) != 0;
    }

@@ -671,8 +671,8 @@ public final class SatellitePvt implements Parcelable {
        parcel.writeParcelable(mClockInfo, flags);
        parcel.writeDouble(mIonoDelayMeters);
        parcel.writeDouble(mTropoDelayMeters);
        parcel.writeLong(mTimeOfClock);
        parcel.writeLong(mTimeOfEphemeris);
        parcel.writeLong(mTimeOfClockSeconds);
        parcel.writeLong(mTimeOfEphemerisSeconds);
        parcel.writeInt(mIssueOfDataClock);
        parcel.writeInt(mIssueOfDataEphemeris);
        parcel.writeInt(mEphemerisSource);
@@ -687,8 +687,8 @@ public final class SatellitePvt implements Parcelable {
                + ", ClockInfo=" + mClockInfo
                + ", IonoDelayMeters=" + mIonoDelayMeters
                + ", TropoDelayMeters=" + mTropoDelayMeters
                + ", TimeOfClock=" + mTimeOfClock
                + ", TimeOfEphemeris=" + mTimeOfEphemeris
                + ", TimeOfClockSeconds=" + mTimeOfClockSeconds
                + ", TimeOfEphemerisSeconds=" + mTimeOfEphemerisSeconds
                + ", IssueOfDataClock=" + mIssueOfDataClock
                + ", IssueOfDataEphemeris=" + mIssueOfDataEphemeris
                + ", EphemerisSource=" + mEphemerisSource
@@ -709,8 +709,8 @@ public final class SatellitePvt implements Parcelable {
        @Nullable private ClockInfo mClockInfo;
        private double mIonoDelayMeters;
        private double mTropoDelayMeters;
        private long mTimeOfClock;
        private long mTimeOfEphemeris;
        private long mTimeOfClockSeconds;
        private long mTimeOfEphemerisSeconds;
        private int mIssueOfDataClock;
        private int mIssueOfDataEphemeris;
        @EphemerisSource
@@ -796,13 +796,13 @@ public final class SatellitePvt implements Parcelable {
         *
         * <p>The value is not encoded as in GPS ICD200 documentation.
         *
         * @param timeOfClock time of clock (seconds)
         * @param timeOfClockSeconds time of clock (seconds)
         * @return builder object
         */
        @NonNull
        public Builder setTimeOfClock(@IntRange(from = 0) long timeOfClock) {
            Preconditions.checkArgumentNonnegative(timeOfClock);
            mTimeOfClock = timeOfClock;
        public Builder setTimeOfClockSeconds(@IntRange(from = 0) long timeOfClockSeconds) {
            Preconditions.checkArgumentNonnegative(timeOfClockSeconds);
            mTimeOfClockSeconds = timeOfClockSeconds;
            mFlags = (byte) (mFlags | HAS_TIME_OF_CLOCK);
            return this;
        }
@@ -814,13 +814,13 @@ public final class SatellitePvt implements Parcelable {
         *
         * <p>The value is not encoded as in GPS ICD200 documentation.
         *
         * @param timeOfEphemeris time of ephemeris (seconds)
         * @param timeOfEphemerisSeconds time of ephemeris (seconds)
         * @return builder object
         */
        @NonNull
        public Builder setTimeOfEphemeris(@IntRange(from = 0) int timeOfEphemeris) {
            Preconditions.checkArgumentNonnegative(timeOfEphemeris);
            mTimeOfEphemeris = timeOfEphemeris;
        public Builder setTimeOfEphemerisSeconds(@IntRange(from = 0) long timeOfEphemerisSeconds) {
            Preconditions.checkArgumentNonnegative(timeOfEphemerisSeconds);
            mTimeOfEphemerisSeconds = timeOfEphemerisSeconds;
            mFlags = (byte) (mFlags | HAS_TIME_OF_EPHEMERIS);
            return this;
        }
@@ -879,7 +879,8 @@ public final class SatellitePvt implements Parcelable {
        @NonNull
        public SatellitePvt build() {
            return new SatellitePvt(mFlags, mPositionEcef, mVelocityEcef, mClockInfo,
                    mIonoDelayMeters, mTropoDelayMeters, mTimeOfClock, mTimeOfEphemeris,
                    mIonoDelayMeters, mTropoDelayMeters, mTimeOfClockSeconds,
                    mTimeOfEphemerisSeconds,
                    mIssueOfDataClock, mIssueOfDataEphemeris,
                    mEphemerisSource);
        }