Cw 155 monero synchronization (#1014)

* Run Monero Synchronization task in background on Android

* Add monero sync task in the load function to be registered/cancelled when user changes wallets

* Revert unused file changes

* Register Sync task on all monero wallets if any

* Add Sync Modes and change task frequency based on user's choice

* Register background task after current wallet is set

* Add Sync All toggle and change task wallets to sync accordingly

* Enable background notifications in release mode temporarily

* Disable constraints and increase the frequency of tasks

* Decrease frequency of background tasks

* Delay the background task thread till the syncing thread finish (Dummy Trial-1)

* Start Sync process and wait for it to finish

* Wait for synchronization to finish before ending the background thread
Add 10 minutes timeout duration for sync process

* Connect to node before syncing wallet

* replace testing configuration with the configurations agreed on

* Fix Conflicts with main

* Update and Migrate Background tasks to null safety

* Update workmanager version in pubspec_base also

* Move Sync options to Connection and sync page
Show Sync options only for Monero and Haven
Minor Enhancements

* Remove debugging notifications
Revert aggressive mode frequency to 6 hours [skip ci]

* Add iOS configs

* Revert debugging changes
Fix conflicts with main

* Add/Extract Sync configurations to/from backup file [skip ci]
This commit is contained in:
Omar Hatem 2023-08-04 20:55:56 +03:00 committed by GitHub
parent 68a057b91b
commit aedf310c9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 593 additions and 190 deletions

View file

@ -243,6 +243,8 @@ class BackupService {
final sortBalanceTokensBy = data[PreferencesKey.sortBalanceBy] as int?;
final pinNativeTokenAtTop = data[PreferencesKey.pinNativeTokenAtTop] as bool?;
final useEtherscan = data[PreferencesKey.useEtherscan] as bool?;
final syncAll = data[PreferencesKey.syncAllKey] as bool?;
final syncMode = data[PreferencesKey.syncModeKey] as int?;
await _sharedPreferences.setString(PreferencesKey.currentWalletName, currentWalletName);
@ -361,6 +363,12 @@ class BackupService {
if (useEtherscan != null)
await _sharedPreferences.setBool(PreferencesKey.useEtherscan, useEtherscan);
if (syncAll != null)
await _sharedPreferences.setBool(PreferencesKey.syncAllKey, syncAll);
if (syncMode != null)
await _sharedPreferences.setInt(PreferencesKey.syncModeKey, syncMode);
await preferencesFile.delete();
}
@ -510,6 +518,10 @@ class BackupService {
_sharedPreferences.getBool(PreferencesKey.pinNativeTokenAtTop),
PreferencesKey.useEtherscan:
_sharedPreferences.getBool(PreferencesKey.useEtherscan),
PreferencesKey.syncModeKey:
_sharedPreferences.getInt(PreferencesKey.syncModeKey),
PreferencesKey.syncAllKey:
_sharedPreferences.getBool(PreferencesKey.syncAllKey),
};
return json.encode(preferences);