From 610419eae1d35b4da27b91de2dc98982d43c7deb Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 17 Sep 2009 07:29:17 -0700 Subject: AI 151388: Fix null pointer exceptions that can occur if the GPS is started due to E911 Automated import of CL 151388 --- .../com/android/server/LocationManagerService.java | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index a103c9831680..2d25bfaacb9d 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -926,7 +926,9 @@ public class LocationManagerService extends ILocationManager.Stub */ void disposeLocked() { ArrayList records = mRecordsByProvider.get(this.mProvider); - records.remove(this); + if (records != null) { + records.remove(this); + } } @Override @@ -2222,15 +2224,17 @@ public class LocationManagerService extends ILocationManager.Stub ArrayList urs = mRecordsByProvider.get(name); int num = 0; - final int N = urs.size(); - for (int i=0; i