Merge changes I2292c1cb,I8f60c137 into rvc-dev

* changes:
  Test that IpNeighborMonitor is stopped when IpServer stops.
  Memory leak due to no stop for IpNeighborMonitor.
This commit is contained in:
TreeHugger Robot
2020-06-19 06:36:50 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 0 deletions

View File

@@ -1322,6 +1322,7 @@ public class IpServer extends StateMachine {
class UnavailableState extends State { class UnavailableState extends State {
@Override @Override
public void enter() { public void enter() {
mIpNeighborMonitor.stop();
mLastError = TetheringManager.TETHER_ERROR_NO_ERROR; mLastError = TetheringManager.TETHER_ERROR_NO_ERROR;
sendInterfaceState(STATE_UNAVAILABLE); sendInterfaceState(STATE_UNAVAILABLE);
} }

View File

@@ -860,6 +860,7 @@ public class IpServerTest {
verify(mBpfCoordinator).tetherOffloadRuleClear(mIpServer); verify(mBpfCoordinator).tetherOffloadRuleClear(mIpServer);
verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighA, macA)); verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighA, macA));
verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighB, macB)); verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighB, macB));
verify(mIpNeighborMonitor).stop();
resetNetdAndBpfCoordinator(); resetNetdAndBpfCoordinator();
} }