diff options
author | Mike Lockwood <lockwood@android.com> | 2009-04-21 09:38:18 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-04-21 09:38:18 -0700 |
commit | e2b44c5aaff312fbb00e66dd42b8444938017672 (patch) | |
tree | 197313bebcf481c50c2f9fdcc40ce4fc7a880b94 /location | |
parent | 98cb66797422c4ccdee6f1a07636146d784a471b (diff) | |
download | frameworks_base-e2b44c5aaff312fbb00e66dd42b8444938017672.zip frameworks_base-e2b44c5aaff312fbb00e66dd42b8444938017672.tar.gz frameworks_base-e2b44c5aaff312fbb00e66dd42b8444938017672.tar.bz2 |
location: Location Manager wakelock cleanup, phase 1
Move cell and wifi lock from LocationManagerService to NetworkLocationProvider
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location')
3 files changed, 31 insertions, 12 deletions
diff --git a/location/java/android/location/ILocationProvider.aidl b/location/java/android/location/ILocationProvider.aidl index d43fd6e..82533a5 100644 --- a/location/java/android/location/ILocationProvider.aidl +++ b/location/java/android/location/ILocationProvider.aidl @@ -48,7 +48,6 @@ interface ILocationProvider { boolean sendExtraCommand(String command, inout Bundle extras); void addListener(int uid); void removeListener(int uid); - - /* the following is used only for NetworkLocationProvider */ - void updateCellLockStatus(boolean acquired); + void wakeLockAcquired(); + void wakeLockReleased(); } diff --git a/location/java/android/location/LocationProviderImpl.java b/location/java/android/location/LocationProviderImpl.java index fa0cd2d..a20aa3c 100644 --- a/location/java/android/location/LocationProviderImpl.java +++ b/location/java/android/location/LocationProviderImpl.java @@ -259,10 +259,22 @@ public abstract class LocationProviderImpl extends LocationProvider { } /** - * Informs the location provider when a client is no longerlistening for location information + * Informs the location provider when a client is no longer listening for location information * * @param uid the uid of the client proces */ public void removeListener(int uid) { } + + /** + * Informs the location provider when the location manager service has acquired its wake lock + */ + public void wakeLockAcquired() { + } + + /** + * Informs the location provider when the location manager service has released its wake lock + */ + public void wakeLockReleased() { + } } diff --git a/location/java/com/android/internal/location/LocationProviderProxy.java b/location/java/com/android/internal/location/LocationProviderProxy.java index 84462b2..72dd07d 100644 --- a/location/java/com/android/internal/location/LocationProviderProxy.java +++ b/location/java/com/android/internal/location/LocationProviderProxy.java @@ -222,14 +222,6 @@ public class LocationProviderProxy extends LocationProviderImpl { } } - public void updateCellLockStatus(boolean acquired) { - try { - mProvider.updateCellLockStatus(acquired); - } catch (RemoteException e) { - Log.e(TAG, "updateCellLockStatus failed", e); - } - } - public void addListener(int uid) { try { mProvider.addListener(uid); @@ -245,4 +237,20 @@ public class LocationProviderProxy extends LocationProviderImpl { Log.e(TAG, "removeListener failed", e); } } + + public void wakeLockAcquired() { + try { + mProvider.wakeLockAcquired(); + } catch (RemoteException e) { + Log.e(TAG, "wakeLockAcquired failed", e); + } + } + + public void wakeLockReleased() { + try { + mProvider.wakeLockReleased(); + } catch (RemoteException e) { + Log.e(TAG, "wakeLockReleased failed", e); + } + } } |