diff options
author | Mike Lockwood <lockwood@android.com> | 2010-02-01 12:16:35 -0500 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-02-01 12:18:59 -0500 |
commit | 2cd543aad5cc38fb3e7158f1cc5080c7e9ff5d24 (patch) | |
tree | c1f3027d539fabb90d75a345df4e668d4fbfe09c /location/java/com/android/internal | |
parent | 3ff37c1d48e2347bb8e20b5b433543064a36f50a (diff) | |
download | frameworks_base-2cd543aad5cc38fb3e7158f1cc5080c7e9ff5d24.zip frameworks_base-2cd543aad5cc38fb3e7158f1cc5080c7e9ff5d24.tar.gz frameworks_base-2cd543aad5cc38fb3e7158f1cc5080c7e9ff5d24.tar.bz2 |
Remove ILocationProvider.isEnabled() binder call and use cached value instead.
Change-Id: Id6a9f6d2e2f5cc5810a2beeb0f869f06e2d18860
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location/java/com/android/internal')
3 files changed, 4 insertions, 14 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java index 9d67882..c8809a2 100755 --- a/location/java/com/android/internal/location/GpsLocationProvider.java +++ b/location/java/com/android/internal/location/GpsLocationProvider.java @@ -571,10 +571,6 @@ public class GpsLocationProvider extends ILocationProvider.Stub { } } - public boolean isEnabled() { - return mEnabled; - } - public int getStatus(Bundle extras) { if (extras != null) { extras.putInt("satellites", mSvCount); diff --git a/location/java/com/android/internal/location/LocationProviderProxy.java b/location/java/com/android/internal/location/LocationProviderProxy.java index 89337b3..2e0be89 100644 --- a/location/java/com/android/internal/location/LocationProviderProxy.java +++ b/location/java/com/android/internal/location/LocationProviderProxy.java @@ -40,6 +40,7 @@ public class LocationProviderProxy implements IBinder.DeathRecipient { private final String mName; private final ILocationProvider mProvider; private boolean mLocationTracking = false; + private boolean mEnabled = false; private long mMinTime = 0; private boolean mDead; @@ -152,6 +153,7 @@ public class LocationProviderProxy implements IBinder.DeathRecipient { public void enable() { try { mProvider.enable(); + mEnabled = true; } catch (RemoteException e) { Log.e(TAG, "enable failed", e); } @@ -160,18 +162,14 @@ public class LocationProviderProxy implements IBinder.DeathRecipient { public void disable() { try { mProvider.disable(); + mEnabled = false; } catch (RemoteException e) { Log.e(TAG, "disable failed", e); } } public boolean isEnabled() { - try { - return mProvider.isEnabled(); - } catch (RemoteException e) { - Log.e(TAG, "isEnabled failed", e); - return false; - } + return mEnabled; } public int getStatus(Bundle extras) { diff --git a/location/java/com/android/internal/location/MockProvider.java b/location/java/com/android/internal/location/MockProvider.java index 2614f82..7d9e86c 100644 --- a/location/java/com/android/internal/location/MockProvider.java +++ b/location/java/com/android/internal/location/MockProvider.java @@ -95,10 +95,6 @@ public class MockProvider extends ILocationProvider.Stub { return mStatusUpdateTime; } - public boolean isEnabled() { - return mEnabled; - } - public int getAccuracy() { return mAccuracy; } |