Merge "Fix null pointer exception of calling NetworkInfo.mState.name()" am: 95d62d8e55 am: a61bb686ae
am: c560826d4d Change-Id: Iec9e7aff73662369b5e922626494d42c025a2cb6
This commit is contained in:
@@ -5520,7 +5520,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
nai.asyncChannel.connect(mContext, mTrackerHandler, nai.messenger);
|
nai.asyncChannel.connect(mContext, mTrackerHandler, nai.messenger);
|
||||||
NetworkInfo networkInfo = nai.networkInfo;
|
NetworkInfo networkInfo = nai.networkInfo;
|
||||||
nai.networkInfo = null;
|
|
||||||
updateNetworkInfo(nai, networkInfo);
|
updateNetworkInfo(nai, networkInfo);
|
||||||
updateUids(nai, null, nai.networkCapabilities);
|
updateUids(nai, null, nai.networkCapabilities);
|
||||||
}
|
}
|
||||||
@@ -6519,8 +6518,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
|
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
log(networkAgent.name() + " EVENT_NETWORK_INFO_CHANGED, going from " +
|
log(networkAgent.name() + " EVENT_NETWORK_INFO_CHANGED, going from " +
|
||||||
(oldInfo == null ? "null" : oldInfo.getState()) +
|
oldInfo.getState() + " to " + state);
|
||||||
" to " + state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!networkAgent.created
|
if (!networkAgent.created
|
||||||
@@ -6593,8 +6591,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// TODO(b/122649188): send the broadcast only to VPN users.
|
// TODO(b/122649188): send the broadcast only to VPN users.
|
||||||
mProxyTracker.sendProxyBroadcast();
|
mProxyTracker.sendProxyBroadcast();
|
||||||
}
|
}
|
||||||
} else if ((oldInfo != null && oldInfo.getState() == NetworkInfo.State.SUSPENDED) ||
|
} else if (networkAgent.created && (oldInfo.getState() == NetworkInfo.State.SUSPENDED ||
|
||||||
state == NetworkInfo.State.SUSPENDED) {
|
state == NetworkInfo.State.SUSPENDED)) {
|
||||||
// going into or coming out of SUSPEND: re-score and notify
|
// going into or coming out of SUSPEND: re-score and notify
|
||||||
if (networkAgent.getCurrentScore() != oldScore) {
|
if (networkAgent.getCurrentScore() != oldScore) {
|
||||||
rematchAllNetworksAndRequests(networkAgent, oldScore);
|
rematchAllNetworksAndRequests(networkAgent, oldScore);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server.connectivity;
|
package com.android.server.connectivity;
|
||||||
|
|
||||||
|
import android.annotation.NonNull;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.IDnsResolver;
|
import android.net.IDnsResolver;
|
||||||
import android.net.INetd;
|
import android.net.INetd;
|
||||||
@@ -116,7 +117,7 @@ import java.util.TreeSet;
|
|||||||
// not, ConnectivityService disconnects the NetworkAgent's AsyncChannel.
|
// not, ConnectivityService disconnects the NetworkAgent's AsyncChannel.
|
||||||
public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
|
public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
|
||||||
|
|
||||||
public NetworkInfo networkInfo;
|
@NonNull public NetworkInfo networkInfo;
|
||||||
// This Network object should always be used if possible, so as to encourage reuse of the
|
// This Network object should always be used if possible, so as to encourage reuse of the
|
||||||
// enclosed socket factory and connection pool. Avoid creating other Network objects.
|
// enclosed socket factory and connection pool. Avoid creating other Network objects.
|
||||||
// This Network object is always valid.
|
// This Network object is always valid.
|
||||||
|
|||||||
Reference in New Issue
Block a user