summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2010-02-01 11:03:09 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-01 11:03:09 -0800
commit5292ccd6bb92ff69faa45ac551d5b2c79f52e891 (patch)
tree1477e09d119683444a96d7ebe61ed80839379050
parent8c38b241153058b4d02095bc9bd0ab6e1b8b1c1c (diff)
parent2cd543aad5cc38fb3e7158f1cc5080c7e9ff5d24 (diff)
downloadframeworks_base-5292ccd6bb92ff69faa45ac551d5b2c79f52e891.zip
frameworks_base-5292ccd6bb92ff69faa45ac551d5b2c79f52e891.tar.gz
frameworks_base-5292ccd6bb92ff69faa45ac551d5b2c79f52e891.tar.bz2
Merge "Remove ILocationProvider.isEnabled() binder call and use cached value instead."
-rw-r--r--location/java/android/location/ILocationProvider.aidl1
-rw-r--r--location/java/android/location/LocationProviderImpl.java4
-rwxr-xr-xlocation/java/com/android/internal/location/GpsLocationProvider.java4
-rw-r--r--location/java/com/android/internal/location/LocationProviderProxy.java10
-rw-r--r--location/java/com/android/internal/location/MockProvider.java4
5 files changed, 4 insertions, 19 deletions
diff --git a/location/java/android/location/ILocationProvider.aidl b/location/java/android/location/ILocationProvider.aidl
index 7da16e4..9fe6ab4 100644
--- a/location/java/android/location/ILocationProvider.aidl
+++ b/location/java/android/location/ILocationProvider.aidl
@@ -37,7 +37,6 @@ interface ILocationProvider {
int getAccuracy();
void enable();
void disable();
- boolean isEnabled();
int getStatus(out Bundle extras);
long getStatusUpdateTime();
void enableLocationTracking(boolean enable);
diff --git a/location/java/android/location/LocationProviderImpl.java b/location/java/android/location/LocationProviderImpl.java
index 9a3624e..b0c2db7 100644
--- a/location/java/android/location/LocationProviderImpl.java
+++ b/location/java/android/location/LocationProviderImpl.java
@@ -75,10 +75,6 @@ public abstract class LocationProviderImpl extends LocationProvider {
LocationProviderImpl.this.disable();
}
- public boolean isEnabled() {
- return LocationProviderImpl.this.isEnabled();
- }
-
public int getStatus(Bundle extras) {
return LocationProviderImpl.this.getStatus(extras);
}
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;
}