apmanager: configurable device control for AP service

Add a Config property "FullDeviceControl" for controlling the wifi device
when starting an AP service on it. This property is set to true by default.

When it is set to true, apmanager will claim all interfaces resided on the
wifi device used for starting an AP service.

When it is set to false, apmanager will only claim the actual interface on
the wifi device used for starting an AP service. This will allow shill to
maintain the control of the managed mode interface when an AP service is
started on the same wifi device, which will allow the wifi device to support
both client mode and AP mode operation simultaneously (when dedicated interfaces
are created for each operation mode by the driver).

BUG=brillo:541
TEST=USE="asan clang" FEATURES=test emerge-$BOARD apmanager
Manual Test:
1. Grab a peach_pit device, which supports both client mode and AP
   mode operation simultaneously with constraint of both needs to
   operate on the same channel.
2. Start an AP service with default settings, verify shill is not
   managing the managed mode interface "mlan0" anymore via
   "./usr/local/lib/flimflam/test/list-devices".
3. Tear down the AP service, and then connect the device to a wifi
   network ("ChromeOS-Test-AP").
4. Start an AP service with "FullDeviceControl" set to false and
   "Channel" set to the same channel number as the client connection,
   verify shill is still in control of the managed mode interface
   "mlan0" via "./usr/local/lib/flimflam/test/list-devices" and "ifconfig".
5. Verify another client device can connect to that AP with IP connectivity.

Change-Id: I71f58e4b50b3a8f92f1be339157850c37772e29a
Reviewed-on: https://chromium-review.googlesource.com/257611
Trybot-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
6 files changed