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
tree: 11d500be1b1c9cf12701aa3a1c4c2818e3e54a89
  1. apex/
  2. api/
  3. src/
  4. tests/
  5. Android.bp
  6. jarjar-rules-shared.txt
  7. jarjar-rules-test.txt
  8. OWNERS
  9. PREUPLOAD.cfg
  10. README.md
  11. TEST_MAPPING
README.md

IKEv2 Library for Android

Introduction

This IKEv2 library is an in-process client library implementing the IKEv2 protocol as well as extensions necessary for the support of IWLAN. It is designed to work in a non-privileged fashion on top of the Android IPsec API surface.