Return to call view when using notif or app launcher if call is established

This commit is contained in:
Sylvain Berfini 2012-10-10 14:33:00 +02:00
parent e1aab3c954
commit a1bedb2b63
2 changed files with 18 additions and 8 deletions

View file

@ -1223,7 +1223,8 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
LinphoneService.instance().removeMessageNotification(); LinphoneService.instance().removeMessageNotification();
String sipUri = extras.getString("ChatContactSipUri"); String sipUri = extras.getString("ChatContactSipUri");
displayChat(sipUri); displayChat(sipUri);
} else if (extras != null && extras.getBoolean("Notification", false)) { }
else if (extras != null && extras.getBoolean("Notification", false)) {
if (LinphoneManager.getLc().getCallsNb() > 0) { if (LinphoneManager.getLc().getCallsNb() > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call.getCurrentParamsCopy().getVideoEnabled()) { if (call.getCurrentParamsCopy().getVideoEnabled()) {
@ -1237,6 +1238,14 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
if (dialerFragment != null) { if (dialerFragment != null) {
((DialerFragment) dialerFragment).newOutgoingCall(intent); ((DialerFragment) dialerFragment).newOutgoingCall(intent);
} }
if (LinphoneManager.getLc().getCalls().length > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
} else {
startIncallActivity(call);
}
}
} }
} }
@ -1273,7 +1282,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
public AcceptNewFriendDialog(Contact c, String a) { public AcceptNewFriendDialog(Contact c, String a) {
contact = c; contact = c;
sipUri = a; sipUri = a;
// Empty constructor required for DialogFragment
} }
@Override @Override

View file

@ -492,14 +492,16 @@ public class StatusFragment extends Fragment {
final LinphoneCallParams params = call.getCurrentParamsCopy(); final LinphoneCallParams params = call.getCurrentParamsCopy();
if (params.getVideoEnabled()) { if (params.getVideoEnabled()) {
final LinphoneCallStats videoStats = call.getVideoStats(); final LinphoneCallStats videoStats = call.getVideoStats();
if (videoStats != null) { final LinphoneCallStats audioStats = call.getAudioStats();
if (videoStats != null && audioStats != null) {
title.setText("Video"); title.setText("Video");
PayloadType payload = params.getUsedVideoCodec(); PayloadType payloadAudio = params.getUsedAudioCodec();
if (payload != null) { PayloadType payloadVideo = params.getUsedVideoCodec();
codec.setText(payload.getMime()); if (payloadVideo != null && payloadAudio != null) {
codec.setText(payloadVideo.getMime() + " / " + payloadAudio.getMime());
} }
dl.setText(String.valueOf((int) videoStats.getDownloadBandwidth()) + " kbits/s"); dl.setText(String.valueOf((int) videoStats.getDownloadBandwidth()) + " / " + (int) audioStats.getDownloadBandwidth() + " kbits/s");
ul.setText(String.valueOf((int) videoStats.getUploadBandwidth()) + " kbits/s"); ul.setText(String.valueOf((int) videoStats.getUploadBandwidth()) + " / " + (int) audioStats.getUploadBandwidth() + " kbits/s");
ice.setText(videoStats.getIceState().toString()); ice.setText(videoStats.getIceState().toString());
} }
} else { } else {