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

Commit 554fa64c authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "[RTT] Ranging timestamp is in millis"

parents dd01fb1e 4577b9b1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28531,7 +28531,7 @@ package android.net.wifi.rtt {
    method public int getDistanceStdDevMm();
    method public android.net.MacAddress getMacAddress();
    method public android.net.wifi.aware.PeerHandle getPeerHandle();
    method public long getRangingTimestampUs();
    method public long getRangingTimestampMillis();
    method public int getRssi();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
+1 −1
Original line number Diff line number Diff line
@@ -992,7 +992,7 @@ public class RttManager {
                            legacyResults[i].distanceStandardDeviation =
                                    result.getDistanceStdDevMm() / 10;
                            legacyResults[i].rssi = result.getRssi() * -2;
                            legacyResults[i].ts = result.getRangingTimestampUs();
                            legacyResults[i].ts = result.getRangingTimestampMillis() * 1000;
                        } else {
                            // just in case legacy API needed some relatively real timestamp
                            legacyResults[i].ts = SystemClock.elapsedRealtime() * 1000;
+6 −3
Original line number Diff line number Diff line
@@ -226,15 +226,18 @@ public final class RangingResult implements Parcelable {
    }

    /**
     * @return The timestamp, in us since boot, at which the ranging operation was performed.
     * @return The timestamp at which the ranging operation was performed. The timestamp is in
     * milliseconds since boot, including time spent in sleep, corresponding to values provided by
     * {@link android.os.SystemClock#elapsedRealtime()}.
     * <p>
     * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
     * exception.
     */
    public long getRangingTimestampUs() {
    public long getRangingTimestampMillis() {
        if (mStatus != STATUS_SUCCESS) {
            throw new IllegalStateException(
                    "getRangingTimestamp(): invoked on an invalid result: getStatus()=" + mStatus);
                    "getRangingTimestampMillis(): invoked on an invalid result: getStatus()="
                            + mStatus);
        }
        return mTimestamp;
    }