handle wifi interface changes with interfaceRemoved

When wifi is enabled, turning on the wifi hotspot is confused when the
underlying interface goes down (a necessary step to start up the SoftAp).

When tethering on a wifi interface, we may see the interface go down and
then back up.  When the interface goes down the TetherInterfaceSM in
Tethering.java receives a CMD_INTERFACE_DOWN message.  When this
happens, the existing TetherInterfaceSM is removed and a new one is
created.  If tethering was already established, this also triggers the
hotspot teardown.  This CL allows the TetherInterfaceSM for wifi to
ignore the interface down and instead rely on TETHER_MODE_UNREQUESTED
and the interfaceRemoved method.

This change was tested to verify the hotpost comes up with wifi disabled
and wifi enabled.  The hotspot was also confirmed to disable when turned
off through the UI and when airplane mode is enabled.

BUG: 27711081

Change-Id: Ia24b215dca95852fdca2245224a8fb06e0bb3b65
1 file changed