mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Show backup progress as a percentage.
This commit is contained in:
committed by
Greyson Parrelli
parent
4f73e36d72
commit
8014a70134
@@ -230,6 +230,31 @@ public class TextSecurePreferences {
|
||||
MEDIA_DOWNLOAD_WIFI_PREF,
|
||||
MEDIA_DOWNLOAD_ROAMING_PREF};
|
||||
|
||||
public static long getPreferencesToSaveToBackupCount(@NonNull Context context) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
long count = 0;
|
||||
|
||||
for (String booleanPreference : booleanPreferencesToBackup) {
|
||||
if (preferences.contains(booleanPreference)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
for (String stringPreference : stringPreferencesToBackup) {
|
||||
if (preferences.contains(stringPreference)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
for (String stringSetPreference : stringSetPreferencesToBackup) {
|
||||
if (preferences.contains(stringSetPreference)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public static List<BackupProtos.SharedPreference> getPreferencesToSaveToBackup(@NonNull Context context) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
List<BackupProtos.SharedPreference> backupProtos = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user