Fix popup of video and zrtp on rotation
This commit is contained in:
parent
ec18a61d3b
commit
b9c768e225
2 changed files with 25 additions and 4 deletions
|
@ -108,7 +108,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
private StatusFragment status;
|
private StatusFragment status;
|
||||||
private CallAudioFragment audioCallFragment;
|
private CallAudioFragment audioCallFragment;
|
||||||
private CallVideoFragment videoCallFragment;
|
private CallVideoFragment videoCallFragment;
|
||||||
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed;
|
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isVideoAsk;
|
||||||
private LinearLayout mControlsLayout;
|
private LinearLayout mControlsLayout;
|
||||||
private Numpad numpad;
|
private Numpad numpad;
|
||||||
private int cameraNumber;
|
private int cameraNumber;
|
||||||
|
@ -258,6 +258,9 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
TimeRemind = savedInstanceState.getLong("TimeRemind");
|
TimeRemind = savedInstanceState.getLong("TimeRemind");
|
||||||
createTimerForDialog(TimeRemind);
|
createTimerForDialog(TimeRemind);
|
||||||
}
|
}
|
||||||
|
if (status != null && savedInstanceState.getBoolean("AskingZrtp")) {
|
||||||
|
status.setisZrtpAsk(savedInstanceState.getBoolean("AskingZrtp"));
|
||||||
|
}
|
||||||
refreshInCallActions();
|
refreshInCallActions();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -313,8 +316,9 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
outState.putBoolean("Speaker", LinphoneManager.getLc().isSpeakerEnabled());
|
outState.putBoolean("Speaker", LinphoneManager.getLc().isSpeakerEnabled());
|
||||||
outState.putBoolean("Mic", LinphoneManager.getLc().isMicMuted());
|
outState.putBoolean("Mic", LinphoneManager.getLc().isMicMuted());
|
||||||
outState.putBoolean("VideoCallPaused", isVideoCallPaused);
|
outState.putBoolean("VideoCallPaused", isVideoCallPaused);
|
||||||
outState.putBoolean("AskingVideo", (dialog != null));
|
outState.putBoolean("AskingVideo", isVideoAsk);
|
||||||
outState.putLong("TimeRemind", TimeRemind);
|
outState.putLong("TimeRemind", TimeRemind);
|
||||||
|
if (status != null) outState.putBoolean("AskingZrtp", status.getisZrtpAsk());
|
||||||
if (dialog != null) dialog.dismiss();
|
if (dialog != null) dialog.dismiss();
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
@ -1122,6 +1126,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
delete.setText(R.string.accept);
|
delete.setText(R.string.accept);
|
||||||
Button cancel = (Button) dialog.findViewById(R.id.cancel);
|
Button cancel = (Button) dialog.findViewById(R.id.cancel);
|
||||||
cancel.setText(R.string.decline);
|
cancel.setText(R.string.decline);
|
||||||
|
isVideoAsk = true;
|
||||||
|
|
||||||
delete.setOnClickListener(new OnClickListener() {
|
delete.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1134,7 +1139,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
} else {
|
} else {
|
||||||
checkAndRequestPermission(Manifest.permission.CAMERA, PERMISSIONS_REQUEST_CAMERA);
|
checkAndRequestPermission(Manifest.permission.CAMERA, PERMISSIONS_REQUEST_CAMERA);
|
||||||
}
|
}
|
||||||
|
isVideoAsk = false;
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
dialog = null;
|
dialog = null;
|
||||||
}
|
}
|
||||||
|
@ -1146,6 +1151,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
if (CallActivity.isInstanciated()) {
|
if (CallActivity.isInstanciated()) {
|
||||||
CallActivity.instance().acceptCallUpdate(false);
|
CallActivity.instance().acceptCallUpdate(false);
|
||||||
}
|
}
|
||||||
|
isVideoAsk = false;
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
dialog = null;
|
dialog = null;
|
||||||
}
|
}
|
||||||
|
@ -1168,6 +1174,10 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
refreshIncallUi();
|
refreshIncallUi();
|
||||||
handleViewIntent();
|
handleViewIntent();
|
||||||
|
|
||||||
|
if (status != null && status.getisZrtpAsk() && lc != null) {
|
||||||
|
status.showZRTPDialog(lc.getCurrentCall());
|
||||||
|
}
|
||||||
|
|
||||||
if (!isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
if (!isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
||||||
LinphoneManager.getInstance().enableProximitySensing(true);
|
LinphoneManager.getInstance().enableProximitySensing(true);
|
||||||
removeCallbacks();
|
removeCallbacks();
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class StatusFragment extends Fragment {
|
||||||
private TextView statusText, voicemailCount;
|
private TextView statusText, voicemailCount;
|
||||||
private ImageView statusLed, callQuality, encryption, menu, voicemail;
|
private ImageView statusLed, callQuality, encryption, menu, voicemail;
|
||||||
private Runnable mCallQualityUpdater;
|
private Runnable mCallQualityUpdater;
|
||||||
private boolean isInCall, isAttached = false;
|
private boolean isInCall, isAttached = false, isZrtpAsk;
|
||||||
private LinphoneCoreListenerBase mListener;
|
private LinphoneCoreListenerBase mListener;
|
||||||
private Dialog ZRTPdialog = null;
|
private Dialog ZRTPdialog = null;
|
||||||
private int mDisplayedQuality = -1;
|
private int mDisplayedQuality = -1;
|
||||||
|
@ -395,6 +395,7 @@ public class StatusFragment extends Fragment {
|
||||||
ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
ZRTPdialog.getWindow().setBackgroundDrawable(d);
|
ZRTPdialog.getWindow().setBackgroundDrawable(d);
|
||||||
String zrtpToRead, zrtpToListen;
|
String zrtpToRead, zrtpToListen;
|
||||||
|
isZrtpAsk = true;
|
||||||
|
|
||||||
if (call.getDirection().equals(CallDirection.Incoming)) {
|
if (call.getDirection().equals(CallDirection.Incoming)) {
|
||||||
zrtpToRead = call.getAuthenticationToken().substring(0,2);
|
zrtpToRead = call.getAuthenticationToken().substring(0,2);
|
||||||
|
@ -420,6 +421,7 @@ public class StatusFragment extends Fragment {
|
||||||
if (encryption != null) {
|
if (encryption != null) {
|
||||||
encryption.setImageResource(R.drawable.security_ok);
|
encryption.setImageResource(R.drawable.security_ok);
|
||||||
}
|
}
|
||||||
|
isZrtpAsk = false;
|
||||||
ZRTPdialog.dismiss();
|
ZRTPdialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -433,10 +435,19 @@ public class StatusFragment extends Fragment {
|
||||||
encryption.setImageResource(R.drawable.security_ko);
|
encryption.setImageResource(R.drawable.security_ko);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
isZrtpAsk = false;
|
||||||
ZRTPdialog.dismiss();
|
ZRTPdialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ZRTPdialog.show();
|
ZRTPdialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getisZrtpAsk() {
|
||||||
|
return isZrtpAsk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setisZrtpAsk(boolean bool) {
|
||||||
|
isZrtpAsk = bool;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue