Removed unused parameters in non_localizable_custom
+ moved some hard coded settings to real settings + at least display LinphoneFriends if contacts permission isn't given + fix loop at startup
This commit is contained in:
parent
c95b546dc5
commit
59b0121b7f
16 changed files with 154 additions and 147 deletions
BIN
res/raw/notes_of_the_optimistic.mkv
Normal file
BIN
res/raw/notes_of_the_optimistic.mkv
Normal file
Binary file not shown.
|
@ -24,6 +24,10 @@
|
||||||
<bool name="hide_camera_settings">false</bool>
|
<bool name="hide_camera_settings">false</bool>
|
||||||
<bool name="hide_wizard">false</bool>
|
<bool name="hide_wizard">false</bool>
|
||||||
|
|
||||||
|
<bool name="disable_chat">false</bool>
|
||||||
|
<bool name="disable_chat_message_notification">false</bool>
|
||||||
|
<bool name="disable_chat_send_file">false</bool>
|
||||||
|
|
||||||
<bool name="setup_account_validation_mandatory">false</bool>
|
<bool name="setup_account_validation_mandatory">false</bool>
|
||||||
<bool name="hide_linphone_accounts_wizard">false</bool>
|
<bool name="hide_linphone_accounts_wizard">false</bool>
|
||||||
<bool name="hide_generic_accounts_wizard">false</bool>
|
<bool name="hide_generic_accounts_wizard">false</bool>
|
||||||
|
@ -31,42 +35,26 @@
|
||||||
<bool name="allow_cancel_remote_provisioning_login_activity">true</bool>
|
<bool name="allow_cancel_remote_provisioning_login_activity">true</bool>
|
||||||
<bool name="hide_accounts">false</bool>
|
<bool name="hide_accounts">false</bool>
|
||||||
<bool name="display_account_wizard_at_first_start">true</bool>
|
<bool name="display_account_wizard_at_first_start">true</bool>
|
||||||
<bool name="use_linphone_server_ports">false</bool>
|
|
||||||
<bool name="allow_only_phone_numbers_in_wizard">false</bool>
|
<bool name="allow_only_phone_numbers_in_wizard">false</bool>
|
||||||
|
|
||||||
<bool name="enable_linphone_friends">false</bool>
|
|
||||||
<bool name="use_linphone_tag">true</bool>
|
<bool name="use_linphone_tag">true</bool>
|
||||||
<bool name="disable_options_in_call">false</bool>
|
|
||||||
|
|
||||||
<bool name="pre_fill_email_in_wizard">true</bool> <!-- Set the email field of the wizard with one of the gmail account registered on the device -->
|
<bool name="pre_fill_email_in_wizard">true</bool> <!-- Set the email field of the wizard with one of the gmail account registered on the device -->
|
||||||
|
|
||||||
<bool name="call_last_log_if_adress_is_empty">true</bool>
|
|
||||||
|
|
||||||
<bool name="allow_ringing_while_early_media">true</bool>
|
|
||||||
|
|
||||||
<bool name="disable_chat">false</bool>
|
|
||||||
<bool name="disable_chat_message_notification">false</bool>
|
|
||||||
|
|
||||||
<bool name="disable_chat_send_file">false</bool>
|
|
||||||
<bool name="auto_answer_calls">false</bool>
|
|
||||||
|
|
||||||
<bool name="allow_transfers">true</bool>
|
|
||||||
|
|
||||||
<bool name="forbid_self_call">false</bool>
|
<bool name="forbid_self_call">false</bool>
|
||||||
|
<bool name="allow_ringing_while_early_media">true</bool>
|
||||||
<bool name="disable_animations">false</bool>
|
<bool name="allow_transfers">true</bool>
|
||||||
|
<bool name="disable_options_in_call">false</bool>
|
||||||
|
|
||||||
<bool name="automatically_start_intercepted_outgoing_gsm_call">true</bool>
|
<bool name="automatically_start_intercepted_outgoing_gsm_call">true</bool>
|
||||||
<!-- This settings handle the behavior of the view waiting for the remote provisioning configuration to be done -->
|
<!-- This settings handle the behavior of the view waiting for the remote provisioning configuration to be done -->
|
||||||
<bool name="display_sms_remote_provisioning_activity">false</bool>
|
<bool name="display_sms_remote_provisioning_activity">false</bool>
|
||||||
<bool name="forbid_app_usage_until_remote_provisioning_completed">false</bool>
|
<bool name="forbid_app_usage_until_remote_provisioning_completed">false</bool>
|
||||||
<bool name="display_confirmation_popup_after_first_configuration">false</bool>
|
<bool name="display_confirmation_popup_after_first_configuration">false</bool>
|
||||||
<bool name="enable_log_collect">false</bool>
|
|
||||||
<bool name="disable_every_log">false</bool>
|
<bool name="disable_every_log">false</bool>
|
||||||
<bool name="disable_all_security_features_for_markets">false</bool> <!-- Disable TLS/SRTP/ZRTP -->
|
<bool name="disable_all_security_features_for_markets">false</bool> <!-- Disable TLS/SRTP/ZRTP -->
|
||||||
<bool name="disable_all_patented_codecs_for_markets">false</bool> <!-- Disable MPEG4/H264 -->
|
<bool name="disable_all_patented_codecs_for_markets">false</bool> <!-- Disable MPEG4/H264 -->
|
||||||
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
|
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
|
||||||
<bool name="use_linphonecore_ringing">false</bool>
|
|
||||||
|
|
||||||
<string name="temp_photo_name">linphone-android-photo-temp</string>
|
<string name="temp_photo_name">linphone-android-photo-temp</string>
|
||||||
<string name="temp_photo_name_with_date">linphone-android-photo-%s</string>
|
<string name="temp_photo_name_with_date">linphone-android-photo-%s</string>
|
||||||
|
@ -82,12 +70,9 @@
|
||||||
|
|
||||||
<bool name="setup_cancel_move_to_back">false</bool>
|
<bool name="setup_cancel_move_to_back">false</bool>
|
||||||
|
|
||||||
|
|
||||||
<bool name="enable_call_notification">true</bool>
|
<bool name="enable_call_notification">true</bool>
|
||||||
<bool name="kill_service_with_task_manager">true</bool>
|
<bool name="kill_service_with_task_manager">true</bool>
|
||||||
|
|
||||||
<bool name="hash_images_as_name_before_upload">true</bool>
|
|
||||||
|
|
||||||
<!-- Tutorial settings -->
|
<!-- Tutorial settings -->
|
||||||
<bool name="show_tutorials_instead_of_app">false</bool> <!-- Be careful ! Setting this to true prevent the app from working ! It will only display tutorial activities -->
|
<bool name="show_tutorials_instead_of_app">false</bool> <!-- Be careful ! Setting this to true prevent the app from working ! It will only display tutorial activities -->
|
||||||
|
|
||||||
|
|
|
@ -201,4 +201,6 @@
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string name="pref_use_lime_encryption_key">pref_use_lime_encryption_key</string>
|
<string name="pref_use_lime_encryption_key">pref_use_lime_encryption_key</string>
|
||||||
|
<string name="pref_device_ringtone_key">pref_device_ringtone_key</string>
|
||||||
|
<string name="pref_auto_answer_key">pref_auto_answer_key</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -267,6 +267,8 @@
|
||||||
|
|
||||||
<!-- Call settings -->
|
<!-- Call settings -->
|
||||||
<string name="pref_call_title">Call</string>
|
<string name="pref_call_title">Call</string>
|
||||||
|
<string name="pref_device_ringtone">Use device ringtone</string>
|
||||||
|
<string name="pref_auto_answer">Auto answer incoming calls</string>
|
||||||
<string name="pref_rfc2833_dtmf">Send RFC2833 DTMFs</string>
|
<string name="pref_rfc2833_dtmf">Send RFC2833 DTMFs</string>
|
||||||
<string name="pref_sipinfo_dtmf">Send SIP INFO DTMFs</string>
|
<string name="pref_sipinfo_dtmf">Send SIP INFO DTMFs</string>
|
||||||
<string name="pref_voice_mail">Voice mail URI</string>
|
<string name="pref_voice_mail">Voice mail URI</string>
|
||||||
|
|
|
@ -151,6 +151,16 @@
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:title="@string/pref_call_title">
|
android:title="@string/pref_call_title">
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:title="@string/pref_device_ringtone"
|
||||||
|
android:key="@string/pref_device_ringtone_key"
|
||||||
|
android:persistent="false"/>
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/pref_media_encryption"
|
||||||
|
android:key="@string/pref_media_encryption_key"
|
||||||
|
android:persistent="false"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:title="@string/pref_sipinfo_dtmf"
|
android:title="@string/pref_sipinfo_dtmf"
|
||||||
android:key="@string/pref_sipinfo_dtmf_key"
|
android:key="@string/pref_sipinfo_dtmf_key"
|
||||||
|
@ -161,6 +171,11 @@
|
||||||
android:key="@string/pref_rfc2833_dtmf_key"
|
android:key="@string/pref_rfc2833_dtmf_key"
|
||||||
android:persistent="false"/>
|
android:persistent="false"/>
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:title="@string/pref_auto_answer"
|
||||||
|
android:key="@string/pref_auto_answer_key"
|
||||||
|
android:persistent="false"/>
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:title="@string/pref_voice_mail"
|
android:title="@string/pref_voice_mail"
|
||||||
android:key="@string/pref_voice_mail_key"
|
android:key="@string/pref_voice_mail_key"
|
||||||
|
@ -170,17 +185,17 @@
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:title="@string/pref_chat_title">
|
android:title="@string/pref_chat_title">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/pref_use_lime_encryption"
|
||||||
|
android:key="@string/pref_use_lime_encryption_key"
|
||||||
|
android:persistent="false"/>
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:title="@string/pref_image_sharing_server_title"
|
android:title="@string/pref_image_sharing_server_title"
|
||||||
android:key="@string/pref_image_sharing_server_key"
|
android:key="@string/pref_image_sharing_server_key"
|
||||||
android:summary="@string/pref_image_sharing_server_desc"
|
android:summary="@string/pref_image_sharing_server_desc"
|
||||||
android:persistent="false"/>
|
android:persistent="false"/>
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:title="@string/pref_use_lime_encryption"
|
|
||||||
android:key="@string/pref_use_lime_encryption_key"
|
|
||||||
android:persistent="false"/>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
|
@ -232,11 +247,6 @@
|
||||||
android:layout="@layout/hidden"
|
android:layout="@layout/hidden"
|
||||||
android:persistent="false"/>
|
android:persistent="false"/>
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:title="@string/pref_media_encryption"
|
|
||||||
android:key="@string/pref_media_encryption_key"
|
|
||||||
android:persistent="false"/>
|
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:title="@string/pref_push_notification"
|
android:title="@string/pref_push_notification"
|
||||||
android:key="@string/pref_push_notification_key"
|
android:key="@string/pref_push_notification_key"
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class CallActivity extends Activity implements OnClickListener, SensorEve
|
||||||
BluetoothManager.getInstance().initBluetooth();
|
BluetoothManager.getInstance().initBluetooth();
|
||||||
}
|
}
|
||||||
|
|
||||||
isAnimationDisabled = getApplicationContext().getResources().getBoolean(R.bool.disable_animations) || !LinphonePreferences.instance().areAnimationsEnabled();
|
isAnimationDisabled = !LinphonePreferences.instance().areAnimationsEnabled();
|
||||||
cameraNumber = AndroidCameraConfiguration.retrieveCameras().length;
|
cameraNumber = AndroidCameraConfiguration.retrieveCameras().length;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -17,9 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
@ -39,20 +37,15 @@ public class CallAudioFragment extends Fragment {
|
||||||
View view = inflater.inflate(R.layout.audio, container, false);
|
View view = inflater.inflate(R.layout.audio, container, false);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach((Context)activity);
|
|
||||||
incallActvityInstance = (CallActivity) activity;
|
|
||||||
|
|
||||||
if (incallActvityInstance != null) {
|
|
||||||
incallActvityInstance.bindAudioFragment(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
incallActvityInstance = (CallActivity) getActivity();
|
||||||
|
|
||||||
|
if (incallActvityInstance != null) {
|
||||||
|
incallActvityInstance.bindAudioFragment(this);
|
||||||
|
}
|
||||||
|
|
||||||
// Just to be sure we have incall controls
|
// Just to be sure we have incall controls
|
||||||
if (incallActvityInstance != null) {
|
if (incallActvityInstance != null) {
|
||||||
|
|
|
@ -25,9 +25,7 @@ import org.linphone.mediastream.Log;
|
||||||
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
|
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.GestureDetector;
|
import android.view.GestureDetector;
|
||||||
import android.view.GestureDetector.OnDoubleTapListener;
|
import android.view.GestureDetector.OnDoubleTapListener;
|
||||||
|
@ -132,6 +130,15 @@ public class CallVideoFragment extends Fragment implements OnGestureListener, On
|
||||||
});
|
});
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
inCallActivity = (CallActivity) getActivity();
|
||||||
|
if (inCallActivity != null) {
|
||||||
|
inCallActivity.bindVideoFragment(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void fixZOrder(SurfaceView video, SurfaceView preview) {
|
private void fixZOrder(SurfaceView video, SurfaceView preview) {
|
||||||
video.setZOrderOnTop(false);
|
video.setZOrderOnTop(false);
|
||||||
|
@ -293,15 +300,6 @@ public class CallVideoFragment extends Fragment implements OnGestureListener, On
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach((Context)activity);
|
|
||||||
inCallActivity = (CallActivity) activity;
|
|
||||||
if (inCallActivity != null) {
|
|
||||||
inCallActivity.bindVideoFragment(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onDown(MotionEvent e) {
|
public boolean onDown(MotionEvent e) {
|
||||||
|
|
|
@ -170,34 +170,6 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
v.findViewById(R.id.contact_chat).setTag(noa.getValue());
|
v.findViewById(R.id.contact_chat).setTag(noa.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ImageView friend = (ImageView) v.findViewById(R.id.addFriend);
|
|
||||||
if (getResources().getBoolean(R.bool.enable_linphone_friends) && !displayChatAddressOnly) {
|
|
||||||
friend.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
boolean isAlreadyAFriend = LinphoneManager.getLc().findFriendByAddress(finalNumberOrAddress) != null;
|
|
||||||
if (!isAlreadyAFriend) {
|
|
||||||
friend.setImageResource(R.drawable.contact_add);
|
|
||||||
friend.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (ContactsManager.getInstance().createNewFriend(contact, finalNumberOrAddress)) {
|
|
||||||
displayContact(ContactFragment.this.inflater, ContactFragment.this.view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
friend.setImageResource(R.drawable.delete);
|
|
||||||
friend.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (ContactsManager.getInstance().removeFriend(finalNumberOrAddress)) {
|
|
||||||
displayContact(ContactFragment.this.inflater, ContactFragment.this.view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||||
v.findViewById(R.id.contact_chat).setVisibility(View.GONE);
|
v.findViewById(R.id.contact_chat).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ public class ContactsManager extends ContentObserver {
|
||||||
c.close();
|
c.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LinphoneFriend friend : LinphoneManager.getLc().getFriendList()) {
|
for (LinphoneFriend friend : LinphoneManager.getLc().getFriendList()) {
|
||||||
String refkey = friend.getRefKey();
|
String refkey = friend.getRefKey();
|
||||||
if (refkey != null) {
|
if (refkey != null) {
|
||||||
|
@ -255,9 +255,13 @@ public class ContactsManager extends ContentObserver {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found && hasContactAccess) {
|
||||||
// If refkey != null but there isn't a native contact with this value, then this contact has been deleted. Let's do the same with the LinphoneFriend
|
// If refkey != null but there isn't a native contact with this value, then this contact has been deleted. Let's do the same with the LinphoneFriend
|
||||||
LinphoneManager.getLc().removeFriend(friend);
|
LinphoneManager.getLc().removeFriend(friend);
|
||||||
|
} else {
|
||||||
|
LinphoneContact contact = new LinphoneContact();
|
||||||
|
contact.setFriend(friend);
|
||||||
|
contacts.add(contact);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LinphoneContact contact = new LinphoneContact();
|
LinphoneContact contact = new LinphoneContact();
|
||||||
|
|
|
@ -417,7 +417,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAnimationsState() {
|
private void updateAnimationsState() {
|
||||||
isAnimationDisabled = getResources().getBoolean(R.bool.disable_animations) || !LinphonePreferences.instance().areAnimationsEnabled();
|
isAnimationDisabled = !LinphonePreferences.instance().areAnimationsEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAnimationDisabled() {
|
public boolean isAnimationDisabled() {
|
||||||
|
@ -1253,9 +1253,9 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
case PERMISSIONS_REQUEST_CONTACTS:
|
case PERMISSIONS_REQUEST_CONTACTS:
|
||||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
ContactsManager.getInstance().enableContactsAccess();
|
ContactsManager.getInstance().enableContactsAccess();
|
||||||
ContactsManager.getInstance().fetchContacts();
|
|
||||||
fetchedContactsOnce = true;
|
|
||||||
}
|
}
|
||||||
|
ContactsManager.getInstance().fetchContacts();
|
||||||
|
fetchedContactsOnce = true;
|
||||||
break;
|
break;
|
||||||
case PERMISSIONS_RECORD_AUDIO_ECHO_CANCELLER:
|
case PERMISSIONS_RECORD_AUDIO_ECHO_CANCELLER:
|
||||||
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
mLinphoneFactoryConfigFile = basePath + "/linphonerc";
|
mLinphoneFactoryConfigFile = basePath + "/linphonerc";
|
||||||
mLinphoneConfigFile = basePath + "/.linphonerc";
|
mLinphoneConfigFile = basePath + "/.linphonerc";
|
||||||
mLinphoneRootCaFile = basePath + "/rootca.pem";
|
mLinphoneRootCaFile = basePath + "/rootca.pem";
|
||||||
mRingSoundFile = basePath + "/oldphone_mono.wav";
|
mRingSoundFile = basePath + "/notes_of_the_optimistic.mkv";
|
||||||
mRingbackSoundFile = basePath + "/ringback.wav";
|
mRingbackSoundFile = basePath + "/ringback.wav";
|
||||||
mPauseSoundFile = basePath + "/hold.mkv";
|
mPauseSoundFile = basePath + "/hold.mkv";
|
||||||
mChatDatabaseFile = basePath + "/linphone-history.db";
|
mChatDatabaseFile = basePath + "/linphone-history.db";
|
||||||
|
@ -691,12 +691,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
Log.e(e, "cannot get version name");
|
Log.e(e, "cannot get version name");
|
||||||
}
|
}
|
||||||
mLc.setRing(mRingSoundFile);
|
|
||||||
if (mR.getBoolean(R.bool.use_linphonecore_ringing)) {
|
|
||||||
disableRinging();
|
|
||||||
} else {
|
|
||||||
mLc.setRing(null); //We'll use the android media player api to play the ringtone
|
|
||||||
}
|
|
||||||
mLc.setRingback(mRingbackSoundFile);
|
mLc.setRingback(mRingbackSoundFile);
|
||||||
mLc.setRootCA(mLinphoneRootCaFile);
|
mLc.setRootCA(mLinphoneRootCaFile);
|
||||||
mLc.setPlayFile(mPauseSoundFile);
|
mLc.setPlayFile(mPauseSoundFile);
|
||||||
|
@ -706,6 +701,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
mLc.setUserCertificatesPath(mUserCertificatePath);
|
mLc.setUserCertificatesPath(mUserCertificatePath);
|
||||||
subscribeFriendList(mPrefs.isFriendlistsubscriptionEnabled());
|
subscribeFriendList(mPrefs.isFriendlistsubscriptionEnabled());
|
||||||
//mLc.setCallErrorTone(Reason.NotFound, mErrorToneFile);
|
//mLc.setCallErrorTone(Reason.NotFound, mErrorToneFile);
|
||||||
|
enableDeviceRingtone(mPrefs.isDeviceRingtoneEnabled());
|
||||||
|
|
||||||
int availableCores = Runtime.getRuntime().availableProcessors();
|
int availableCores = Runtime.getRuntime().availableProcessors();
|
||||||
Log.w("MediaStreamer : " + availableCores + " cores detected and configured");
|
Log.w("MediaStreamer : " + availableCores + " cores detected and configured");
|
||||||
|
@ -734,7 +730,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyAssetsFromPackage() throws IOException {
|
private void copyAssetsFromPackage() throws IOException {
|
||||||
copyIfNotExist(R.raw.oldphone_mono, mRingSoundFile);
|
copyIfNotExist(R.raw.notes_of_the_optimistic, mRingSoundFile);
|
||||||
copyIfNotExist(R.raw.ringback, mRingbackSoundFile);
|
copyIfNotExist(R.raw.ringback, mRingbackSoundFile);
|
||||||
copyIfNotExist(R.raw.hold, mPauseSoundFile);
|
copyIfNotExist(R.raw.hold, mPauseSoundFile);
|
||||||
copyIfNotExist(R.raw.incoming_chat, mErrorToneFile);
|
copyIfNotExist(R.raw.incoming_chat, mErrorToneFile);
|
||||||
|
@ -998,7 +994,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == State.IncomingReceived && mR.getBoolean(R.bool.auto_answer_calls)) {
|
if (state == State.IncomingReceived && LinphonePreferences.instance().isAutoAnswerEnabled()) {
|
||||||
try {
|
try {
|
||||||
mLc.acceptCall(call);
|
mLc.acceptCall(call);
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
|
@ -1122,11 +1118,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isRinging;
|
private boolean isRinging;
|
||||||
private boolean disableRinging = false;
|
|
||||||
|
|
||||||
public void disableRinging() {
|
|
||||||
disableRinging = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void requestAudioFocus(){
|
private void requestAudioFocus(){
|
||||||
if (!mAudioFocused){
|
if (!mAudioFocused){
|
||||||
|
@ -1135,12 +1126,21 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
if (res == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) mAudioFocused=true;
|
if (res == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) mAudioFocused=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void enableDeviceRingtone(boolean use) {
|
||||||
|
if (use) {
|
||||||
|
mLc.setRing(null);
|
||||||
|
} else {
|
||||||
|
mLc.setRing(mRingSoundFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private synchronized void startRinging() {
|
private synchronized void startRinging() {
|
||||||
if (disableRinging) {
|
if (!LinphonePreferences.instance().isDeviceRingtoneEnabled()) {
|
||||||
routeAudioToSpeaker();
|
routeAudioToSpeaker();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mR.getBoolean(R.bool.allow_ringing_while_early_media)) {
|
if (mR.getBoolean(R.bool.allow_ringing_while_early_media)) {
|
||||||
routeAudioToSpeaker(); // Need to be able to ear the ringtone during the early media
|
routeAudioToSpeaker(); // Need to be able to ear the ringtone during the early media
|
||||||
}
|
}
|
||||||
|
|
|
@ -1337,4 +1337,28 @@ public class LinphonePreferences {
|
||||||
}
|
}
|
||||||
return firstTime;
|
return firstTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDeviceRingtoneEnabled() {
|
||||||
|
return getConfig().getBool("app", "device_ringtone", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enableDeviceRingtone(boolean enable) {
|
||||||
|
getConfig().setBool("app", "device_ringtone", enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBisFeatureEnabled() {
|
||||||
|
return getConfig().getBool("app", "bis_feature", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enableBisFeature(boolean enable) {
|
||||||
|
getConfig().setBool("app", "bis_feature", enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAutoAnswerEnabled() {
|
||||||
|
return getConfig().getBool("app", "auto_answer", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enableAutoAnswer(boolean enable) {
|
||||||
|
getConfig().setBool("app", "auto_answer", enable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,11 +166,6 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
hidePreference(R.string.pref_in_app_store_key);
|
hidePreference(R.string.pref_in_app_store_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (getResources().getBoolean(R.bool.disable_animations)) {
|
|
||||||
uncheckAndHidePreference(R.string.pref_animation_enable_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||||
findPreference(getString(R.string.pref_image_sharing_server_key)).setLayoutResource(R.layout.hidden);
|
findPreference(getString(R.string.pref_image_sharing_server_key)).setLayoutResource(R.layout.hidden);
|
||||||
}
|
}
|
||||||
|
@ -776,9 +771,14 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initCallSettings() {
|
private void initCallSettings() {
|
||||||
|
CheckBoxPreference deviceRingtone = (CheckBoxPreference) findPreference(getString(R.string.pref_device_ringtone_key));
|
||||||
|
CheckBoxPreference autoAnswer = (CheckBoxPreference) findPreference(getString(R.string.pref_auto_answer_key));
|
||||||
CheckBoxPreference rfc2833 = (CheckBoxPreference) findPreference(getString(R.string.pref_rfc2833_dtmf_key));
|
CheckBoxPreference rfc2833 = (CheckBoxPreference) findPreference(getString(R.string.pref_rfc2833_dtmf_key));
|
||||||
CheckBoxPreference sipInfo = (CheckBoxPreference) findPreference(getString(R.string.pref_sipinfo_dtmf_key));
|
CheckBoxPreference sipInfo = (CheckBoxPreference) findPreference(getString(R.string.pref_sipinfo_dtmf_key));
|
||||||
|
|
||||||
|
deviceRingtone.setChecked(mPrefs.isDeviceRingtoneEnabled());
|
||||||
|
autoAnswer.setChecked(mPrefs.isAutoAnswerEnabled());
|
||||||
|
|
||||||
if (mPrefs.useRfc2833Dtmfs()) {
|
if (mPrefs.useRfc2833Dtmfs()) {
|
||||||
rfc2833.setChecked(true);
|
rfc2833.setChecked(true);
|
||||||
sipInfo.setChecked(false);
|
sipInfo.setChecked(false);
|
||||||
|
@ -793,6 +793,45 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCallPreferencesListener() {
|
private void setCallPreferencesListener() {
|
||||||
|
findPreference(getString(R.string.pref_device_ringtone_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
boolean use = (Boolean) newValue;
|
||||||
|
mPrefs.enableDeviceRingtone(use);
|
||||||
|
LinphoneManager.getInstance().enableDeviceRingtone(use);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference(getString(R.string.pref_media_encryption_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
String value = newValue.toString();
|
||||||
|
MediaEncryption menc = MediaEncryption.None;
|
||||||
|
if (value.equals(getString(R.string.pref_media_encryption_key_srtp)))
|
||||||
|
menc = MediaEncryption.SRTP;
|
||||||
|
else if (value.equals(getString(R.string.pref_media_encryption_key_zrtp)))
|
||||||
|
menc = MediaEncryption.ZRTP;
|
||||||
|
else if (value.equals(getString(R.string.pref_media_encryption_key_dtls)))
|
||||||
|
menc = MediaEncryption.DTLS;
|
||||||
|
mPrefs.setMediaEncryption(menc);
|
||||||
|
|
||||||
|
preference.setSummary(mPrefs.getMediaEncryption().toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
initMediaEncryptionPreference((ListPreference) findPreference(getString(R.string.pref_media_encryption_key)));
|
||||||
|
|
||||||
|
findPreference(getString(R.string.pref_auto_answer_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
boolean use = (Boolean) newValue;
|
||||||
|
mPrefs.enableAutoAnswer(use);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
findPreference(getString(R.string.pref_rfc2833_dtmf_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
findPreference(getString(R.string.pref_rfc2833_dtmf_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
@ -871,8 +910,6 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initNetworkSettings() {
|
private void initNetworkSettings() {
|
||||||
initMediaEncryptionPreference((ListPreference) findPreference(getString(R.string.pref_media_encryption_key)));
|
|
||||||
|
|
||||||
((CheckBoxPreference) findPreference(getString(R.string.pref_wifi_only_key))).setChecked(mPrefs.isWifiOnlyEnabled());
|
((CheckBoxPreference) findPreference(getString(R.string.pref_wifi_only_key))).setChecked(mPrefs.isWifiOnlyEnabled());
|
||||||
|
|
||||||
// Disable UPnP if ICE si enabled, or disable ICE if UPnP is enabled
|
// Disable UPnP if ICE si enabled, or disable ICE if UPnP is enabled
|
||||||
|
@ -972,24 +1009,6 @@ public class SettingsFragment extends PreferencesListFragment {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
findPreference(getString(R.string.pref_media_encryption_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
String value = newValue.toString();
|
|
||||||
MediaEncryption menc = MediaEncryption.None;
|
|
||||||
if (value.equals(getString(R.string.pref_media_encryption_key_srtp)))
|
|
||||||
menc = MediaEncryption.SRTP;
|
|
||||||
else if (value.equals(getString(R.string.pref_media_encryption_key_zrtp)))
|
|
||||||
menc = MediaEncryption.ZRTP;
|
|
||||||
else if (value.equals(getString(R.string.pref_media_encryption_key_dtls)))
|
|
||||||
menc = MediaEncryption.DTLS;
|
|
||||||
mPrefs.setMediaEncryption(menc);
|
|
||||||
|
|
||||||
preference.setSummary(mPrefs.getMediaEncryption().toString());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
findPreference(getString(R.string.pref_push_notification_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
findPreference(getString(R.string.pref_push_notification_key)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
|
|
|
@ -143,6 +143,20 @@ public class StatusFragment extends Fragment {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
isAttached = true;
|
||||||
|
Activity activity = getActivity();
|
||||||
|
|
||||||
|
if (activity instanceof LinphoneActivity) {
|
||||||
|
((LinphoneActivity) activity).updateStatusFragment(this);
|
||||||
|
isInCall = false;
|
||||||
|
} else if (activity instanceof CallActivity) {
|
||||||
|
((CallActivity) activity).updateStatusFragment(this);
|
||||||
|
isInCall = true;
|
||||||
|
} else if (activity instanceof AssistantActivity) {
|
||||||
|
((AssistantActivity) activity).updateStatusFragment(this);
|
||||||
|
isInCall = false;
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,23 +172,6 @@ public class StatusFragment extends Fragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach((Context)activity);
|
|
||||||
isAttached = true;
|
|
||||||
|
|
||||||
if (activity instanceof LinphoneActivity) {
|
|
||||||
((LinphoneActivity) activity).updateStatusFragment(this);
|
|
||||||
isInCall = false;
|
|
||||||
} else if (activity instanceof CallActivity) {
|
|
||||||
((CallActivity) activity).updateStatusFragment(this);
|
|
||||||
isInCall = true;
|
|
||||||
} else if (activity instanceof AssistantActivity) {
|
|
||||||
((AssistantActivity) activity).updateStatusFragment(this);
|
|
||||||
isInCall = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
package org.linphone.ui;
|
package org.linphone.ui;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.CallDirection;
|
import org.linphone.core.CallDirection;
|
||||||
import org.linphone.core.LinphoneCallLog;
|
import org.linphone.core.LinphoneCallLog;
|
||||||
|
@ -54,7 +55,7 @@ public class CallButton extends ImageView implements OnClickListener, AddressAwa
|
||||||
if (mAddress.getText().length() > 0) {
|
if (mAddress.getText().length() > 0) {
|
||||||
LinphoneManager.getInstance().newOutgoingCall(mAddress);
|
LinphoneManager.getInstance().newOutgoingCall(mAddress);
|
||||||
} else {
|
} else {
|
||||||
if (getContext().getResources().getBoolean(R.bool.call_last_log_if_adress_is_empty)) {
|
if (LinphonePreferences.instance().isBisFeatureEnabled()) {
|
||||||
LinphoneCallLog[] logs = LinphoneManager.getLc().getCallLogs();
|
LinphoneCallLog[] logs = LinphoneManager.getLc().getCallLogs();
|
||||||
LinphoneCallLog log = null;
|
LinphoneCallLog log = null;
|
||||||
for (LinphoneCallLog l : logs) {
|
for (LinphoneCallLog l : logs) {
|
||||||
|
|
Loading…
Reference in a new issue