This commit is contained in:
Guillaume Beraudo 2011-10-21 14:20:44 +02:00
parent ae6747dbd5
commit 90f97a665a
2 changed files with 20 additions and 23 deletions

View file

@ -516,12 +516,28 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener
stopOrientationSensor();
finishActivity(INCOMING_CALL_ACTIVITY);
}
if (state == LinphoneCall.State.StreamsRunning && Version.isVideoCapable()) {
boolean videoEnabled = call.getCurrentParamsCopy().getVideoEnabled();
boolean videoActivityLaunched = VideoCallActivity.launched;
if (videoEnabled && !videoActivityLaunched
&& getResources().getBoolean(R.bool.autostart_video_activity)
&& getResources().getBoolean(R.bool.use_video_activity)) {
// Do not call if video activity already launched as it would cause a pause() of the launched one
// and a race condition with capture surfaceview leading to a crash
startVideoActivity();
} else if (!videoEnabled) {
finishVideoActivity();
}
}
if (state == LinphoneCall.State.CallUpdatedByRemote && Version.isVideoCapable()) {
if (VideoCallActivity.launched && !call.getCurrentParamsCopy().getVideoEnabled()) {
finishVideoActivity();
}
}
}
}
interface ContactPicked {
void setAddressAndGoToDialer(String number, String name, Uri photo);
}
}

View file

@ -341,25 +341,6 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
startActivity(new Intent()
.setClass(this, LinphoneActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else if (state == LinphoneCall.State.StreamsRunning) {
if (Version.isVideoCapable()
&& getResources().getBoolean(R.bool.autostart_video_activity)
&& getResources().getBoolean(R.bool.use_video_activity)
&& !VideoCallActivity.launched && LinphoneActivity.isInstanciated()
&& call.getCurrentParamsCopy().getVideoEnabled()) {
// Do not call if video activity already launched as it would cause a pause() of the launched one
// and a race condition with capture surfaceview leading to a crash
LinphoneActivity.instance().startVideoActivity();
}
else if (VideoCallActivity.launched && LinphoneActivity.isInstanciated()
&& !call.getCurrentParamsCopy().getVideoEnabled()) {
LinphoneActivity.instance().finishVideoActivity();
}
} else if (state == LinphoneCall.State.CallUpdatedByRemote) {
if (VideoCallActivity.launched && LinphoneActivity.isInstanciated()
&& !call.getCurrentParamsCopy().getVideoEnabled()) {
LinphoneActivity.instance().finishVideoActivity();
}
}
mHandler.post(new Runnable() {