resolved conflicts for merge of 53686433
to master
Change-Id: I27004dc464f5771d3205ae5757c6eccc5b16854d
This commit is contained in:
@ -44,6 +44,7 @@ import android.os.Process;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.SystemClock;
|
||||
import android.os.WorkSource;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.util.SparseIntArray;
|
||||
@ -736,7 +737,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
||||
startNavigating(true);
|
||||
}
|
||||
|
||||
public void setMinTime(long minTime) {
|
||||
public void setMinTime(long minTime, WorkSource ws) {
|
||||
if (DEBUG) Log.d(TAG, "setMinTime " + minTime);
|
||||
|
||||
if (minTime >= 0) {
|
||||
@ -779,7 +780,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
||||
public void addListener(int uid) {
|
||||
synchronized (mWakeLock) {
|
||||
mPendingListenerMessages++;
|
||||
mWakeLock.acquire();
|
||||
mWakeLock.acquire();
|
||||
Message m = Message.obtain(mHandler, ADD_LISTENER);
|
||||
m.arg1 = uid;
|
||||
mHandler.sendMessage(m);
|
||||
|
@ -20,6 +20,7 @@ import android.location.Criteria;
|
||||
import android.location.Location;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.WorkSource;
|
||||
|
||||
/**
|
||||
* Location Manager's interface for location providers.
|
||||
@ -47,7 +48,7 @@ public interface LocationProviderInterface {
|
||||
/* returns false if single shot is not supported */
|
||||
boolean requestSingleShotFix();
|
||||
String getInternalState();
|
||||
void setMinTime(long minTime);
|
||||
void setMinTime(long minTime, WorkSource ws);
|
||||
void updateNetworkState(int state, NetworkInfo info);
|
||||
void updateLocation(Location location);
|
||||
boolean sendExtraCommand(String command, Bundle extras);
|
||||
|
@ -29,6 +29,7 @@ import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SystemClock;
|
||||
import android.os.WorkSource;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.location.DummyLocationProvider;
|
||||
@ -52,6 +53,7 @@ public class LocationProviderProxy implements LocationProviderInterface {
|
||||
private boolean mLocationTracking = false;
|
||||
private boolean mEnabled = false;
|
||||
private long mMinTime = -1;
|
||||
private WorkSource mMinTimeSource = new WorkSource();
|
||||
private int mNetworkState;
|
||||
private NetworkInfo mNetworkInfo;
|
||||
|
||||
@ -122,7 +124,7 @@ public class LocationProviderProxy implements LocationProviderInterface {
|
||||
provider.enableLocationTracking(true);
|
||||
}
|
||||
if (mMinTime >= 0) {
|
||||
provider.setMinTime(mMinTime);
|
||||
provider.setMinTime(mMinTime, mMinTimeSource);
|
||||
}
|
||||
if (mNetworkInfo != null) {
|
||||
provider.updateNetworkState(mNetworkState, mNetworkInfo);
|
||||
@ -318,6 +320,7 @@ public class LocationProviderProxy implements LocationProviderInterface {
|
||||
mLocationTracking = enable;
|
||||
if (!enable) {
|
||||
mMinTime = -1;
|
||||
mMinTimeSource.clear();
|
||||
}
|
||||
ILocationProvider provider;
|
||||
synchronized (mServiceConnection) {
|
||||
@ -339,15 +342,16 @@ public class LocationProviderProxy implements LocationProviderInterface {
|
||||
return mMinTime;
|
||||
}
|
||||
|
||||
public void setMinTime(long minTime) {
|
||||
mMinTime = minTime;
|
||||
public void setMinTime(long minTime, WorkSource ws) {
|
||||
mMinTime = minTime;
|
||||
mMinTimeSource.set(ws);
|
||||
ILocationProvider provider;
|
||||
synchronized (mServiceConnection) {
|
||||
provider = mProvider;
|
||||
}
|
||||
if (provider != null) {
|
||||
try {
|
||||
provider.setMinTime(minTime);
|
||||
provider.setMinTime(minTime, ws);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import android.location.LocationProvider;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.os.WorkSource;
|
||||
import android.util.Log;
|
||||
import android.util.PrintWriterPrinter;
|
||||
|
||||
@ -201,7 +202,7 @@ public class MockProvider implements LocationProviderInterface {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setMinTime(long minTime) {
|
||||
public void setMinTime(long minTime, WorkSource ws) {
|
||||
}
|
||||
|
||||
public void updateNetworkState(int state, NetworkInfo info) {
|
||||
|
@ -24,6 +24,7 @@ import android.location.LocationProvider;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.os.WorkSource;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
@ -123,7 +124,7 @@ public class PassiveProvider implements LocationProviderInterface {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setMinTime(long minTime) {
|
||||
public void setMinTime(long minTime, WorkSource ws) {
|
||||
}
|
||||
|
||||
public void updateNetworkState(int state, NetworkInfo info) {
|
||||
|
Reference in New Issue
Block a user