summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorEddie Ho <eddie_ho@htc.com>2009-09-04 07:03:22 -0400
committerMike Lockwood <lockwood@android.com>2009-09-04 07:05:08 -0400
commiteb40aae254642dfcb333798c642920814b410115 (patch)
treedd788366d0b9b88052b6d1df0aa87f6ba5cd8f31 /core/jni
parentf163f7f0f29f0898eb82f54cf657cb34668abade (diff)
downloadframeworks_base-eb40aae254642dfcb333798c642920814b410115.zip
frameworks_base-eb40aae254642dfcb333798c642920814b410115.tar.gz
frameworks_base-eb40aae254642dfcb333798c642920814b410115.tar.bz2
GPS: Fix race condition reporting NMEA data.
Change-Id: I80997e2686d9c08d7d2def094f9922e83cf41013 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'core/jni')
-rwxr-xr-xcore/jni/android_location_GpsLocationProvider.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/jni/android_location_GpsLocationProvider.cpp b/core/jni/android_location_GpsLocationProvider.cpp
index c329602..4aed277 100755
--- a/core/jni/android_location_GpsLocationProvider.cpp
+++ b/core/jni/android_location_GpsLocationProvider.cpp
@@ -370,14 +370,14 @@ static jint android_location_GpsLocationProvider_read_sv_status(JNIEnv* env, job
static jint android_location_GpsLocationProvider_read_nmea(JNIEnv* env, jobject obj, jint index, jbyteArray nmeaArray, jint buffer_size)
{
- // this should only be called from within a call to reportStatus, so we don't need to lock here
+ // this should only be called from within a call to reportNmea, so we don't need to lock here
jbyte* nmea = env->GetByteArrayElements(nmeaArray, 0);
- int length = strlen(sNmeaBuffer[index].nmea);
+ int length = strlen(sNmeaBufferCopy[index].nmea);
if (length > buffer_size)
length = buffer_size;
- memcpy(nmea, sNmeaBuffer[index].nmea, length);
+ memcpy(nmea, sNmeaBufferCopy[index].nmea, length);
env->ReleaseByteArrayElements(nmeaArray, nmea, 0);
return length;