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() {
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.removeListener(mCoreListener);
}

View file

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

View file

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

View file

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

View file

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