Fix incoming call dialog destruction on remote hang.
This commit is contained in:
parent
244cae9246
commit
3cebf59104
1 changed files with 14 additions and 4 deletions
|
@ -90,6 +90,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, New
|
||||||
private static final String CURRENT_ADDRESS = "org.linphone.current-address";
|
private static final String CURRENT_ADDRESS = "org.linphone.current-address";
|
||||||
private static final String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
|
private static final String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
|
||||||
|
|
||||||
|
private static final int INCOMING_CALL_DIALOG_ID = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return null if not ready yet
|
* @return null if not ready yet
|
||||||
|
@ -262,6 +263,11 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, New
|
||||||
|
|
||||||
|
|
||||||
private void exitCallMode() {
|
private void exitCallMode() {
|
||||||
|
// Remove dialog if existing
|
||||||
|
try {
|
||||||
|
dismissDialog(INCOMING_CALL_DIALOG_ID);
|
||||||
|
} catch (Throwable e) {/* Exception if never created */}
|
||||||
|
|
||||||
if (useIncallActivity) {
|
if (useIncallActivity) {
|
||||||
LinphoneActivity.instance().closeIncallActivity();
|
LinphoneActivity.instance().closeIncallActivity();
|
||||||
} else {
|
} else {
|
||||||
|
@ -294,6 +300,12 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, New
|
||||||
|
|
||||||
|
|
||||||
private void callPending(final LinphoneCall call) {
|
private void callPending(final LinphoneCall call) {
|
||||||
|
showDialog(INCOMING_CALL_DIALOG_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Dialog onCreateDialog(int id, Bundle b) {
|
||||||
String from = LinphoneManager.getInstance().extractIncomingRemoteName();
|
String from = LinphoneManager.getInstance().extractIncomingRemoteName();
|
||||||
View incomingCallView = getLayoutInflater().inflate(R.layout.incoming_call, null);
|
View incomingCallView = getLayoutInflater().inflate(R.layout.incoming_call, null);
|
||||||
|
|
||||||
|
@ -314,17 +326,15 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, New
|
||||||
boolean videoMuted = !(prefVideoEnable && prefAutoShareMyCamera);
|
boolean videoMuted = !(prefVideoEnable && prefAutoShareMyCamera);
|
||||||
AndroidCameraRecordManager.getInstance().setMuted(videoMuted);
|
AndroidCameraRecordManager.getInstance().setMuted(videoMuted);
|
||||||
|
|
||||||
call.enableCamera(prefAutoShareMyCamera);
|
LinphoneManager.getLc().getCurrentCall().enableCamera(prefAutoShareMyCamera);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
((HangCallButton) incomingCallView.findViewById(R.id.Decline)).setExternalClickListener(new OnClickListener() {
|
((HangCallButton) incomingCallView.findViewById(R.id.Decline)).setExternalClickListener(new OnClickListener() {
|
||||||
public void onClick(View v) {dialog.dismiss();}
|
public void onClick(View v) {dialog.dismiss();}
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue