Skip to content
Snippets Groups Projects
Commit b6b80413 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by Gerrit Code Review
Browse files

Merge "ethernet: rename IpClient callback handler functions" into main

parents a92d8cab d865e6d8
No related branches found
No related tags found
No related merge requests found
...@@ -328,24 +328,24 @@ public class EthernetNetworkFactory { ...@@ -328,24 +328,24 @@ public class EthernetNetworkFactory {
@Override @Override
public void onProvisioningSuccess(LinkProperties newLp) { public void onProvisioningSuccess(LinkProperties newLp) {
safelyPostOnHandler(() -> onIpLayerStarted(newLp)); safelyPostOnHandler(() -> handleOnProvisioningSuccess(newLp));
} }
@Override @Override
public void onProvisioningFailure(LinkProperties newLp) { public void onProvisioningFailure(LinkProperties newLp) {
// This cannot happen due to provisioning timeout, because our timeout is 0. It can // This cannot happen due to provisioning timeout, because our timeout is 0. It can
// happen due to errors while provisioning or on provisioning loss. // happen due to errors while provisioning or on provisioning loss.
safelyPostOnHandler(() -> onIpLayerStopped()); safelyPostOnHandler(() -> handleOnProvisioningFailure());
} }
@Override @Override
public void onLinkPropertiesChange(LinkProperties newLp) { public void onLinkPropertiesChange(LinkProperties newLp) {
safelyPostOnHandler(() -> updateLinkProperties(newLp)); safelyPostOnHandler(() -> handleOnLinkPropertiesChange(newLp));
} }
@Override @Override
public void onReachabilityLost(String logMsg) { public void onReachabilityLost(String logMsg) {
safelyPostOnHandler(() -> updateNeighborLostEvent(logMsg)); safelyPostOnHandler(() -> handleOnReachabilityLost(logMsg));
} }
@Override @Override
...@@ -499,7 +499,7 @@ public class EthernetNetworkFactory { ...@@ -499,7 +499,7 @@ public class EthernetNetworkFactory {
mIpClient.startProvisioning(createProvisioningConfiguration(mIpConfig)); mIpClient.startProvisioning(createProvisioningConfiguration(mIpConfig));
} }
void onIpLayerStarted(@NonNull final LinkProperties linkProperties) { private void handleOnProvisioningSuccess(@NonNull final LinkProperties linkProperties) {
if (mNetworkAgent != null) { if (mNetworkAgent != null) {
Log.e(TAG, "Already have a NetworkAgent - aborting new request"); Log.e(TAG, "Already have a NetworkAgent - aborting new request");
stop(); stop();
...@@ -533,7 +533,7 @@ public class EthernetNetworkFactory { ...@@ -533,7 +533,7 @@ public class EthernetNetworkFactory {
mNetworkAgent.markConnected(); mNetworkAgent.markConnected();
} }
void onIpLayerStopped() { private void handleOnProvisioningFailure() {
// There is no point in continuing if the interface is gone as stop() will be triggered // There is no point in continuing if the interface is gone as stop() will be triggered
// by removeInterface() when processed on the handler thread and start() won't // by removeInterface() when processed on the handler thread and start() won't
// work for a non-existent interface. // work for a non-existent interface.
...@@ -553,15 +553,15 @@ public class EthernetNetworkFactory { ...@@ -553,15 +553,15 @@ public class EthernetNetworkFactory {
} }
} }
void updateLinkProperties(LinkProperties linkProperties) { private void handleOnLinkPropertiesChange(LinkProperties linkProperties) {
mLinkProperties = linkProperties; mLinkProperties = linkProperties;
if (mNetworkAgent != null) { if (mNetworkAgent != null) {
mNetworkAgent.sendLinkPropertiesImpl(linkProperties); mNetworkAgent.sendLinkPropertiesImpl(linkProperties);
} }
} }
void updateNeighborLostEvent(String logMsg) { private void handleOnReachabilityLost(String logMsg) {
Log.i(TAG, "updateNeighborLostEvent " + logMsg); Log.i(TAG, "handleOnReachabilityLost " + logMsg);
if (mIpConfig.getIpAssignment() == IpAssignment.STATIC) { if (mIpConfig.getIpAssignment() == IpAssignment.STATIC) {
// Ignore NUD failures for static IP configurations, where restarting the IpClient // Ignore NUD failures for static IP configurations, where restarting the IpClient
// will not fix connectivity. // will not fix connectivity.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment