diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-21 12:44:57 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-21 12:44:57 -0700 |
commit | 3a86d334e7d0a254bcbd887aa0a550cb00c9e4ca (patch) | |
tree | f67778d5b3b24eb8240d117775d5574f722789a9 | |
parent | 407784ccacfaddb443f2f7b44d7a4616272c473d (diff) | |
parent | 6de3154674a268b0e109990a1f4c2742dfdc9c66 (diff) | |
download | frameworks_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.java | 16 |
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; |