Merge "Don't bother validating networks that don't satisfy the default request." into lmp-mr1-dev
This commit is contained in:
commit
d8b132b7b2
2 changed files with 6 additions and 3 deletions
|
|
@ -3541,6 +3541,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
private final HashMap<Messenger, NetworkAgentInfo> mNetworkAgentInfos =
|
||||
new HashMap<Messenger, NetworkAgentInfo>();
|
||||
|
||||
// Note: if mDefaultRequest is changed, NetworkMonitor needs to be updated.
|
||||
private final NetworkRequest mDefaultRequest;
|
||||
|
||||
private boolean isDefaultNetwork(NetworkAgentInfo nai) {
|
||||
|
|
@ -3552,10 +3553,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
int currentScore, NetworkMisc networkMisc) {
|
||||
enforceConnectivityInternalPermission();
|
||||
|
||||
// TODO: Instead of passing mDefaultRequest, provide an API to determine whether a Network
|
||||
// satisfies mDefaultRequest.
|
||||
NetworkAgentInfo nai = new NetworkAgentInfo(messenger, new AsyncChannel(),
|
||||
new NetworkInfo(networkInfo), new LinkProperties(linkProperties),
|
||||
new NetworkCapabilities(networkCapabilities), currentScore, mContext, mTrackerHandler,
|
||||
new NetworkMisc(networkMisc));
|
||||
new NetworkMisc(networkMisc), mDefaultRequest);
|
||||
synchronized (this) {
|
||||
nai.networkMonitor.systemReady = mSystemReady;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class NetworkAgentInfo {
|
|||
|
||||
public NetworkAgentInfo(Messenger messenger, AsyncChannel ac, NetworkInfo info,
|
||||
LinkProperties lp, NetworkCapabilities nc, int score, Context context, Handler handler,
|
||||
NetworkMisc misc) {
|
||||
NetworkMisc misc, NetworkRequest defaultRequest) {
|
||||
this.messenger = messenger;
|
||||
asyncChannel = ac;
|
||||
network = null;
|
||||
|
|
@ -76,7 +76,7 @@ public class NetworkAgentInfo {
|
|||
linkProperties = lp;
|
||||
networkCapabilities = nc;
|
||||
currentScore = score;
|
||||
networkMonitor = new NetworkMonitor(context, handler, this);
|
||||
networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest);
|
||||
networkMisc = misc;
|
||||
created = false;
|
||||
validated = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue