Fix status bar registration state at boot
This commit is contained in:
parent
69da3f0419
commit
ceb74e2847
1 changed files with 7 additions and 4 deletions
|
@ -116,6 +116,11 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener,
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
if (lc != null) {
|
if (lc != null) {
|
||||||
lc.addListener(this);
|
lc.addListener(this);
|
||||||
|
|
||||||
|
LinphoneProxyConfig lpc = lc.getDefaultProxyConfig();
|
||||||
|
if (lpc != null) {
|
||||||
|
registrationState(lc, null, lpc.getState(), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
@ -189,7 +194,7 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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()) {
|
if (!isAttached || !LinphoneService.isReady()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -204,9 +209,7 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener,
|
||||||
statusText.setOnClickListener(new OnClickListener() {
|
statusText.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (LinphoneManager.isInstanciated()) {
|
lc.refreshRegisters();
|
||||||
LinphoneManager.getLc().refreshRegisters();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue