Support setting the default interface to null again.

Currently, the default interface can only ever go from null to
non-null. This is correct for fixed interfaces (because they
don't get unplugged) and it's generally correct for USB
interfaces that use ethX as their device name (because when
they are unplugged and plugged in again, the device name won't
change). But it is not correct if, for example, the default
interface is a test interface. So, allow mDefaultInterface to go
back to null.

This CL also fixes a crash if a tethered interface request is
added and removed when there is no default interface.

Also, make dump() report tethered interface requests.

Also remove an unused variable that I missed in the previous CL.

Bug: 150644681
Test: tested by EthernetTetheringTest in same topic
Change-Id: I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d
Merged-In: I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d
(cherry picked from commit cc156c2f7793731b2699e194d4b164138ee4cf62)
1 file changed
tree: ce76a87d815280558a38ba94f3b3ced892f7fbc9
  1. service-t/
  2. tests/