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

Commit 93d3bdb6 authored by destradaa's avatar destradaa Committed by Android Git Automerger
Browse files

am 47d620ac: Merge "Ensure access to the map of geofence callbacks is...

am 47d620ac: Merge "Ensure access to the map of geofence callbacks is synchronized in all cases Fix Java reference leak in the JNI layer" into klp-dev

* commit '47d620ac':
  Ensure access to the map of geofence callbacks is synchronized in all cases Fix Java reference leak in the JNI layer
parents a35ff661 47d620ac
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -18,17 +18,14 @@ package android.hardware.location;

import android.content.Context;
import android.content.pm.PackageManager;
import android.location.FusedBatchOptions;
import android.location.IFusedGeofenceHardware;
import android.location.IGpsGeofenceHardware;
import android.location.Location;
import android.location.LocationManager;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.SystemClock;
import android.util.Log;
import android.util.SparseArray;

@@ -601,12 +598,13 @@ public final class GeofenceHardwareImpl {
                    GeofenceTransition geofenceTransition = (GeofenceTransition)(msg.obj);
                    synchronized (mGeofences) {
                        callback = mGeofences.get(geofenceTransition.mGeofenceId);
                    }

                        // need to keep access to mGeofences synchronized at all times
                        if (DEBUG) Log.d(TAG, "GeofenceTransistionCallback: GPS : GeofenceId: " +
                                geofenceTransition.mGeofenceId +
                                " Transition: " + geofenceTransition.mTransition +
                                " Location: " + geofenceTransition.mLocation + ":" + mGeofences);
                    }

                    if (callback != null) {
                        try {
+1 −0
Original line number Diff line number Diff line
@@ -938,6 +938,7 @@ static void RemoveGeofences(
  }

  sFlpGeofencingInterface->remove_geofences(geofenceIdsCount, geofenceIds);
  env->ReleaseIntArrayElements(geofenceIdsArray, geofenceIds, 0 /*mode*/);
}

static JNINativeMethod sMethods[] = {