Add more methods for capture and injection

Add #close() but keep it and the constructor as package-private because we want caller to call VirtualAudioDevice#close().

Add #getFormat() and the audio format will be owned by
AudioCapture/AudioInjection, not VirtualAudioSession.

Add all #read() and #write() overloads method, so that the caller can
replace the call to AudioRecord/AudioTrack easily.

Bug: 218542209
CTS-Coverage-Bug: 218528439
Test: atest FrameworksCoreTests:android.companion.virtual
Change-Id: Iccfd497e6aaeacc60a57d28ae730fdc0cce46a25
4 files changed