Fix NPE in ConnectivityService
Could occur when requestRouteToHostAddress is called on a network with no associated tracker. Code later in the method handles this case gracefully but code introduced in JB throws an exception. Change-Id: I6c8a0e313ecbcca120aeb5dd0802a72114749aa1
This commit is contained in:
@@ -1432,9 +1432,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
return false;
|
||||
}
|
||||
NetworkStateTracker tracker = mNetTrackers[networkType];
|
||||
DetailedState netState = tracker.getNetworkInfo().getDetailedState();
|
||||
DetailedState netState = DetailedState.DISCONNECTED;
|
||||
if (tracker != null) {
|
||||
netState = tracker.getNetworkInfo().getDetailedState();
|
||||
}
|
||||
|
||||
if (tracker == null || (netState != DetailedState.CONNECTED &&
|
||||
if ((netState != DetailedState.CONNECTED &&
|
||||
netState != DetailedState.CAPTIVE_PORTAL_CHECK) ||
|
||||
tracker.isTeardownRequested()) {
|
||||
if (VDBG) {
|
||||
|
||||
Reference in New Issue
Block a user