apmanager: Make sure apmanager starts after shill

There were a couple issues with apmanager starting too early,
before even wireless devices have started. In that case,
no soft AP would be even started. This was fixed to change the
startup sequence to launch apmanager only after iptables (since
those jobs start only after network-services have started).

That change fixed a race between apmanager and wifi devices.

However another race surfaced between shill and apmanager.
In this case, apmanager would add an IP address to wlan0 and then
shill would start up and remove it.

Adding conditional dependency on shill startup seems to have fixed
that race too.

BUG=None
TEST=`FEATURES=test emerge-gizmo apmanager`
TEST=tested on gizmo to make sure it goes into wifi bootstrapping
     mode after reboot. Tried 5 times and each time soft AP started
     correctly and an IP address was assigned to the network interface.

Change-Id: Ic26123683ba9246b15886fb1d035d205eb1723a7
Reviewed-on: https://chromium-review.googlesource.com/293024
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
1 file changed