OSDN Git Service

A few changes to the measurement implementation
authorLifu Tang <lifu@google.com>
Tue, 22 Mar 2016 20:56:52 +0000 (13:56 -0700)
committerLifu Tang <lifu@google.com>
Tue, 22 Mar 2016 22:29:24 +0000 (15:29 -0700)
- Fixed the device crashing bug in JNI code
- Fixed a typo ('lock' => 'clock')
- Added hardware clock discontinuity count in toString()

(cherry picked from commit 3a21b02ee2dc8f2c6c879109757d89a2be5d720a)

Change-Id: I6dbda85abda20da0240ac08b22b81729eae7b6f0

location/java/android/location/GnssClock.java
services/core/jni/com_android_server_location_GnssLocationProvider.cpp

index 2af4790..df42a73 100644 (file)
@@ -471,6 +471,11 @@ public final class GnssClock implements Parcelable {
                 "DriftUncertaintyNanosPerSecond",
                 hasDriftUncertaintyNanosPerSecond() ? mDriftUncertaintyNanosPerSecond : null));
 
+        builder.append(String.format(
+                format,
+                "HardwareClockDiscontinuityCount",
+                mHardwareClockDiscontinuityCount));
+
         return builder.toString();
     }
 
index e2c71a1..ae05042 100644 (file)
@@ -1108,7 +1108,7 @@ const char *const JavaMethodHelper<bool>::signature_ = "(Z)V";
     } while (false)
 
 static jobject translate_gps_clock(JNIEnv* env, GpsClock* clock) {
-    static uint32_t discontinuity_count_to_handle_old_lock_type = 0;
+    static uint32_t discontinuity_count_to_handle_old_clock_type = 0;
     JavaObject object(env, "android/location/GnssClock");
     GpsClockFlags flags = clock->flags;
 
@@ -1137,7 +1137,7 @@ static jobject translate_gps_clock(JNIEnv* env, GpsClock* clock) {
         clock->full_bias_ns = clock->time_ns;
         clock->time_ns = 0;
         SET(HardwareClockDiscontinuityCount,
-            discontinuity_count_to_handle_old_lock_type++);
+            discontinuity_count_to_handle_old_clock_type++);
         break;
     }
 
@@ -1226,10 +1226,6 @@ static jobject translate_gps_measurement(JNIEnv* env,
         static_cast<int32_t>(measurement->multipath_indicator));
     SET_IF(GNSS_MEASUREMENT_HAS_SNR, SnrInDb, measurement->snr_db);
 
-    SET_IF_NOT(GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE,
-               PseudorangeRateCorrected,
-               true);
-
     return object.get();
 }