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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user