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();
String sipUri = extras.getString("ChatContactSipUri");
displayChat(sipUri);
} else if (extras != null && extras.getBoolean("Notification", false)) {
}
else if (extras != null && extras.getBoolean("Notification", false)) {
if (LinphoneManager.getLc().getCallsNb() > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call.getCurrentParamsCopy().getVideoEnabled()) {
@ -1237,6 +1238,14 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
if (dialerFragment != null) {
((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) {
contact = c;
sipUri = a;
// Empty constructor required for DialogFragment
}
@Override

View file

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