AudioPolicy: catch exceptions on unregister

Make the synchronous AudioManager.unregisterAudioPolicy() method
compatible with situations where the owner of the policy has already
stopped / flushed the tracks or recorders associated with the policy
by catching the IllegalStateException that could be thrown.

Test: atest AudioServiceHostTest#testGetDevicesForAttributes
Change-Id: Ic0ae0732b775a10135f6cbdd31d5e3409e550942
1 file changed