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
seconds.

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