- Multiple ifaces can map to one wiphy.
- One band can only map to one wiphy.
Previously, if any iface was removed, all wiphy's associated
with that iface will also be removed, including all
associated bands. This is not correct, as there could also
be other ifaces associated with that wiphy which are still
active.
Fixed to only remove the wiphy (and associated bands) once
no active ifaces remain for that wiphy.
Also, cleaned up weird idiom of deleting from a map while
iterating over it (no change in behavior intended).
Bug: 175614847
Test: system/connectivity/wificond/runtests.sh
Test: 1. Connect to network1 on device1.
2. Turn on SAP for network2 on device2.
3. Since device1 prefers network1 (configured ahead of time with user
connect choice), it will connect to network2 using Make-Before-Break
(MBB).
4. After MBB completes and network1 is disconnected, turn off SAP.
5. device1 will disconnect from network2.
6. Verify scans are triggered and connects back to network1.
Change-Id: Ie8d2f6e12a350501dee82d6bdde3501afc556d69