Make TextToSpeech.shutdown() work before init callback.

TextToSpeech.shutdown() never worked properly if was called before receiving
onServiceConnected in connection object. Also, due to recent changes,
TextToSpeech.shutdown() did not work until async task created in
onServiceConnected returned its result to the main thread.

This change makes .shutdown() work in all those cases. To allow that
runAction can now execute code with connection that's not fully setuped
- so we can shutt it down. Also, newly created connection is now hold in
new member variable mConnectingServiceConnection, so it can be closed
before receiving onServiceConnected callback.

Also, I changed name of OnServiceConnectedAsyncTask to
SetupConnectionAsyncTask, I find it more descriptive.

Bug: 8003757
Change-Id: I41d84cfdb8fa28fe44235fb4a9764fa8f3d0643c
1 file changed