fix two crashes

This commit is contained in:
Simon Morlat 2012-05-07 16:53:11 +02:00
parent cf1b35025f
commit 62e89d42f2
2 changed files with 9 additions and 5 deletions

View file

@ -452,10 +452,13 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
Log.d("Phone orientation changed to ", degrees);
int rotation = (360 - degrees) % 360;
LinphoneManager.getLc().setDeviceRotation(rotation);
LinphoneCall currentCall = LinphoneManager.getLc().getCurrentCall();
LinphoneCore lc=LinphoneManager.getLcIfManagerNotDestroyedOrNull();
if (lc!=null){
lc.setDeviceRotation(rotation);
LinphoneCall currentCall = lc.getCurrentCall();
if (currentCall != null && currentCall.cameraEnabled() && currentCall.getCurrentParamsCopy().getVideoEnabled()) {
LinphoneManager.getLc().updateCall(currentCall, null);
lc.updateCall(currentCall, null);
}
}
}
}

View file

@ -177,7 +177,8 @@ public class VideoCallActivity extends Activity implements
});
if (!AndroidCameraConfiguration.hasSeveralCameras()) {
findViewById(R.id.switch_camera).setVisibility(View.GONE);
View v=findViewById(R.id.switch_camera);
if (v!=null) v.setVisibility(View.GONE);
}
if (Version.isXLargeScreen(this)) {