trigger endpoint renewal when up settings change

This commit is contained in:
Daniel Gultsch 2024-04-08 08:20:08 +02:00
parent e84d66874c
commit dbebb7feed
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -7,7 +7,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
@ -91,6 +90,17 @@ public class UpSettingsFragment extends XmppPreferenceFragment {
}
}
@Override
protected void onSharedPreferenceChanged(@NonNull String key) {
super.onSharedPreferenceChanged(key);
if (UnifiedPushDistributor.PREFERENCES.contains(key)) {
final var service = requireService();
if (service.reconfigurePushDistributor()) {
service.renewUnifiedPushEndpoints();
}
}
}
@Override
public void onStart() {
super.onStart();