Fixed foreground notif setting not doing anything up until app restart

This commit is contained in:
Sylvain Berfini 2019-04-09 16:30:11 +02:00
parent 454a919eda
commit ea14b00bfb

View file

@ -32,6 +32,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import org.linphone.LinphoneActivity; import org.linphone.LinphoneActivity;
import org.linphone.LinphoneService;
import org.linphone.R; import org.linphone.R;
import org.linphone.fragments.FragmentsAvailable; import org.linphone.fragments.FragmentsAvailable;
import org.linphone.settings.widget.BasicSetting; import org.linphone.settings.widget.BasicSetting;
@ -146,6 +147,11 @@ public class AdvancedSettingsFragment extends Fragment {
@Override @Override
public void onBoolValueChanged(boolean newValue) { public void onBoolValueChanged(boolean newValue) {
mPrefs.setServiceNotificationVisibility(newValue); mPrefs.setServiceNotificationVisibility(newValue);
if (newValue) {
LinphoneService.instance().getNotificationManager().startForeground();
} else {
LinphoneService.instance().getNotificationManager().stopForeground();
}
} }
}); });