am 56645e26: Merge branch \'kraken\' of ssh://android-git:29418/platform/frameworks/base into kraken

This commit is contained in:
Patrick Scott
2010-04-15 12:33:41 -07:00
committed by Android Git Automerger

View File

@@ -22,6 +22,7 @@
#include "jni.h"
#include "hardware/hardware.h"
#include "hardware/gps.h"
#include "hardware_legacy/power.h"
#include "utils/Log.h"
#include "utils/misc.h"
@@ -51,6 +52,8 @@ static GpsSvStatus sGpsSvStatus;
static AGpsStatus sAGpsStatus;
static GpsNiNotification sGpsNiNotification;
#define WAKE_LOCK_NAME "GPS"
// buffer for NMEA data
#define NMEA_SENTENCE_LENGTH 100
#define NMEA_SENTENCE_COUNT 40
@@ -141,6 +144,16 @@ static void nmea_callback(GpsUtcTime timestamp, const char* nmea, int length)
pthread_mutex_unlock(&sEventMutex);
}
static void acquire_wakelock_callback()
{
acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_NAME);
}
static void release_wakelock_callback()
{
release_wake_lock(WAKE_LOCK_NAME);
}
static void agps_status_callback(AGpsStatus* agps_status)
{
pthread_mutex_lock(&sEventMutex);
@@ -153,10 +166,13 @@ static void agps_status_callback(AGpsStatus* agps_status)
}
GpsCallbacks sGpsCallbacks = {
sizeof(GpsCallbacks),
location_callback,
status_callback,
sv_status_callback,
nmea_callback
nmea_callback,
acquire_wakelock_callback,
release_wakelock_callback,
};
static void