Add force refresh of remote values to internal preferences UI.

master
Ehren Kret 2020-07-14 17:08:21 -05:00 committed by Alan Evans
parent f306056e5d
commit d02d506b13
3 changed files with 15 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import org.thoughtcrime.securesms.components.SwitchPreferenceCompat;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob;
import org.thoughtcrime.securesms.jobs.RefreshOwnProfileJob;
import org.thoughtcrime.securesms.jobs.RemoteConfigRefreshJob;
import org.thoughtcrime.securesms.jobs.RotateProfileKeyJob;
import org.thoughtcrime.securesms.jobs.StorageForcePushJob;
import org.thoughtcrime.securesms.keyvalue.InternalValues;
@ -52,6 +53,12 @@ public class InternalOptionsPreferenceFragment extends CorrectedPreferenceFragme
return true;
});
findPreference("pref_refresh_remote_values").setOnPreferenceClickListener(preference -> {
ApplicationDependencies.getJobManager().add(new RemoteConfigRefreshJob());
Toast.makeText(getContext(), "Scheduled remote config refresh", Toast.LENGTH_SHORT).show();
return true;
});
findPreference("pref_force_send").setOnPreferenceClickListener(preference -> {
ApplicationDependencies.getJobManager().add(new StorageForcePushJob());
Toast.makeText(getContext(), "Scheduled storage force push", Toast.LENGTH_SHORT).show();

View File

@ -1972,6 +1972,8 @@
<string name="preferences__internal_refresh_attributes_description" translatable="false">Forces a write of capabilities on to the server followed by a read.</string>
<string name="preferences__internal_rotate_profile_key" translatable="false">Rotate profile key</string>
<string name="preferences__internal_rotate_profile_key_description" translatable="false">Creates a new versioned profile, and triggers an update of any GV2 group you belong to.</string>
<string name="preferences__internal_refresh_remote_values" translatable="false">Refresh remote values</string>
<string name="preferences__internal_refresh_remote_values_description" translatable="false">Forces a refresh of remote values locally instead of waiting for the elapsed time</string>
<string name="preferences__internal_storage_service" translatable="false">Storage service</string>
<string name="preferences__internal_force_storage_service_sync" translatable="false">Overwrite remote data</string>
<string name="preferences__internal_force_storage_service_sync_description" translatable="false">Forces remote storage to match the local device state.</string>

View File

@ -14,6 +14,12 @@
android:key="pref_rotate_profile_key"
android:summary="@string/preferences__internal_rotate_profile_key_description"
android:title="@string/preferences__internal_rotate_profile_key" />
<Preference
android:key="pref_refresh_remote_values"
android:summary="@string/preferences__internal_refresh_remote_values_description"
android:title="@string/preferences__internal_refresh_remote_values" />
</PreferenceCategory>
<PreferenceCategory