Allow to update accounts and general preferences atomically
AccountsUpdate now also supports to update general preferences. This means account properties and general preferences can now be updated in the same transaction. Reading and writing general preferences is now done via AccountConfig. On load we always read the preferences.config file, but parsing it is done lazily when the general preferences are accessed for the first time. Most callers that load accounts are not interested in general preferences and this avoids unneeded parsing effort for them. PreferencesConfig encapsules all details about parsing and storing general preferences and also provides means to read and update the default general preferences. Change-Id: Ic0f2adfe4e96311af0c5bfa061fc7c0ca60d91fa Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -424,11 +424,8 @@ public class AccountsUpdate {
|
||||
|
||||
private AccountConfig read(Repository allUsersRepo, Account.Id accountId)
|
||||
throws IOException, ConfigInvalidException {
|
||||
AccountConfig accountConfig = new AccountConfig(accountId);
|
||||
accountConfig.load(allUsersRepo);
|
||||
|
||||
AccountConfig accountConfig = new AccountConfig(accountId, allUsersRepo).load();
|
||||
afterReadRevision.run();
|
||||
|
||||
return accountConfig;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user