| | |
| | | import com.hdl.hdllinphonesdk.utils.HDLLog; |
| | | |
| | | import org.linphone.core.Call; |
| | | import org.linphone.core.CallParams; |
| | | import org.linphone.core.Core; |
| | | import org.linphone.core.CoreListenerStub; |
| | | |
| | |
| | | |
| | | //Linphone |
| | | private CoreListenerStub mCoreListener; |
| | | private boolean enableVideo = false; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | */ |
| | | private void onClickUnlock() { |
| | | try { |
| | | AlertDialog.Builder builder = new AlertDialog.Builder(this,R.style.CustomAlertDialog); |
| | | AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomAlertDialog); |
| | | builder.setTitle(R.string.lp_tipStr); |
| | | builder.setMessage(R.string.tip_confirm_unlock); |
| | | |
| | |
| | | |
| | | AlertDialog dialog = builder.create(); |
| | | dialog.show(); |
| | | }catch (Exception exception){ |
| | | Log.e(TAG, exception.getMessage()); |
| | | } catch (Exception exception) { |
| | | Log.e(TAG, exception.getMessage()); |
| | | } |
| | | |
| | | } |
| | |
| | | // Once call is finished (end state), terminate the activity |
| | | // We also check for released state (called a few seconds later) just in case |
| | | // we missed the first one |
| | | enableVideo = false; |
| | | showToast(getString(R.string.lp_endMonitoringStr)); |
| | | finish(); |
| | | } else if (state == Call.State.StreamsRunning) { |
| | | if (HDLLinphoneKit.getInstance().getIntercomeType().equals(HDLLinphoneKit.INTER_PHONE_TYPE_HDL)) { |
| | | if (!enableVideo) { |
| | | enableVideo(core, call); |
| | | enableVideo = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | } |
| | | } |
| | | |
| | | void enableVideo(Core core, Call call) { |
| | | // Call currentCall = HDLLinphoneService.getCore().getCurrentCall(); |
| | | |
| | | CallParams params = call.getCurrentParams(); |
| | | if (params == null) { |
| | | params = core.createCallParams(call); |
| | | } |
| | | params.enableVideo(true); |
| | | params.enableLowBandwidth(false); |
| | | params.setAudioBandwidthLimit(0); // disable limitation |
| | | |
| | | call.update(params); |
| | | } |
| | | |
| | | /** |
| | | * onDestroyLinphone |
| | | */ |