diff --git a/src/com/fsck/k9/preferences/StorageImporterEncryptedXml.java b/src/com/fsck/k9/preferences/StorageImporterEncryptedXml.java index f09836fc3..af7977e0e 100644 --- a/src/com/fsck/k9/preferences/StorageImporterEncryptedXml.java +++ b/src/com/fsck/k9/preferences/StorageImporterEncryptedXml.java @@ -23,6 +23,15 @@ public class StorageImporterEncryptedXml implements IStorageImporter { String data = dataset.data.toString(); List accountNumbers = Account.getExistingAccountNumbers(preferences); Log.i(K9.LOG_TAG, "Existing accountNumbers = " + accountNumbers); + /** + * We translate UUIDs in the import file into new UUIDs in the local instance for the following reasons: + * 1) Accidentally importing the same file twice cannot damage settings in an existing account. + * (Say, an account that was imported two months ago and has since had significant settings changes.) + * 2) All UUIDs used in the local instance will be generated with the same generator. + * 3) Importing a single file multiple times allows for creating multiple accounts from the same template. + * 4) Exporting an account and importing back into the same instance is a poor-man's account copy (until a real + * copy function is created, if ever) + */ Map uuidMapping = new HashMap(); String accountUuids = preferences.getPreferences().getString("accountUuids", null);