mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 10:18:59 +03:00
re-order
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
f6d14856a4
commit
e70b61d7a3
1 changed files with 18 additions and 8 deletions
|
@ -92,14 +92,8 @@ class AccountRemovalWork(
|
||||||
val user = optionalUser.get()
|
val user = optionalUser.get()
|
||||||
backgroundJobManager.cancelPeriodicContactsBackup(user)
|
backgroundJobManager.cancelPeriodicContactsBackup(user)
|
||||||
val userRemoved = userAccountManager.removeUser(user)
|
val userRemoved = userAccountManager.removeUser(user)
|
||||||
if (userRemoved) {
|
|
||||||
eventBus.post(AccountRemovedEvent())
|
|
||||||
}
|
|
||||||
val storageManager = FileDataStorageManager(user.toPlatformAccount(), context.contentResolver)
|
val storageManager = FileDataStorageManager(user.toPlatformAccount(), context.contentResolver)
|
||||||
// remove all files
|
|
||||||
removeFiles(user, storageManager)
|
|
||||||
// delete all database entries
|
|
||||||
storageManager.deleteAllFiles()
|
|
||||||
// disable daily backup
|
// disable daily backup
|
||||||
arbitraryDataProvider.storeOrUpdateKeyValue(
|
arbitraryDataProvider.storeOrUpdateKeyValue(
|
||||||
user.accountName,
|
user.accountName,
|
||||||
|
@ -108,15 +102,26 @@ class AccountRemovalWork(
|
||||||
)
|
)
|
||||||
// unregister push notifications
|
// unregister push notifications
|
||||||
unregisterPushNotifications(context, user, arbitraryDataProvider)
|
unregisterPushNotifications(context, user, arbitraryDataProvider)
|
||||||
|
|
||||||
// remove pending account removal
|
// remove pending account removal
|
||||||
arbitraryDataProvider.deleteKeyForAccount(user.accountName, ManageAccountsActivity.PENDING_FOR_REMOVAL)
|
arbitraryDataProvider.deleteKeyForAccount(user.accountName, ManageAccountsActivity.PENDING_FOR_REMOVAL)
|
||||||
|
|
||||||
// remove synced folders set for account
|
// remove synced folders set for account
|
||||||
remoceSyncedFolders(context, user.toPlatformAccount(), clock)
|
remoceSyncedFolders(context, user.toPlatformAccount(), clock)
|
||||||
|
|
||||||
// delete all uploads for account
|
// delete all uploads for account
|
||||||
uploadsStorageManager.removeAccountUploads(user.toPlatformAccount())
|
uploadsStorageManager.removeAccountUploads(user.toPlatformAccount())
|
||||||
// delete stored E2E keys
|
|
||||||
|
// delete stored E2E keys and mnemonic
|
||||||
arbitraryDataProvider.deleteKeyForAccount(user.accountName, EncryptionUtils.PRIVATE_KEY)
|
arbitraryDataProvider.deleteKeyForAccount(user.accountName, EncryptionUtils.PRIVATE_KEY)
|
||||||
arbitraryDataProvider.deleteKeyForAccount(user.accountName, EncryptionUtils.PUBLIC_KEY)
|
arbitraryDataProvider.deleteKeyForAccount(user.accountName, EncryptionUtils.PUBLIC_KEY)
|
||||||
|
arbitraryDataProvider.deleteKeyForAccount(user.accountName, EncryptionUtils.MNEMONIC)
|
||||||
|
|
||||||
|
// remove all files
|
||||||
|
removeFiles(user, storageManager)
|
||||||
|
// delete all database entries
|
||||||
|
storageManager.deleteAllFiles()
|
||||||
|
|
||||||
if (remoteWipe) {
|
if (remoteWipe) {
|
||||||
val optionalClient = createClient(user)
|
val optionalClient = createClient(user)
|
||||||
if (optionalClient.isPresent) {
|
if (optionalClient.isPresent) {
|
||||||
|
@ -127,6 +132,11 @@ class AccountRemovalWork(
|
||||||
}
|
}
|
||||||
// notify Document Provider
|
// notify Document Provider
|
||||||
DocumentsStorageProvider.notifyRootsChanged(context)
|
DocumentsStorageProvider.notifyRootsChanged(context)
|
||||||
|
|
||||||
|
if (userRemoved) {
|
||||||
|
eventBus.post(AccountRemovedEvent())
|
||||||
|
}
|
||||||
|
|
||||||
return Result.success()
|
return Result.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue