Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56645e26 authored by Patrick Scott's avatar Patrick Scott Committed by Android Git Automerger
Browse files

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

parents 9d3b3e13 8f5a8001
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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