Fix the ethernet setting API bug.

After turning off the ethernet settings via api, the ethernet service
can still be started when plugging-in the cable. Improve the api by
ignoring the upcoming interface unsolicited event listener callbacks
and register new interface observer once the ethernet setting is enabled
again.

Bug: 231933028
Test: atest testListenEthernetStateChange_unsolicitedEventListener
Change-Id: I1b1cb7d157f023fca82d75592168bd360a6fa6e1
(cherry picked from commit 94a00dfc649f5ddb630e6713a81421d0ecd00415)
Merged-In: I1b1cb7d157f023fca82d75592168bd360a6fa6e1
2 files changed