Permalink
Browse files

fixed freeze bug and internationalized some string constants

  • Loading branch information...
dakhnod committed Aug 11, 2018
1 parent 10c432b commit c8c703b9f5dd87d35647a329e40998455ea26c37
@@ -309,25 +309,28 @@ protected void onDestroy() {
switch (callState) {
case CONNECTING: {
setStatusText("connecting...");
setStatusText(getString(R.string.call_connecting));
break;
}
case CONNECTED: {
new Handler(getMainLooper()).post(() -> findViewById(R.id.videoStreamSwitchLayout).setVisibility(View.VISIBLE));
setStatusText("connected.");
new Handler(getMainLooper()).post( () -> findViewById(R.id.videoStreamSwitchLayout).setVisibility(View.VISIBLE));
setStatusText(getString(R.string.call_connected));
break;
}
case DISMISSED: {
//setStatusText("dismissed");
stopDelayed("call denied");
stopDelayed(getString(R.string.call_denied));
break;
}
case RINGING: {
setStatusText("ringing...");
setStatusText(getString(R.string.call_ringing));
break;
}
case ENDED: {
stopDelayed("call ended");
stopDelayed(getString(R.string.call_ended));
break;
}
case ERROR: {
stopDelayed(getString(R.string.call_error));
break;
}
}
@@ -336,17 +339,21 @@ protected void onDestroy() {
private RTCCall.OnStateChangeListener passiveCallback = callState -> {
switch (callState) {
case CONNECTED: {
setStatusText("connected.");
setStatusText(getString(R.string.call_connected));
runOnUiThread(() -> findViewById(R.id.callAccept).setVisibility(View.GONE));
new Handler(getMainLooper()).post(() -> findViewById(R.id.videoStreamSwitchLayout).setVisibility(View.VISIBLE));
break;
}
case RINGING: {
setStatusText("calling...");
setStatusText(getString(R.string.call_ringing));
break;
}
case ENDED: {
stopDelayed("call ended");
stopDelayed(getString(R.string.call_ended));
break;
}
case ERROR: {
stopDelayed(getString(R.string.call_error));
break;
}
}
@@ -428,7 +428,7 @@ public void decline() {
}
public void cleanup(){
if(this.upStream != null){
if(this.upStream != null && state == CallState.CONNECTED){
/*for(AudioTrack track : this.upStream.audioTracks){
track.setEnabled(false);
track.dispose();
@@ -437,6 +437,13 @@ public void cleanup(){
if(this.connection != null) this.connection.close();
//factory.dispose();
}
if(commSocket != null){
try {
commSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void hangUp() {
@@ -24,4 +24,9 @@
<string name="permission_mic">Dafür muss die App auf das Mikro zugreifen können.</string>
<string name="hello">Hallo!</string>
<string name="settings_ignore_unsaved">Ungespeicherte ignorieren</string>
<string name="call_connected">Verbunden</string>
<string name="call_denied">Abgelehnt</string>
<string name="call_ringing">klingelt...</string>
<string name="call_ended">beendet</string>
<string name="call_error">Verbindungsfehler</string>
</resources>

This file was deleted.

Oops, something went wrong.
@@ -27,4 +27,9 @@
<string name="permission_mic">Microphone permission needed to make calls</string>
<string name="hello">Hello!</string>
<string name="settings_ignore_unsaved">Ignore unsaved</string>
<string name="call_connected">Connected.</string>
<string name="call_denied">Declined</string>
<string name="call_ringing">ringing...</string>
<string name="call_ended">call ended</string>
<string name="call_error">error</string>
</resources>

0 comments on commit c8c703b

Please sign in to comment.