summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-04-21 12:44:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-04-21 12:44:57 -0700
commit3a86d334e7d0a254bcbd887aa0a550cb00c9e4ca (patch)
treef67778d5b3b24eb8240d117775d5574f722789a9
parent407784ccacfaddb443f2f7b44d7a4616272c473d (diff)
parent6de3154674a268b0e109990a1f4c2742dfdc9c66 (diff)
downloadframeworks_base-3a86d334e7d0a254bcbd887aa0a550cb00c9e4ca.zip
frameworks_base-3a86d334e7d0a254bcbd887aa0a550cb00c9e4ca.tar.gz
frameworks_base-3a86d334e7d0a254bcbd887aa0a550cb00c9e4ca.tar.bz2
Merge change 368 into donut
* changes: location: Add some null pointer checks.
-rw-r--r--services/java/com/android/server/LocationManagerService.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 1204293..5238c58 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1831,8 +1831,12 @@ public class LocationManagerService extends ILocationManager.Stub {
mWakeLockAcquireTime = SystemClock.elapsedRealtime();
log("Acquired wakelock");
- mNetworkLocationProvider.wakeLockAcquired();
- mGpsLocationProvider.wakeLockAcquired();
+ if (mNetworkLocationProvider != null) {
+ mNetworkLocationProvider.wakeLockAcquired();
+ }
+ if (mGpsLocationProvider != null) {
+ mGpsLocationProvider.wakeLockAcquired();
+ }
}
private void releaseWakeLockLocked() {
@@ -1846,8 +1850,12 @@ public class LocationManagerService extends ILocationManager.Stub {
}
private void releaseWakeLockXLocked() {
- mNetworkLocationProvider.wakeLockReleased();
- mGpsLocationProvider.wakeLockReleased();
+ if (mNetworkLocationProvider != null) {
+ mNetworkLocationProvider.wakeLockReleased();
+ }
+ if (mGpsLocationProvider != null) {
+ mGpsLocationProvider.wakeLockReleased();
+ }
// Release wake lock
mWakeLockAcquireTime = 0;