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