Wifi only fixed + call transfer
This commit is contained in:
parent
929dc5c773
commit
583855ceca
18 changed files with 245 additions and 228 deletions
BIN
res/drawable-hdpi/transfer_call_default.png
Normal file
BIN
res/drawable-hdpi/transfer_call_default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
BIN
res/drawable-hdpi/transfer_call_disabled.png
Normal file
BIN
res/drawable-hdpi/transfer_call_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
BIN
res/drawable-hdpi/transfer_call_over.png
Normal file
BIN
res/drawable-hdpi/transfer_call_over.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
BIN
res/drawable-mdpi/transfer_call_default.png
Normal file
BIN
res/drawable-mdpi/transfer_call_default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
BIN
res/drawable-mdpi/transfer_call_disabled.png
Normal file
BIN
res/drawable-mdpi/transfer_call_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
res/drawable-mdpi/transfer_call_over.png
Normal file
BIN
res/drawable-mdpi/transfer_call_over.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
9
res/drawable/transfer_call.xml
Normal file
9
res/drawable/transfer_call.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/transfer_call_over" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/transfer_call_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/transfer_call_default" />
|
||||
</selector>
|
|
@ -13,6 +13,7 @@
|
|||
android:textSize="22dp"
|
||||
android:background="@drawable/dialer_address_background"
|
||||
android:inputType="textEmailAddress"
|
||||
android:hint="@string/addressHint"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:layout_weight="0.4"
|
||||
|
|
|
@ -166,153 +166,157 @@
|
|||
<string name="pref_codec_g729">g729</string>
|
||||
<string name="pref_codecs">Codecs</string>
|
||||
<string name="place_call_chooser">Place a call</string>
|
||||
<string name="pref_debug">Debug</string>
|
||||
<string name="about_report_issue">Report issue</string>
|
||||
<string name="about_bugreport_email_text">Describe problem here</string>
|
||||
<string name="about_error_generating_bugreport_attachement">Error generating bug report</string>
|
||||
<string name="about_logs_not_found">Logs not found.</string>
|
||||
<string name="about_reading_logs">Reading logs, may takes time...</string>
|
||||
<string name="about_mailer_chooser_text">Send bug report with...</string>
|
||||
<string name="menu_about">About</string>
|
||||
<string name="pref_audio">Audio</string>
|
||||
<string name="menu_exit">Exit</string>
|
||||
<string name="pref_prefix">Prefix</string>
|
||||
<string name="pref_advanced">Advanced</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
<string name="pref_proxy">Proxy</string>
|
||||
<string name="pref_domain">Domain*</string>
|
||||
<string name="pref_passwd">Password*</string>
|
||||
<string name="pref_username">Username*</string>
|
||||
<string name="hello">Hello World, Linphone!</string>
|
||||
<string name="pref_sipaccount">SIP Account</string>
|
||||
<string name="wrong_username">wrong user name</string>
|
||||
<string name="wrong_passwd">wrong password</string>
|
||||
<string name="wrong_domain">Wrong domain</string>
|
||||
<string name="wrong_settings">Wrong settings</string>
|
||||
<string name="tab_dialer">Dialer</string>
|
||||
<string name="tab_contact">Contact</string>
|
||||
<string name="call_error">Cannot call %s</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="dismiss">Dismiss</string>
|
||||
<string name="cont">Continue</string>
|
||||
<string name="never_remind">Never remind me</string>
|
||||
<string name="config_error">%s, do you want to go to the settings page ?</string>
|
||||
<string name="initial_config_error"><P ALIGN=CENTER>No SIP account has been configured yet, do you want to go to the settings page ?<br/><br/> Need help ?<br/> "http://www.linphone.org/m/help"</p></string>
|
||||
<string name="first_launch_message"><P ALIGN=CENTER>Welcome to Linphone SIP phone<br/><br/> If you are new to SIP, have a look at<br/> "http://www.linphone.org/m/help"</p> </string>
|
||||
<string name="ec_calibration_launch_message">Starting echo cancelation audio calibration </string>
|
||||
<string name="warning_already_incall">Cannot initiate a new call because a call is already engaged</string>
|
||||
<string name="tab_history">History</string>
|
||||
<string name="warning_wrong_destination_address">Cannot build destination address from [%s]</string>
|
||||
<string name="menu_clear_history">Clear</string>
|
||||
<string name="error_cannot_get_call_parameters">Cannot get call parameters</string>
|
||||
<string name="error_cannot_create_default_parameters">Cannot create default call parameters</string>
|
||||
<string name="error_cannot_invite_address">Cannot invite destination address [%s]</string>
|
||||
|
||||
<string name="notification_started">started</string>
|
||||
<string name="pref_echo_cancellation_summary">Removes the echo heard by other end (not recommended)</string>
|
||||
<string name="pref_echo_limiter_summary">Removes the echo heard by other end (brute force method)</string>
|
||||
<string name="pref_stun_server">Stun server</string>
|
||||
<string name="ec_calibrating">Calibrating...</string>
|
||||
<string name="ec_calibrated">Calibrated [%s ms]</string>
|
||||
<string name="failed">failed</string>
|
||||
<string name="first_login_explanation">Enter your username and password to connect to the service.</string>
|
||||
<string name="first_login_username">Username</string>
|
||||
<string name="first_login_password">Password</string>
|
||||
<string name="first_login_connect">Connect</string>
|
||||
<string name="first_launch_no_login_password">Please enter your login and password</string>
|
||||
<string name="first_launch_bad_login_password">Couldn\'t connect; check your login and password and start again</string>
|
||||
|
||||
<string name="pref_amr_summary">AMR codec might not be present on your phone</string>
|
||||
<string name="pref_video_codec_vp8_title">VP8</string>
|
||||
<string name="pref_media_encryption">Media encryption</string>
|
||||
<string name="media_encryption_none">None</string>
|
||||
<string name="media_encryption_srtp">SRTP</string>
|
||||
<string name="media_encryption_zrtp">ZRTP</string>
|
||||
|
||||
<string name="dynamic_video_asking">Your correspondent would like to switch to video</string>
|
||||
<string name="dynamic_video_accept">Accept video</string>
|
||||
<string name="dynamic_video_deny">Deny video</string>
|
||||
|
||||
<string name="pref_extra_accounts">pref_nb_accounts_extra</string>
|
||||
<string name="pref_default_account">pref_default_account</string>
|
||||
<string name="pref_sipaccounts">SIP Accounts</string>
|
||||
|
||||
<string name="pref_wifi_only">Use wifi only</string>
|
||||
|
||||
<string name="wizard_failed">An error occurred, try again later.</string>
|
||||
<string name="wizard_server_unavailable">Server unreachable, verify your internet connection.</string>
|
||||
<string name="wizard_username_unavailable">This username is already in use.</string>
|
||||
<string name="wizard_username_incorrect">Your username is not valid.</string>
|
||||
<string name="wizard_email_incorrect">Your email is not valid.</string>
|
||||
<string name="wizard_password_incorrect">Your password is not valid (6 characters min).</string>
|
||||
<string name="wizard_passwords_unmatched">Passwords entered are different.</string>
|
||||
|
||||
<string name="pref_help_proxy">SIP proxy hostname or ip address (optional)</string>
|
||||
<string name="pref_help_outbound_proxy">Route all calls through SIP proxy</string>
|
||||
<string name="pref_help_username">Example: john if your account is john@sip.linphone.org</string>
|
||||
<string name="pref_help_domain">sip.linphone.org if your account is john@sip.linphone.org</string>
|
||||
|
||||
<string name="delete">Delete</string>
|
||||
<string name="chat">Chat</string>
|
||||
<string name="call">Call</string>
|
||||
<string name="add_to_contacts">Add to contacts</string>
|
||||
<string name="status_connected">CONNECTED</string>
|
||||
<string name="status_not_connected">NOT CONNECTED</string>
|
||||
<string name="status_in_progress">CONNECTING</string>
|
||||
<string name="status_error">ERROR</string>
|
||||
|
||||
<!-- Used by Android to help blind people by describing them images -->
|
||||
<string name="content_description_add_contact">Add to contacts button</string>
|
||||
<string name="content_description_chat"></string>
|
||||
<string name="content_description_dial_back"></string>
|
||||
<string name="content_description_contact_picture"></string>
|
||||
<string name="content_description_send_message"></string>
|
||||
<string name="content_description_detail"></string>
|
||||
<string name="content_description_delete"></string>
|
||||
<string name="content_description_new_discussion"></string>
|
||||
<string name="content_description_edit"></string>
|
||||
<string name="content_description_validate"></string>
|
||||
<string name="content_description_all_contacts"></string>
|
||||
<string name="content_description_linphone_contacts"></string>
|
||||
<string name="content_description_call_direction"></string>
|
||||
<string name="content_description_all_calls"></string>
|
||||
<string name="content_description_missed_calls"></string>
|
||||
<string name="content_description_switch_video"></string>
|
||||
<string name="content_description_toggle_speaker"></string>
|
||||
<string name="content_description_toggle_micro"></string>
|
||||
<string name="content_description_add_call"></string>
|
||||
<string name="content_description_pause"></string>
|
||||
<string name="content_description_hang_up"></string>
|
||||
<string name="content_description_numpad"></string>
|
||||
<string name="content_description_settings"></string>
|
||||
<string name="content_description_dialer"></string>
|
||||
<string name="content_description_history"></string>
|
||||
<string name="content_description_contacts"></string>
|
||||
<string name="content_description_led"></string>
|
||||
<string name="content_description_call_quality"></string>
|
||||
<string name="content_description_encryption"></string>
|
||||
<string name="content_description_switch_camera"></string>
|
||||
<string name="content_description_welcome"></string>
|
||||
<string name="content_description_cancel"></string>
|
||||
<string name="content_description_next"></string>
|
||||
<string name="content_description_back"></string>
|
||||
|
||||
<string name="setup_title">Account Setup Assistant</string>
|
||||
<string name="setup_welcome">This assistant will help you to use a SIP account for your calls.</string>
|
||||
<string name="setup_create_account">Create an account on linphone.org</string>
|
||||
<string name="setup_login_linphone">I already have a linphone.org account</string>
|
||||
<string name="setup_login_generic">I already have a SIP account</string>
|
||||
<string name="setup_linphone_account_hint">Enter your linphone.org username and password</string>
|
||||
<string name="setup_apply">Apply</string>
|
||||
<string name="setup_username_hint">username</string>
|
||||
<string name="setup_password_hint">password</string>
|
||||
<string name="setup_domain_hint">domain</string>
|
||||
<string name="setup_password_confirm_hint">confirm password</string>
|
||||
<string name="setup_email_hint">email</string>
|
||||
<string name="setup_create">Create Account</string>
|
||||
<string name="setup_validate_account">An email has been sent to the address you gave. In order to activate your account, you need to click on the link inside it. Once it is done, come back here and click on the button above.</string>
|
||||
<string name="setup_check_account_validation">Check</string>
|
||||
<string name="setup_account_not_validated">Your account has not been validated yet.</string>
|
||||
<string name="setup_account_validated">Your account has been validated.</string>
|
||||
|
||||
<string name="pref_debug">Debug</string>
|
||||
<string name="about_report_issue">Report issue</string>
|
||||
<string name="about_bugreport_email_text">Describe problem here</string>
|
||||
<string name="about_error_generating_bugreport_attachement">Error generating bug report</string>
|
||||
<string name="about_logs_not_found">Logs not found.</string>
|
||||
<string name="about_reading_logs">Reading logs, may takes time...</string>
|
||||
<string name="about_mailer_chooser_text">Send bug report with...</string>
|
||||
<string name="menu_about">About</string>
|
||||
<string name="pref_audio">Audio</string>
|
||||
<string name="menu_exit">Exit</string>
|
||||
<string name="pref_prefix">Prefix</string>
|
||||
<string name="pref_advanced">Advanced</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
<string name="pref_proxy">Proxy</string>
|
||||
<string name="pref_domain">Domain*</string>
|
||||
<string name="pref_passwd">Password*</string>
|
||||
<string name="pref_username">Username*</string>
|
||||
<string name="hello">Hello World, Linphone!</string>
|
||||
<string name="pref_sipaccount">SIP Account</string>
|
||||
<string name="wrong_username">wrong user name</string>
|
||||
<string name="wrong_passwd">wrong password</string>
|
||||
<string name="wrong_domain">Wrong domain</string>
|
||||
<string name="wrong_settings">Wrong settings</string>
|
||||
<string name="tab_dialer">Dialer</string>
|
||||
<string name="tab_contact">Contact</string>
|
||||
<string name="call_error">Cannot call %s</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="dismiss">Dismiss</string>
|
||||
<string name="cont">Continue</string>
|
||||
<string name="never_remind">Never remind me</string>
|
||||
<string name="config_error">%s, do you want to go to the settings page ?</string>
|
||||
<string name="initial_config_error"><P ALIGN=CENTER>No SIP account has been configured yet, do you want to go to the settings page ?<br/><br/> Need help ?<br/> "http://www.linphone.org/m/help"</p></string>
|
||||
<string name="first_launch_message"><P ALIGN=CENTER>Welcome to Linphone SIP phone<br/><br/> If you are new to SIP, have a look at<br/> "http://www.linphone.org/m/help"</p> </string>
|
||||
<string name="ec_calibration_launch_message">Starting echo cancelation audio calibration </string>
|
||||
<string name="warning_already_incall">Cannot initiate a new call because a call is already engaged</string>
|
||||
<string name="tab_history">History</string>
|
||||
<string name="warning_wrong_destination_address">Cannot build destination address from [%s]</string>
|
||||
<string name="menu_clear_history">Clear</string>
|
||||
<string name="error_cannot_get_call_parameters">Cannot get call parameters</string>
|
||||
<string name="error_cannot_create_default_parameters">Cannot create default call parameters</string>
|
||||
<string name="error_cannot_invite_address">Cannot invite destination address [%s]</string>
|
||||
|
||||
<string name="notification_started">started</string>
|
||||
<string name="pref_echo_cancellation_summary">Removes the echo heard by other end (not recommended)</string>
|
||||
<string name="pref_echo_limiter_summary">Removes the echo heard by other end (brute force method)</string>
|
||||
<string name="pref_stun_server">Stun server</string>
|
||||
<string name="ec_calibrating">Calibrating...</string>
|
||||
<string name="ec_calibrated">Calibrated [%s ms]</string>
|
||||
<string name="failed">failed</string>
|
||||
<string name="first_login_explanation">Enter your username and password to connect to the service.</string>
|
||||
<string name="first_login_username">Username</string>
|
||||
<string name="first_login_password">Password</string>
|
||||
<string name="first_login_connect">Connect</string>
|
||||
<string name="first_launch_no_login_password">Please enter your login and password</string>
|
||||
<string name="first_launch_bad_login_password">Couldn\'t connect; check your login and password and start again</string>
|
||||
|
||||
<string name="pref_amr_summary">AMR codec might not be present on your phone</string>
|
||||
<string name="pref_video_codec_vp8_title">VP8</string>
|
||||
<string name="pref_media_encryption">Media encryption</string>
|
||||
<string name="media_encryption_none">None</string>
|
||||
<string name="media_encryption_srtp">SRTP</string>
|
||||
<string name="media_encryption_zrtp">ZRTP</string>
|
||||
|
||||
<string name="dynamic_video_asking">Your correspondent would like to switch to video</string>
|
||||
<string name="dynamic_video_accept">Accept video</string>
|
||||
<string name="dynamic_video_deny">Deny video</string>
|
||||
|
||||
<string name="pref_extra_accounts">pref_nb_accounts_extra</string>
|
||||
<string name="pref_default_account">pref_default_account</string>
|
||||
<string name="pref_sipaccounts">SIP Accounts</string>
|
||||
|
||||
<string name="pref_wifi_only">Use wifi only</string>
|
||||
|
||||
<string name="wizard_failed">An error occurred, try again later.</string>
|
||||
<string name="wizard_server_unavailable">Server unreachable, verify your internet connection.</string>
|
||||
<string name="wizard_username_unavailable">This username is already in use.</string>
|
||||
<string name="wizard_username_incorrect">Your username is not valid.</string>
|
||||
<string name="wizard_email_incorrect">Your email is not valid.</string>
|
||||
<string name="wizard_password_incorrect">Your password is not valid (6 characters min).</string>
|
||||
<string name="wizard_passwords_unmatched">Passwords entered are different.</string>
|
||||
|
||||
<string name="pref_help_proxy">SIP proxy hostname or ip address (optional)</string>
|
||||
<string name="pref_help_outbound_proxy">Route all calls through SIP proxy</string>
|
||||
<string name="pref_help_username">Example: john if your account is john@sip.linphone.org</string>
|
||||
<string name="pref_help_domain">sip.linphone.org if your account is john@sip.linphone.org</string>
|
||||
|
||||
<string name="delete">Delete</string>
|
||||
<string name="chat">Chat</string>
|
||||
<string name="call">Call</string>
|
||||
<string name="add_to_contacts">Add to contacts</string>
|
||||
<string name="status_connected">CONNECTED</string>
|
||||
<string name="status_not_connected">NOT CONNECTED</string>
|
||||
<string name="status_in_progress">CONNECTING</string>
|
||||
<string name="status_error">ERROR</string>
|
||||
|
||||
<string name="addressHint">Number or adress</string>
|
||||
|
||||
<!-- Used by Android to help blind people by describing them images -->
|
||||
<string name="content_description_add_contact">Add to contacts button</string>
|
||||
<string name="content_description_chat"></string>
|
||||
<string name="content_description_dial_back"></string>
|
||||
<string name="content_description_contact_picture"></string>
|
||||
<string name="content_description_send_message"></string>
|
||||
<string name="content_description_detail"></string>
|
||||
<string name="content_description_delete"></string>
|
||||
<string name="content_description_new_discussion"></string>
|
||||
<string name="content_description_edit"></string>
|
||||
<string name="content_description_validate"></string>
|
||||
<string name="content_description_all_contacts"></string>
|
||||
<string name="content_description_linphone_contacts"></string>
|
||||
<string name="content_description_call_direction"></string>
|
||||
<string name="content_description_all_calls"></string>
|
||||
<string name="content_description_missed_calls"></string>
|
||||
<string name="content_description_switch_video"></string>
|
||||
<string name="content_description_toggle_speaker"></string>
|
||||
<string name="content_description_toggle_micro"></string>
|
||||
<string name="content_description_add_call"></string>
|
||||
<string name="content_description_pause"></string>
|
||||
<string name="content_description_hang_up"></string>
|
||||
<string name="content_description_numpad"></string>
|
||||
<string name="content_description_settings"></string>
|
||||
<string name="content_description_dialer"></string>
|
||||
<string name="content_description_history"></string>
|
||||
<string name="content_description_contacts"></string>
|
||||
<string name="content_description_led"></string>
|
||||
<string name="content_description_call_quality"></string>
|
||||
<string name="content_description_encryption"></string>
|
||||
<string name="content_description_switch_camera"></string>
|
||||
<string name="content_description_welcome"></string>
|
||||
<string name="content_description_cancel"></string>
|
||||
<string name="content_description_next"></string>
|
||||
<string name="content_description_back"></string>
|
||||
|
||||
<string name="setup_title">Account Setup Assistant</string>
|
||||
<string name="setup_welcome">This assistant will help you to use a SIP account for your calls.</string>
|
||||
<string name="setup_create_account">Create an account on linphone.org</string>
|
||||
<string name="setup_login_linphone">I already have a linphone.org account</string>
|
||||
<string name="setup_login_generic">I already have a SIP account</string>
|
||||
<string name="setup_linphone_account_hint">Enter your linphone.org username and password</string>
|
||||
<string name="setup_apply">Apply</string>
|
||||
<string name="setup_username_hint">username</string>
|
||||
<string name="setup_password_hint">password</string>
|
||||
<string name="setup_domain_hint">domain</string>
|
||||
<string name="setup_password_confirm_hint">confirm password</string>
|
||||
<string name="setup_email_hint">email</string>
|
||||
<string name="setup_create">Create Account</string>
|
||||
<string name="setup_validate_account">An email has been sent to the address you gave. In order to activate your account, you need to click on the link inside it. Once it is done, come back here and click on the button above.</string>
|
||||
<string name="setup_check_account_validation">Check</string>
|
||||
<string name="setup_account_not_validated">Your account has not been validated yet.</string>
|
||||
<string name="setup_account_validated">Your account has been validated.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.ui.AddressAware;
|
||||
import org.linphone.ui.AddressText;
|
||||
import org.linphone.ui.CallButton;
|
||||
|
@ -39,11 +40,13 @@ import android.widget.ImageView;
|
|||
*/
|
||||
public class DialerFragment extends Fragment {
|
||||
private static DialerFragment instance;
|
||||
private static boolean isCallTransferOngoing = false;
|
||||
|
||||
public boolean mVisible;
|
||||
private AddressText mAddress;
|
||||
private CallButton mCall;
|
||||
private ImageView mAddContact;
|
||||
private OnClickListener addContactListener, cancelListener;
|
||||
private OnClickListener addContactListener, cancelListener, transferListener;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
|
@ -59,7 +62,11 @@ public class DialerFragment extends Fragment {
|
|||
mCall = (CallButton) view.findViewById(R.id.Call);
|
||||
mCall.setAddressWidget(mAddress);
|
||||
if (LinphoneActivity.isInstanciated() && LinphoneManager.getLc().getCallsNb() > 0) {
|
||||
mCall.setImageResource(R.drawable.plus);
|
||||
if (isCallTransferOngoing) {
|
||||
mCall.setImageResource(R.drawable.transfer_call);
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.add_call);
|
||||
}
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.call);
|
||||
}
|
||||
|
@ -69,6 +76,7 @@ public class DialerFragment extends Fragment {
|
|||
numpad.setAddressWidget(mAddress);
|
||||
|
||||
mAddContact = (ImageView) view.findViewById(R.id.addContact);
|
||||
|
||||
addContactListener = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -82,8 +90,21 @@ public class DialerFragment extends Fragment {
|
|||
LinphoneActivity.instance().resetClassicMenuLayoutAndGoBackToCallIfStillRunning();
|
||||
}
|
||||
};
|
||||
transferListener = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LinphoneCore lc = LinphoneManager.getLc();
|
||||
if (lc.getCurrentCall() == null) {
|
||||
return;
|
||||
}
|
||||
lc.transferCall(lc.getCurrentCall(), mAddress.getText().toString());
|
||||
isCallTransferOngoing = false;
|
||||
LinphoneActivity.instance().resetClassicMenuLayoutAndGoBackToCallIfStillRunning();
|
||||
}
|
||||
};
|
||||
|
||||
mAddContact.setEnabled(!(LinphoneActivity.isInstanciated() && LinphoneManager.getLc().getCallsNb() > 0));
|
||||
resetLayout();
|
||||
resetLayout(isCallTransferOngoing);
|
||||
|
||||
if (getArguments() != null) {
|
||||
String number = getArguments().getString("SipUri");
|
||||
|
@ -123,17 +144,24 @@ public class DialerFragment extends Fragment {
|
|||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.DIALER);
|
||||
LinphoneActivity.instance().updateDialerFragment(this);
|
||||
}
|
||||
resetLayout();
|
||||
resetLayout(isCallTransferOngoing);
|
||||
}
|
||||
|
||||
public void resetLayout() {
|
||||
public void resetLayout(boolean callTransfer) {
|
||||
isCallTransferOngoing = callTransfer;
|
||||
if (LinphoneManager.getLc() != null && LinphoneManager.getLc().getCallsNb() > 0) {
|
||||
mCall.setImageResource(R.drawable.plus);
|
||||
mAddress.setText("");
|
||||
if (isCallTransferOngoing) {
|
||||
mCall.setImageResource(R.drawable.transfer_call);
|
||||
mCall.setExternalClickListener(transferListener);
|
||||
} else {
|
||||
mCall.setImageResource(R.drawable.add_call);
|
||||
mCall.resetClickListener();
|
||||
}
|
||||
mAddContact.setEnabled(true);
|
||||
mAddContact.setImageResource(R.drawable.cancel);
|
||||
mAddContact.setOnClickListener(cancelListener);
|
||||
} else {
|
||||
mAddress.setText("");
|
||||
mCall.setImageResource(R.drawable.call);
|
||||
mAddContact.setEnabled(true);
|
||||
mAddContact.setImageResource(R.drawable.add_contact);
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
|||
import org.linphone.ui.Numpad;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
@ -242,7 +243,7 @@ public class InCallActivity extends FragmentActivity implements
|
|||
}
|
||||
}
|
||||
else if (id == R.id.transfer) {
|
||||
//TODO Call Transfer
|
||||
goBackToDialerAndDisplayTransferButton();
|
||||
}
|
||||
else if (id == R.id.options) {
|
||||
hideOrDisplayCallOptions();
|
||||
|
@ -579,11 +580,21 @@ public class InCallActivity extends FragmentActivity implements
|
|||
}
|
||||
addCall.startAnimation(anim);
|
||||
}
|
||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||
}
|
||||
}
|
||||
|
||||
public void goBackToDialer() {
|
||||
setResult(Activity.RESULT_FIRST_USER);
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("Transfer", false);
|
||||
setResult(Activity.RESULT_FIRST_USER, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
private void goBackToDialerAndDisplayTransferButton() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("Transfer", true);
|
||||
setResult(Activity.RESULT_FIRST_USER, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
@ -614,6 +625,8 @@ public class InCallActivity extends FragmentActivity implements
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -595,7 +595,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
AddressType address = new AddressText(this, null);
|
||||
address.setDisplayedName(name);
|
||||
address.setText(number);
|
||||
LinphoneManager.getInstance().newOutgoingCall(address);
|
||||
if (LinphoneManager.getLc().getCallsNb() == 0) {
|
||||
LinphoneManager.getInstance().newOutgoingCall(address);
|
||||
}
|
||||
}
|
||||
|
||||
public void setAddressAndGoToDialer(String number) {
|
||||
|
@ -726,10 +728,10 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
contactsHandler.start();
|
||||
}
|
||||
|
||||
private void initInCallMenuLayout() {
|
||||
private void initInCallMenuLayout(boolean callTransfer) {
|
||||
selectMenu(FragmentsAvailable.DIALER);
|
||||
if (dialerFragment != null) {
|
||||
((DialerFragment) dialerFragment).resetLayout();
|
||||
((DialerFragment) dialerFragment).resetLayout(callTransfer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -738,7 +740,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
@Override
|
||||
public void run() {
|
||||
if (dialerFragment != null) {
|
||||
((DialerFragment) dialerFragment).resetLayout();
|
||||
((DialerFragment) dialerFragment).resetLayout(false);
|
||||
}
|
||||
|
||||
if (LinphoneManager.getLc().getCallsNb() > 0) {
|
||||
|
@ -781,8 +783,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
}
|
||||
else if (requestCode == callActivity) {
|
||||
boolean callTransfer = data == null ? false : data.getBooleanExtra("Transfer", false);
|
||||
if (LinphoneManager.getLc().getCallsNb() > 0) {
|
||||
initInCallMenuLayout();
|
||||
initInCallMenuLayout(callTransfer);
|
||||
} else {
|
||||
resetClassicMenuLayoutAndGoBackToCallIfStillRunning();
|
||||
}
|
||||
|
|
|
@ -692,7 +692,13 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
|
||||
//init network state
|
||||
NetworkInfo networkInfo = mConnectivityManager.getActiveNetworkInfo();
|
||||
mLc.setNetworkReachable(networkInfo !=null? networkInfo.getState() == NetworkInfo.State.CONNECTED:false);
|
||||
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mServiceContext);
|
||||
boolean wifiOnly = pref.getBoolean(getString(R.string.pref_wifi_only_key), false);
|
||||
boolean isConnected = false;
|
||||
if (networkInfo != null) {
|
||||
isConnected = networkInfo.getState() == NetworkInfo.State.CONNECTED && (networkInfo.getTypeName().equals("WIFI") || (networkInfo.getTypeName().equals("mobile") && !wifiOnly));
|
||||
}
|
||||
mLc.setNetworkReachable(isConnected);
|
||||
} catch (LinphoneCoreException e) {
|
||||
throw new LinphoneConfigException(getString(R.string.wrong_settings),e);
|
||||
}
|
||||
|
@ -820,14 +826,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
I/Linphone( 8397): Managing tunnel
|
||||
I/Linphone( 8397): WIFI connected: setting network reachable
|
||||
*/
|
||||
public void connectivityChanged(NetworkInfo eventInfo, ConnectivityManager cm) {
|
||||
NetworkInfo activeInfo = cm.getActiveNetworkInfo();
|
||||
public void connectivityChanged(ConnectivityManager cm, boolean noConnectivity) {
|
||||
NetworkInfo eventInfo = cm.getActiveNetworkInfo();
|
||||
|
||||
if (eventInfo.getState() == NetworkInfo.State.DISCONNECTED) {
|
||||
Log.i(eventInfo.getTypeName()," disconnected: setting network unreachable");
|
||||
if (noConnectivity || eventInfo == null || eventInfo.getState() == NetworkInfo.State.DISCONNECTED) {
|
||||
Log.i("No connectivity: setting network unreachable");
|
||||
mLc.setNetworkReachable(false);
|
||||
} else if (eventInfo.getState() == NetworkInfo.State.CONNECTED){
|
||||
manageTunnelServer(activeInfo);
|
||||
manageTunnelServer(eventInfo);
|
||||
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mServiceContext);
|
||||
boolean wifiOnly = pref.getBoolean(getString(R.string.pref_wifi_only_key), false);
|
||||
if (eventInfo.getTypeName().equals("WIFI") || (eventInfo.getTypeName().equals("mobile") && !wifiOnly)) {
|
||||
|
@ -840,20 +846,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public interface EcCalibrationListener {
|
||||
void onEcCalibrationStatus(EcCalibratorStatus status, int delayMs);
|
||||
}
|
||||
|
|
|
@ -18,15 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
package org.linphone;
|
||||
|
||||
import org.linphone.core.Log;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
|
||||
|
||||
|
@ -39,34 +34,9 @@ public class NetworkManager extends BroadcastReceiver {
|
|||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo lNetworkInfo = cm.getActiveNetworkInfo();
|
||||
Log.i("Network info [",lNetworkInfo,"]");
|
||||
Boolean lNoConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY,false);
|
||||
|
||||
|
||||
if (!LinphoneService.isReady()) {
|
||||
Log.i("Network broadcast received while Linphone service not ready");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (lNoConnectivity | ((lNetworkInfo.getState() == NetworkInfo.State.DISCONNECTED) /*&& !lIsFailOver*/)) {
|
||||
LinphoneManager.getLc().setNetworkReachable(false);
|
||||
} else if (lNetworkInfo.getState() == NetworkInfo.State.CONNECTED){
|
||||
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean wifiOnly = pref.getBoolean(context.getString(R.string.pref_wifi_only_key), false);
|
||||
if (lNetworkInfo.getTypeName().equals("WIFI") || (lNetworkInfo.getTypeName().equals("mobile") && !wifiOnly)) {
|
||||
LinphoneManager.getLc().setNetworkReachable(true);
|
||||
} else {
|
||||
LinphoneManager.getLc().setNetworkReachable(false);
|
||||
}
|
||||
} else {
|
||||
// Other unhandled events
|
||||
}
|
||||
|
||||
LinphoneManager.getInstance().connectivityChanged(lNetworkInfo, cm);
|
||||
LinphoneManager.getInstance().connectivityChanged(cm, lNoConnectivity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -342,8 +342,11 @@ public class StatusFragment extends Fragment {
|
|||
checkBox.setChecked(true);
|
||||
checkBox.setEnabled(false);
|
||||
|
||||
LinphoneManager.getLc().setDefaultProxyConfig(accounts[selectedPosition]);
|
||||
LinphoneManager.getLc().refreshRegisters();
|
||||
LinphoneCore lc = LinphoneManager.getLc();
|
||||
lc.setDefaultProxyConfig(accounts[selectedPosition]);
|
||||
if (lc.isNetworkReachable()) {
|
||||
lc.refreshRegisters();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -49,7 +49,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
|||
private AndroidVideoWindowImpl androidVideoWindowImpl;
|
||||
private InCallActivity inCallActivity;
|
||||
private GestureDetector mGestureDetector;
|
||||
private float mZoomFactor;
|
||||
private float mZoomFactor = 1;
|
||||
private float mZoomCenterX, mZoomCenterY;
|
||||
|
||||
@SuppressWarnings("deprecation") // Warning useless because value is ignored and automatically set by new APIs.
|
||||
|
|
|
@ -35,10 +35,10 @@ import android.widget.Toast;
|
|||
public class CallButton extends ImageView implements OnClickListener, AddressAware {
|
||||
|
||||
private AddressText mAddress;
|
||||
public void setAddressWidget(AddressText a) {mAddress = a;}
|
||||
public void setAddressWidget(AddressText a) { mAddress = a; }
|
||||
|
||||
private OnClickListener externalClickListener;
|
||||
public void setExternalClickListener(OnClickListener e) {externalClickListener = e;}
|
||||
public void setExternalClickListener(OnClickListener e) { setOnClickListener(e); }
|
||||
public void resetClickListener() { setOnClickListener(this); }
|
||||
|
||||
public CallButton(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
@ -56,17 +56,11 @@ public class CallButton extends ImageView implements OnClickListener, AddressAwa
|
|||
LinphoneManager.getInstance().terminateCall();
|
||||
onWrongDestinationAddress();
|
||||
};
|
||||
|
||||
if (externalClickListener != null) externalClickListener.onClick(v);
|
||||
}
|
||||
|
||||
|
||||
protected void onWrongDestinationAddress() {
|
||||
Toast toast = Toast.makeText(getContext()
|
||||
Toast.makeText(getContext()
|
||||
,String.format(getResources().getString(R.string.warning_wrong_destination_address),mAddress.getText().toString())
|
||||
,Toast.LENGTH_LONG);
|
||||
toast.show();
|
||||
,Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue