Do not make IkeSocket SOCK_NONBLOCK to save CPU utilization

IKE has high CPU utilization because IkeSocket is using a while(true)
poll loop and do non-blocking read from the socket. It means the reading
thread keeps entering the while loop. This CL makes the socket blocking
so that the reading thread will wait for receiving bytes before
re-entering the while loop.

For FrameworksIkeTests. this CL decreases the CPU utilization from 450%
to 100% and decreases the tests running time from 4 minutes to 30

For more context, previously, to use PacketReader for receiving packets,
IKE socket MUST be explicitly set SOCK_NONBLOCK. Later we switched to
use a poll loop instead of PacketReader because FD_EVENT notifications
which triggers reading packets were sometimes not fired. However, we
forgot to revert the statement to set socket SOCK_NONBLOCK.

Bug: 173566036
Test: atest FrameworksIkeTests, CtsIkeTestCases
Change-Id: I902b53168935d7d1a822900a37249f00d0af1c4c
3 files changed
tree: 33373fcc1e223ff2c7209e8b31f30fbece137620
  1. Android.bp
  3. PREUPLOAD.cfg
  6. apex/
  7. api/
  8. jarjar-rules-shared.txt
  9. src/
  10. tests/

IKEv2 Library for Android


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.