shill: add passive mode support

Add a command line option to enable passive-mode.  When this option
is enabled, shill will not manage any devices by default.  Remote
application can specify the devices for shill to manage through
org.chromium.flimflam.Manager::ReleaseInterface/ClaimInterface APIs.
All devices claims will go through the default device claimer, with
claimer name of empty string ("").

While there, update the ReleaseInterface API to also take claimer
name as an argument, so that the claimer name will be check before
releasing a device. This is to avoid devices being released by
other unknown claimers.

BUG=chromium:454007
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill apmanager
Manual Test:
1. Start shill with passive mode enabled, verify
   "/usr/local/lib/flimflam/list-device" does not return any device.
2. Use dbus-send command to release "eth0" device from default
   claimer, and verify "/usr/local/lib/flimflam/list-device"
   does return eth0 device.
3. Use dbus-send command to claim "eth0" device from default claimer,
   and verify "/usr/local/lib/flimflam/list-device" does not return
   any device.
4. Regression test with apmanager.

Change-Id: I2b79a13e8aea0d07e9d7923ba3c26adb19237e1a
Reviewed-on: https://chromium-review.googlesource.com/245123
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
Trybot-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
1 file changed