Fix Save dialog on call view after a rotation
This commit is contained in:
parent
40ee88eba5
commit
bdb578121f
4 changed files with 51 additions and 31 deletions
|
@ -17,6 +17,7 @@ Group changes to describe their impact on the project, as follows:
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Rotation after screen locking
|
- Rotation after screen locking
|
||||||
|
- Contacts background task
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,8 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
private int cameraNumber;
|
private int cameraNumber;
|
||||||
private CountDownTimer timer;
|
private CountDownTimer timer;
|
||||||
private boolean isVideoCallPaused = false;
|
private boolean isVideoCallPaused = false;
|
||||||
|
private Dialog dialog = null;
|
||||||
|
private static long TimeRemind = 0;
|
||||||
|
|
||||||
private static PowerManager powerManager;
|
private static PowerManager powerManager;
|
||||||
private static PowerManager.WakeLock wakeLock;
|
private static PowerManager.WakeLock wakeLock;
|
||||||
|
@ -225,24 +227,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
boolean autoAcceptCameraPolicy = LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests();
|
boolean autoAcceptCameraPolicy = LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests();
|
||||||
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy && !LinphoneManager.getLc().isInConference()) {
|
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy && !LinphoneManager.getLc().isInConference()) {
|
||||||
showAcceptCallUpdateDialog();
|
showAcceptCallUpdateDialog();
|
||||||
timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) {
|
createTimerForDialog(SECONDS_BEFORE_DENYING_CALL_UPDATE);
|
||||||
public void onTick(long millisUntilFinished) { }
|
|
||||||
public void onFinish() {
|
|
||||||
//TODO dismiss dialog
|
|
||||||
acceptCallUpdate(false);
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
|
|
||||||
/*showAcceptCallUpdateDialog();
|
|
||||||
|
|
||||||
timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) {
|
|
||||||
public void onTick(long millisUntilFinished) { }
|
|
||||||
public void onFinish() {
|
|
||||||
//TODO dismiss dialog
|
|
||||||
|
|
||||||
}
|
|
||||||
}.start();*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// else if (remoteVideo && !LinphoneManager.getLc().isInConference() && autoAcceptCameraPolicy) {
|
// else if (remoteVideo && !LinphoneManager.getLc().isInConference() && autoAcceptCameraPolicy) {
|
||||||
// mHandler.post(new Runnable() {
|
// mHandler.post(new Runnable() {
|
||||||
|
@ -286,6 +271,11 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
isSpeakerEnabled = savedInstanceState.getBoolean("Speaker");
|
isSpeakerEnabled = savedInstanceState.getBoolean("Speaker");
|
||||||
isMicMuted = savedInstanceState.getBoolean("Mic");
|
isMicMuted = savedInstanceState.getBoolean("Mic");
|
||||||
isVideoCallPaused = savedInstanceState.getBoolean("VideoCallPaused");
|
isVideoCallPaused = savedInstanceState.getBoolean("VideoCallPaused");
|
||||||
|
if (savedInstanceState.getBoolean("AskingVideo")) {
|
||||||
|
showAcceptCallUpdateDialog();
|
||||||
|
TimeRemind = savedInstanceState.getLong("TimeRemind");
|
||||||
|
createTimerForDialog(TimeRemind);
|
||||||
|
}
|
||||||
refreshInCallActions();
|
refreshInCallActions();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -314,6 +304,21 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createTimerForDialog(long time) {
|
||||||
|
timer = new CountDownTimer(time , 1000) {
|
||||||
|
public void onTick(long millisUntilFinished) {
|
||||||
|
TimeRemind = millisUntilFinished;
|
||||||
|
}
|
||||||
|
public void onFinish() {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
acceptCallUpdate(false);
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isVideoEnabled(LinphoneCall call) {
|
private boolean isVideoEnabled(LinphoneCall call) {
|
||||||
if(call != null){
|
if(call != null){
|
||||||
return call.getCurrentParamsCopy().getVideoEnabled();
|
return call.getCurrentParamsCopy().getVideoEnabled();
|
||||||
|
@ -326,7 +331,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.putLong("TimeRemind", TimeRemind);
|
||||||
|
if (dialog != null) dialog.dismiss();
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1138,7 +1145,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
|
|
||||||
|
|
||||||
private void showAcceptCallUpdateDialog() {
|
private void showAcceptCallUpdateDialog() {
|
||||||
final Dialog dialog = new Dialog(this);
|
dialog = new Dialog(this);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorC));
|
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorC));
|
||||||
d.setAlpha(200);
|
d.setAlpha(200);
|
||||||
|
@ -1166,6 +1173,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1176,6 +1184,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
CallActivity.instance().acceptCallUpdate(false);
|
CallActivity.instance().acceptCallUpdate(false);
|
||||||
}
|
}
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
dialog = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
@ -1290,6 +1299,16 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override // Never invoke actually
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (dialog != null) {
|
||||||
|
acceptCallUpdate(false);
|
||||||
|
dialog.dismiss();
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public void bindAudioFragment(CallAudioFragment fragment) {
|
public void bindAudioFragment(CallAudioFragment fragment) {
|
||||||
audioCallFragment = fragment;
|
audioCallFragment = fragment;
|
||||||
}
|
}
|
||||||
|
|
|
@ -869,7 +869,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
||||||
missedCalls.setText(missedCallsCount + "");
|
missedCalls.setText(missedCallsCount + "");
|
||||||
missedCalls.setVisibility(View.VISIBLE);
|
missedCalls.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
LinphoneManager.getLc().resetMissedCallsCount();
|
if (LinphoneManager.isInstanciated()) LinphoneManager.getLc().resetMissedCallsCount();
|
||||||
missedCalls.clearAnimation();
|
missedCalls.clearAnimation();
|
||||||
missedCalls.setVisibility(View.GONE);
|
missedCalls.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue