Merge "[RTT] Ranging timestamp is in millis"
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user