lukeweber / webrtc-jingle-client

Webrtc audio + jingle protocol brought to IOS and Android.
https://groups.google.com/forum/?fromgroups#!forum/webrtc-jingle
BSD 3-Clause "New" or "Revised" License
335 stars 137 forks source link

Missing logic after Java code refactor #54

Open wjwarren opened 11 years ago

wjwarren commented 11 years ago

It seems the refactoring of the Java code by @jreyes removed some logic that used to be in the VoiceClient.

The handleAudioPlayout() callback seems to have disappeared. I believe this method was specifically added to avoid some audio issues on certain devices.

The destroy() method has disappeared as well, @lukeweber added this method to perform some clean up actions when the VoiceClient was no longer needed. Right now when discarding the VoiceClient and setting the different managers (setCallManager, setConnectionManager and setBuddyManager) to null, it seems to be throwing some NullPointerExceptions[1] at a later point.

The other thing I noticed is that the Singleton pattern has been removed from the VoiceClient. I'm not particularly attached to the Singleton pattern, but just curious as to why it has been removed.

[1]

E/AndroidRuntime(11818): java.lang.NullPointerException
E/AndroidRuntime(11818):    at com.tuenti.voice.core.VoiceClient.handleXmppError(VoiceClient.java:194)
E/AndroidRuntime(11818):    at com.tuenti.voice.core.VoiceClient.dispatchNativeEvent(VoiceClient.java:238)
jreyes commented 11 years ago

Added fix for nullpointerexception.

The singleton was removed, because that pattern should be applied to the Application object. There was an error with remote process creating a duplicate VoiceClient in a remote service and in the activities.

lukeweber commented 11 years ago

Merged

wjwarren commented 11 years ago

Thanks for fixing the null pointer issues Johann!

What about the missing handleAudioPlayout() callback?