Skip to content

Commit bc391d5

Browse files
Philip MilneAndroid (Google) Code Review
authored andcommitted
Merge "Revert "Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()"" into jb-mr1-dev
2 parents 9b93f4d + 53fe756 commit bc391d5

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

api/current.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16565,7 +16565,7 @@ package android.os {
1656516565
public final class SystemClock {
1656616566
method public static long currentThreadTimeMillis();
1656716567
method public static long elapsedRealtime();
16568-
method public static long elapsedRealtimeNanos();
16568+
method public static long elapsedRealtimeNano();
1656916569
method public static boolean setCurrentTimeMillis(long);
1657016570
method public static void sleep(long);
1657116571
method public static long uptimeMillis();

core/java/android/os/SystemClock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* interval does not span device sleep. Most methods that accept a
5151
* timestamp value currently expect the {@link #uptimeMillis} clock.
5252
*
53-
* <li> <p> {@link #elapsedRealtime} and {@link #elapsedRealtimeNanos}
53+
* <li> <p> {@link #elapsedRealtime} and {@link #elapsedRealtimeNano}
5454
* return the time since the system was booted, and include deep sleep.
5555
* This clock is guaranteed to be monotonic, and continues to tick even
5656
* when the CPU is in power saving modes, so is the recommend basis
@@ -157,7 +157,7 @@ public static void sleep(long ms)
157157
*
158158
* @return elapsed nanoseconds since boot.
159159
*/
160-
public static native long elapsedRealtimeNanos();
160+
public static native long elapsedRealtimeNano();
161161

162162
/**
163163
* Returns milliseconds running in the current thread.

location/java/android/location/Location.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public void setTime(long time) {
515515
* Return the time of this fix, in elapsed real-time since system boot.
516516
*
517517
* <p>This value can be reliably compared to
518-
* {@link android.os.SystemClock#elapsedRealtimeNanos},
518+
* {@link android.os.SystemClock#elapsedRealtimeNano},
519519
* to calculate the age of a fix and to compare Location fixes. This
520520
* is reliable because elapsed real-time is guaranteed monotonic for
521521
* each system boot and continues to increment even when the system
@@ -792,7 +792,7 @@ public void makeComplete() {
792792
mAccuracy = 100.0f;
793793
}
794794
if (mTime == 0) mTime = System.currentTimeMillis();
795-
if (mElapsedRealtimeNano == 0) mElapsedRealtimeNano = SystemClock.elapsedRealtimeNanos();
795+
if (mElapsedRealtimeNano == 0) mElapsedRealtimeNano = SystemClock.elapsedRealtimeNano();
796796
}
797797

798798
/**

packages/FusedLocation/src/com/android/location/fused/FusionEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private static double weighAccuracy(Location loc) {
215215
}
216216

217217
private static double weighAge(Location loc) {
218-
long ageSeconds = SystemClock.elapsedRealtimeNanos() - loc.getElapsedRealtimeNano();
218+
long ageSeconds = SystemClock.elapsedRealtimeNano() - loc.getElapsedRealtimeNano();
219219
ageSeconds /= 1000000000L;
220220
if (ageSeconds < 0) ageSeconds = 0;
221221
return Math.exp(-ageSeconds * AGE_DECAY_CONSTANT_S);
@@ -266,7 +266,7 @@ private void updateFusedLocation() {
266266

267267
// fused time - now
268268
fused.setTime(System.currentTimeMillis());
269-
fused.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNanos());
269+
fused.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNano());
270270

271271
// fuse altitude
272272
if (mGpsLocation.hasAltitude() && !mNetworkLocation.hasAltitude() &&

services/java/com/android/server/TwilightService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ private void retrieveLocation() {
447447
location.setLatitude(0);
448448
location.setAccuracy(417000.0f);
449449
location.setTime(System.currentTimeMillis());
450-
location.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNanos());
450+
location.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNano());
451451

452452
if (DEBUG) {
453453
Slog.d(TAG, "Estimated location from timezone: " + location);

services/java/com/android/server/location/GpsLocationProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ private void reportLocation(int flags, double latitude, double longitude, double
10291029
mLocation.setTime(timestamp);
10301030
// It would be nice to push the elapsed real-time timestamp
10311031
// further down the stack, but this is still useful
1032-
mLocation.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNanos());
1032+
mLocation.setElapsedRealtimeNano(SystemClock.elapsedRealtimeNano());
10331033
}
10341034
if ((flags & LOCATION_HAS_ALTITUDE) == LOCATION_HAS_ALTITUDE) {
10351035
mLocation.setAltitude(altitude);

0 commit comments

Comments
 (0)