fix migration to presence list, fix crash in linphone submodule
This commit is contained in:
parent
cfee90d5ea
commit
d18480b126
4 changed files with 19 additions and 2 deletions
|
@ -13,7 +13,7 @@ auto_net_state_mon=0
|
|||
auto_answer_replacing_calls=1
|
||||
ping_with_options=0
|
||||
rls_uri=sip:rls@sip.linphone.org
|
||||
use_rls_presence=1
|
||||
|
||||
|
||||
[rtp]
|
||||
audio_rtp_port=7076
|
||||
|
|
|
@ -716,6 +716,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
PreferencesMigrator prefMigrator = new PreferencesMigrator(mServiceContext);
|
||||
prefMigrator.migrateRemoteProvisioningUriIfNeeded();
|
||||
prefMigrator.migrateSharingServerUrlIfNeeded();
|
||||
prefMigrator.doPresenceMigrationIfNeeded();
|
||||
|
||||
if (prefMigrator.isMigrationNeeded()) {
|
||||
prefMigrator.doMigration();
|
||||
|
|
|
@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
import org.linphone.LinphonePreferences.AccountBuilder;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCoreException;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.core.LpConfig;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -163,6 +165,20 @@ public class PreferencesMigrator {
|
|||
}
|
||||
}
|
||||
|
||||
public void doPresenceMigrationIfNeeded() {
|
||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
LpConfig cfg = lc.getConfig();
|
||||
if (cfg.getString("app", "friendlist_subscription_enabled", null) == null){
|
||||
LinphoneProxyConfig proxy = lc.getDefaultProxyConfig();
|
||||
if (proxy != null) {
|
||||
String domain = proxy.getDomain();
|
||||
if (domain!=null && domain.equals(getString(R.string.default_domain))) {
|
||||
cfg.setBool("app", "friendlist_subscription_enabled", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteAllOldPreferences() {
|
||||
Editor editor = mOldPrefs.edit();
|
||||
editor.clear();
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a6e7eec3b3ec268e7d86f85ae268b53eca5c10de
|
||||
Subproject commit 332246314846ed07cace73e53733cc3a60b0e86c
|
Loading…
Reference in a new issue