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

Commit 8cc696bf authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

GpsLocationProvider: Reset GPS interface after cleanup

Since the init routine checks for the existence of the interface
struct (and skips execution if it exists), it was effectively only
being executed once. If the cleanup function in the GPS HAL destroys
data or handles that are established by init (which happens in the
libloc_api code), the end result is that GPS gets broken after being
disabled once, and can only be restored by a reboot.

This patch makes the HAL's init re-execute whenever GPS is (re)enabled.

Change-Id: I8eedbcd140484a132c5a90a06b7f95fbb0cab410
parent 572daef6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -324,8 +324,10 @@ static jboolean android_location_GpsLocationProvider_init(JNIEnv* env, jobject o
static void android_location_GpsLocationProvider_cleanup(JNIEnv* env, jobject obj)
{
    const GpsInterface* interface = GetGpsInterface(env, obj);
    if (interface)
    if (interface) {
        interface->cleanup();
        sGpsInterface = NULL;
    }
}

static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* env, jobject obj,