Fix ethernet.
It was attempting to update the NetworkAgent before the NetworkAgent was created, causing NullPointerExceptions. bug:15407938 Change-Id: Ie36b906df4b12f095a16d1b30c847a55b074d60c
This commit is contained in:
@@ -136,7 +136,6 @@ class EthernetNetworkFactory {
|
|||||||
// Tell the agent we're disconnected. It will call disconnect().
|
// Tell the agent we're disconnected. It will call disconnect().
|
||||||
mNetworkInfo.setDetailedState(DetailedState.DISCONNECTED, null, mHwAddr);
|
mNetworkInfo.setDetailedState(DetailedState.DISCONNECTED, null, mHwAddr);
|
||||||
}
|
}
|
||||||
mNetworkAgent.sendNetworkScore(mLinkUp? NETWORK_SCORE : -1);
|
|
||||||
updateAgent();
|
updateAgent();
|
||||||
mFactory.setScoreFilter(up ? NETWORK_SCORE : -1);
|
mFactory.setScoreFilter(up ? NETWORK_SCORE : -1);
|
||||||
}
|
}
|
||||||
@@ -264,9 +263,6 @@ class EthernetNetworkFactory {
|
|||||||
setStaticIpAddress(linkProperties);
|
setStaticIpAddress(linkProperties);
|
||||||
} else {
|
} else {
|
||||||
mNetworkInfo.setDetailedState(DetailedState.OBTAINING_IPADDR, null, mHwAddr);
|
mNetworkInfo.setDetailedState(DetailedState.OBTAINING_IPADDR, null, mHwAddr);
|
||||||
synchronized (EthernetNetworkFactory.this) {
|
|
||||||
mNetworkAgent.sendNetworkInfo(mNetworkInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
DhcpResults dhcpResults = new DhcpResults();
|
DhcpResults dhcpResults = new DhcpResults();
|
||||||
// TODO: Handle DHCP renewals better.
|
// TODO: Handle DHCP renewals better.
|
||||||
@@ -276,13 +272,6 @@ class EthernetNetworkFactory {
|
|||||||
// noticing.
|
// noticing.
|
||||||
if (!NetworkUtils.runDhcp(mIface, dhcpResults)) {
|
if (!NetworkUtils.runDhcp(mIface, dhcpResults)) {
|
||||||
Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError());
|
Log.e(TAG, "DHCP request error:" + NetworkUtils.getDhcpError());
|
||||||
synchronized(EthernetNetworkFactory.this) {
|
|
||||||
// DHCP failed. Tell the agent we now have a score
|
|
||||||
// of 0, and it will call disconnect for us. We'll
|
|
||||||
// attempt to reconnect when we next see a link up
|
|
||||||
// event, which resets the score to NETWORK_SCORE.
|
|
||||||
mNetworkAgent.sendNetworkScore(-1);
|
|
||||||
}
|
|
||||||
mFactory.setScoreFilter(-1);
|
mFactory.setScoreFilter(-1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user