From 833823bac6dc739927ea2ca5b7d52107c09a860b Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Fri, 21 Feb 2020 15:09:54 +0300 Subject: [PATCH] [android] [local_ads] Fix a data race. --- .../maps/geofence/GeofenceTransitionsIntentService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/src/com/mapswithme/maps/geofence/GeofenceTransitionsIntentService.java b/android/src/com/mapswithme/maps/geofence/GeofenceTransitionsIntentService.java index 5d02518fbb..75b3bbdc8e 100644 --- a/android/src/com/mapswithme/maps/geofence/GeofenceTransitionsIntentService.java +++ b/android/src/com/mapswithme/maps/geofence/GeofenceTransitionsIntentService.java @@ -135,6 +135,12 @@ public class GeofenceTransitionsIntentService extends JobIntentService private void requestLocationCheck() { + // Framework and LightFramework use the same files to process local ads + // events and are not explicitly synchronized. Logging local ads events + // from both frameworks at once may lead to a data race. + if (getApplication().arePlatformAndCoreInitialized()) + return; + LOG.d(TAG, "Geofences = " + Arrays.toString(mGeofences.toArray())); GeofenceLocation geofenceLocation = getGeofenceLocation();