From ceb74e2847cb2e0ce9663e3a1fa034bbd6c8998c Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 3 Dec 2014 14:32:34 +0100 Subject: [PATCH] Fix status bar registration state at boot --- src/org/linphone/StatusFragment.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/linphone/StatusFragment.java b/src/org/linphone/StatusFragment.java index 279c0ee67..6be3b27c0 100644 --- a/src/org/linphone/StatusFragment.java +++ b/src/org/linphone/StatusFragment.java @@ -116,6 +116,11 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener, LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull(); if (lc != null) { lc.addListener(this); + + LinphoneProxyConfig lpc = lc.getDefaultProxyConfig(); + if (lpc != null) { + registrationState(lc, null, lpc.getState(), null); + } } return view; @@ -189,7 +194,7 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener, } @Override - public void registrationState(LinphoneCore lc, LinphoneProxyConfig proxy, final LinphoneCore.RegistrationState state, String smessage) { + public void registrationState(final LinphoneCore lc, LinphoneProxyConfig proxy, final LinphoneCore.RegistrationState state, String smessage) { if (!isAttached || !LinphoneService.isReady()) { return; } @@ -204,9 +209,7 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener, statusText.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (LinphoneManager.isInstanciated()) { - LinphoneManager.getLc().refreshRegisters(); - } + lc.refreshRegisters(); } }); }