Closed AnonymousUserAndroid closed 1 year ago
Hi @AnonymousUserAndroid I've looked into scenario where AudioSwitch is started then stopped and I do not see any listener callbacks with Wired or Bluetooth devices after stop()
has been called. Can you provide code snippet or logs with AudioSwitch.loggingEnabled = true
if you are still experiencing this issue. Regarding null scenario object is retained by the system, reassigning to null
by itself after AudioSwitch is started it is not advisable and AudioSwitch.stop()
should be called to close listeners/receivers and avoid memory leaks. Link
Describe the bug Once the AudioSwitch listener is initialized, the method
audioSwitch.start { audioDevices, selectedAudioDevice -> }
keeps listening for new changes even after theaudioSwitch
instance is nulled oraudioSwitch.stop()
is called.To Reproduce Steps to reproduce the behavior:
audioSwitch
instance via code and then manually reassign it tonull
or callaudioSwitch.stop()
.Expected behavior The
audioSwitch.start { audioDevices, selectedAudioDevice -> }
listener should stop listening for new changes.Actual behavior The
audioSwitch.start { audioDevices, selectedAudioDevice -> }
listener keeps listening for new changes even withaudioSwitch
instance is null.AudioSwitch Version
Android Device (please complete the following information):