Fixes more issues

This commit is contained in:
Sylvain Berfini 2021-03-22 11:30:11 +01:00
parent 7e5b9c4648
commit b63b23a8b3
5 changed files with 5 additions and 15 deletions

View file

@ -314,15 +314,6 @@ public class LinphoneManager implements SensorEventListener {
private void destroyCore() { private void destroyCore() {
Log.w("[Manager] Destroying Core"); Log.w("[Manager] Destroying Core");
if (LinphonePreferences.instance() != null) {
// We set network reachable at false before destroying the Core
// to not send a register with expires at 0
if (LinphonePreferences.instance().isPushNotificationEnabled()) {
Log.w(
"[Manager] Setting network reachability to False to prevent unregister and allow incoming push notifications");
mCore.setNetworkReachable(false);
}
}
mCore.stop(); mCore.stop();
mCore.removeListener(mCoreListener); mCore.removeListener(mCoreListener);
} }

View file

@ -559,6 +559,7 @@ public abstract class MainActivity extends LinphoneGenericActivity
if (LinphoneContext.isReady()) { if (LinphoneContext.isReady()) {
ContactsManager.getInstance().enableContactsAccess(); ContactsManager.getInstance().enableContactsAccess();
ContactsManager.getInstance().initializeContactManager(); ContactsManager.getInstance().initializeContactManager();
ContactsManager.getInstance().fetchContactsAsync();
} }
} }
} else if (permissions[i].equals(Manifest.permission.READ_EXTERNAL_STORAGE)) { } else if (permissions[i].equals(Manifest.permission.READ_EXTERNAL_STORAGE)) {

View file

@ -1122,7 +1122,8 @@ public class CallActivity extends LinphoneGenericActivity
if (mCore.isInConference()) { if (mCore.isInConference()) {
displayConferenceCall(call); displayConferenceCall(call);
conferenceDisplayed = true; conferenceDisplayed = true;
} else if (!pausedConferenceDisplayed) { } else if (!pausedConferenceDisplayed
&& mCore.getCallsNb() > 1) { // Workaround for temporary SDK issue
displayPausedConference(); displayPausedConference();
pausedConferenceDisplayed = true; pausedConferenceDisplayed = true;
} }

View file

@ -216,6 +216,7 @@ public class ContactsFragment extends Fragment
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
ContactsManager.getInstance().addContactsListener(this); ContactsManager.getInstance().addContactsListener(this);
mOnlyDisplayLinphoneContacts = mOnlyDisplayLinphoneContacts =
@ -224,6 +225,7 @@ public class ContactsFragment extends Fragment
changeContactsToggle(); changeContactsToggle();
invalidate(); invalidate();
onContactsUpdated();
((ContactsActivity) (getActivity())).showTabBar(); ((ContactsActivity) (getActivity())).showTabBar();
} }

View file

@ -107,11 +107,6 @@ public final class LinphoneService extends Service {
if (core != null) { if (core != null) {
core.terminateAllCalls(); core.terminateAllCalls();
} }
// If push is enabled, don't unregister account, otherwise do unregister
if (LinphonePreferences.instance().isPushNotificationEnabled()) {
if (core != null) core.setNetworkReachable(false);
}
stopSelf(); stopSelf();
} }
super.onTaskRemoved(rootIntent); super.onTaskRemoved(rootIntent);