From 47ea7c7916fb8bd5e9441e339dbb65d2b36537c6 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 13 Jan 2016 13:14:03 -0800 Subject: combo bug when location reported by providers do not come with extras LocationManagerService tries to create an extra bundle and stick it into the location object, but it is not doing it correctly. As a result, combo drops report. Change-Id: I6f5886dd7f14819ecc7a4ed96c867a0ec486faf7 CRs-Fixed: 962746 --- .../core/java/com/android/server/LocationManagerService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java index ebe8759..6cd8e10 100644 --- a/services/core/java/com/android/server/LocationManagerService.java +++ b/services/core/java/com/android/server/LocationManagerService.java @@ -2418,11 +2418,8 @@ public class LocationManagerService extends ILocationManager.Stub { Bundle extras = location.getExtras(); boolean isBeingScreened = false; - if (extras == null) { - extras = new Bundle(); - } - if (!extras.containsKey(mComboNlpReadyMarker)) { + if (extras == null || !extras.containsKey(mComboNlpReadyMarker)) { // see if Combo Nlp is a passive listener ArrayList records = mRecordsByProvider.get(LocationManager.PASSIVE_PROVIDER); @@ -2431,6 +2428,10 @@ public class LocationManagerService extends ILocationManager.Stub { if (r.mReceiver.mPackageName.equals(mComboNlpPackageName)) { if (!isBeingScreened) { isBeingScreened = true; + if (extras == null) { + location.setExtras(new Bundle()); + extras = location.getExtras(); + } extras.putBoolean(mComboNlpScreenMarker, true); } // send location to Combo Nlp for screening -- cgit v1.1