code: def clean_up(self):
          
          if not self.started:
              return
          self.started = False
          self.clear_all_events()
          # At this point, the sl4a apk is destroyed and nothing is listening on
          # the socket. Avoid sending any sl4a commands; just clean up the socket
          # and return.
          self._sl4a.disconnect()
          self.poller.set_result("Done")
          # The polling thread is guaranteed to finish after a max of 60 seconds,
          # so we don't wait here.
          self.executor.shutdown(wait=False)
docs: Clean up and release resources after the event dispatcher polling
          loop has been broken.
  
          The following things happen:
          1. Clear all events and flags.
          2. Close the sl4a client the event_dispatcher object holds.
          3. Shut down executor without waiting.