Clean up interface between LocationManagerService and the location providers:

LocationManagerService now uses new Java interface LocationProviderInterface
rather than LocationProviderProxy to refer to location providers internally.

LocationProviderProxy and the ILocationProvider binder interface are only
used for location providers implemented as services (NetworkLocationProvider)

Built-in location providers (GpsLocationProvider and mock providers) now just
implement LocationProviderInterface rather than using a Binder interface and proxy object.

Delete obsolete and unused TestLocationProvider class.

Change-Id: Id800e7c1864f7c666f8e37125c05896493b9c8c4
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2010-02-09 08:46:14 -05:00
parent ca35953c90
commit d03ff94fe5
8 changed files with 123 additions and 260 deletions

View File

@@ -17,9 +17,9 @@
package com.android.internal.location;
import android.location.ILocationManager;
import android.location.ILocationProvider;
import android.location.Location;
import android.location.LocationProvider;
import android.location.LocationProviderInterface;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.os.RemoteException;
@@ -33,7 +33,7 @@ import java.io.PrintWriter;
*
* {@hide}
*/
public class MockProvider extends ILocationProvider.Stub {
public class MockProvider implements LocationProviderInterface {
private final String mName;
private final ILocationManager mLocationManager;
private final boolean mRequiresNetwork;
@@ -73,6 +73,10 @@ public class MockProvider extends ILocationProvider.Stub {
mLocation = new Location(name);
}
public String getName() {
return mName;
}
public void disable() {
mEnabled = false;
}
@@ -81,6 +85,10 @@ public class MockProvider extends ILocationProvider.Stub {
mEnabled = true;
}
public boolean isEnabled() {
return mEnabled;
}
public int getStatus(Bundle extras) {
if (mHasStatus) {
extras.clear();