Avoid reposting the exit task if polling
has already been disabled.
Helps reduce the risk of having tasks in the
event queue at exit. From the documentation
for Looper, the event queue should be empty
at exit to avoid deallocating strong pointers
to the queued messages.
Note that no behavioral change is expected.
If the exit task has not been posted yet,
the behavior is the same as before.
If the exit task had already been executed
(i.e. polling has been disabled), it does
not need to be posted again.
Bug: 386132537
Test: Manual test - verify that wificond can
still be stopped from the shell
Change-Id: I520151b8f4b93bdbe5fc3da8be4f4689d5cff7ff
2 files changed