Wait for onStopped before restarting hardware keepalive
This commit adds the support of restarting IkeNattKeepalive with a
new KeepaliveConfig.
Specifically, when the IkeNattKeepalive is using hardware offload when
the restart is triggered, the IkeNattKeepalive will first switch to use
software keepalive and then wait for the onStopped callback before
restarting a new hardware offload. This fixes the issue that restarting
hardware offload failed because the slot was not released from the
previous offload.
If IkeNattKeepalive is using software keepalive when the restart
kicks off, the IkeNattKeepalive will restart hardware keepalive
immediately.
Bug: 274842999
Test: atest FrameworksIkeTests, CtsIkeTestCases
Test: VCN and VPN CTS and unit tests
Test: Verified Settings VPN can restart keepalive with underpinned
network
Change-Id: Ia8acf9c156e57711439fda2133d1987e104dc395
5 files changed