Properly shut down sl4a sessions.
Replace 'terminate' option with proper shutdown through messaging.
2. droid's sl4a session gets the shutdown command and sends a shutdown event.
3. droid's sl4a session breaks out of event loop and cleans up.
4. event_dispatcher on the python side gets the shutdown event and calls
droid.closeSl4aSession on its own droid session.
5. event_dispatcher breaks out of event loop and stops.
6. event_dispatcher's droid session gets the shutdown command and sends
a shutdown event.
7. event_dispatcher's droid session breaks out of event loop and cleans up.
8. The second shutdown event is ignored.
Add a couple of simple tests for sl4a start and shutdown.
Cherry-pick from mwd: https://partner-android-review.googlesource.com/#/c/212234/
4 files changed