mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 11:33:39 +00:00
FCM preference added to the backup.
This commit is contained in:
parent
acd8603ee3
commit
20088285b9
@ -4,11 +4,11 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data>
|
||||
<import type="org.thoughtcrime.securesms.loki.activities.RestoreBackupViewModel"/>
|
||||
<import type="org.thoughtcrime.securesms.loki.activities.BackupRestoreViewModel"/>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.thoughtcrime.securesms.loki.activities.RestoreBackupViewModel" />
|
||||
type="org.thoughtcrime.securesms.loki.activities.BackupRestoreViewModel" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -44,7 +44,7 @@ class BackupRestoreActivity : BaseActionBarActivity() {
|
||||
private const val REQUEST_CODE_BACKUP_FILE = 779955
|
||||
}
|
||||
|
||||
private val viewModel by viewModels<RestoreBackupViewModel>()
|
||||
private val viewModel by viewModels<BackupRestoreViewModel>()
|
||||
|
||||
// region Lifecycle
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -129,8 +129,6 @@ class BackupRestoreActivity : BaseActionBarActivity() {
|
||||
)
|
||||
DatabaseFactory.upgradeRestored(context, database)
|
||||
NotificationChannels.restoreContactNotificationChannels(context)
|
||||
// TextSecurePreferences.setBackupEnabled(context, true)
|
||||
// TextSecurePreferences.setBackupPassphrase(context, passphrase)
|
||||
TextSecurePreferences.setRestorationTime(context, System.currentTimeMillis())
|
||||
|
||||
BackupImportResult.SUCCESS
|
||||
@ -150,7 +148,6 @@ class BackupRestoreActivity : BaseActionBarActivity() {
|
||||
TextSecurePreferences.setHasViewedSeed(context, true)
|
||||
TextSecurePreferences.setHasSeenWelcomeScreen(context, true)
|
||||
TextSecurePreferences.setPromptedPushRegistration(context, true)
|
||||
TextSecurePreferences.setIsUsingFCM(context, true)
|
||||
TextSecurePreferences.setHasSeenMultiDeviceRemovalSheet(context)
|
||||
TextSecurePreferences.setHasSeenLightThemeIntroSheet(context)
|
||||
val application = ApplicationContext.getInstance(context)
|
||||
@ -188,7 +185,7 @@ class BackupRestoreActivity : BaseActionBarActivity() {
|
||||
// endregion
|
||||
}
|
||||
|
||||
class RestoreBackupViewModel(application: Application): AndroidViewModel(application) {
|
||||
class BackupRestoreViewModel(application: Application): AndroidViewModel(application) {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
|
@ -1346,19 +1346,20 @@ public class TextSecurePreferences {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
final String prefsFileName;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
prefsFileName = PreferenceManager.getDefaultSharedPreferencesName(context);
|
||||
} else {
|
||||
prefsFileName = context.getPackageName() + "_preferences";
|
||||
}
|
||||
|
||||
final LinkedList<BackupProtos.SharedPreference> prefList = new LinkedList<>();
|
||||
addBackupEntryInt (prefList, preferences, prefsFileName, LOCAL_REGISTRATION_ID_PREF);
|
||||
addBackupEntryString(prefList, preferences, prefsFileName, LOCAL_NUMBER_PREF);
|
||||
addBackupEntryString(prefList, preferences, prefsFileName, PROFILE_NAME_PREF);
|
||||
addBackupEntryString(prefList, preferences, prefsFileName, PROFILE_AVATAR_URL_PREF);
|
||||
addBackupEntryInt (prefList, preferences, prefsFileName, PROFILE_AVATAR_ID_PREF);
|
||||
addBackupEntryString(prefList, preferences, prefsFileName, PROFILE_KEY_PREF);
|
||||
addBackupEntryInt (prefList, preferences, prefsFileName, LOCAL_REGISTRATION_ID_PREF);
|
||||
addBackupEntryString (prefList, preferences, prefsFileName, LOCAL_NUMBER_PREF);
|
||||
addBackupEntryString (prefList, preferences, prefsFileName, PROFILE_NAME_PREF);
|
||||
addBackupEntryString (prefList, preferences, prefsFileName, PROFILE_AVATAR_URL_PREF);
|
||||
addBackupEntryInt (prefList, preferences, prefsFileName, PROFILE_AVATAR_ID_PREF);
|
||||
addBackupEntryString (prefList, preferences, prefsFileName, PROFILE_KEY_PREF);
|
||||
addBackupEntryBoolean(prefList, preferences, prefsFileName, IS_USING_FCM);
|
||||
|
||||
return prefList;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user