summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Lockwood <nobody@android.com>2009-09-17 07:29:17 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-09-17 07:29:17 -0700
commit610419eae1d35b4da27b91de2dc98982d43c7deb (patch)
tree4b47d4856e5be558e67a368dec59de379768cc13
parent997f0058435b5ef3dd6c14c608a849e5f6ef6753 (diff)
downloadbase-cupcake.tar.gz
AI 151388: Fix null pointer exceptions that can occur if the GPS is started due to E911cupcake
Automated import of CL 151388
-rw-r--r--services/java/com/android/server/LocationManagerService.java24
1 files 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<UpdateRecord> 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<UpdateRecord> urs = mRecordsByProvider.get(name);
int num = 0;
- final int N = urs.size();
- for (int i=0; i<N; i++) {
- UpdateRecord ur = urs.get(i);
- if (ur.mReceiver == mProximityListener) {
- // We don't want the system to take the blame for this one.
- continue;
- }
- if (reportGpsUidLocked(curSeq, nextSeq, ur.mUid)) {
- num++;
+ if (urs != null) {
+ final int N = urs.size();
+ for (int i=0; i<N; i++) {
+ UpdateRecord ur = urs.get(i);
+ if (ur.mReceiver == mProximityListener) {
+ // We don't want the system to take the blame for this one.
+ continue;
+ }
+ if (reportGpsUidLocked(curSeq, nextSeq, ur.mUid)) {
+ num++;
+ }
}
}