| Index: sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java
|
| diff --git a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java
|
| index f67be2f08306df41045d56948d3b136badeca413..f1e9fc8ad5c2ae098d30e81688548f3ab8d98f44 100644
|
| --- a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java
|
| +++ b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java
|
| @@ -143,18 +143,46 @@ public class MockAccountManager implements AccountManagerDelegate {
|
| public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
|
| AccountHolder accountHolder =
|
| AccountHolder.create().account(account).password(password).build();
|
| - return addAccountHolderExplicitly(accountHolder);
|
| + return addAccountHolderExplicitly(accountHolder, false);
|
| }
|
|
|
| public boolean addAccountHolderExplicitly(AccountHolder accountHolder) {
|
| + return addAccountHolderExplicitly(accountHolder, false);
|
| + }
|
| +
|
| + /**
|
| + * Add an AccountHolder directly.
|
| + *
|
| + * @param accountHolder the account holder to add
|
| + * @param broadcastEvent whether to broadcast an AccountChangedEvent
|
| + * @return whether the account holder was added successfully
|
| + */
|
| + public boolean addAccountHolderExplicitly(AccountHolder accountHolder,
|
| + boolean broadcastEvent) {
|
| boolean result = mAccounts.add(accountHolder);
|
| - postAsyncAccountChangedEvent();
|
| + if (broadcastEvent) {
|
| + postAsyncAccountChangedEvent();
|
| + }
|
| return result;
|
| }
|
|
|
| public boolean removeAccountHolderExplicitly(AccountHolder accountHolder) {
|
| + return removeAccountHolderExplicitly(accountHolder, false);
|
| + }
|
| +
|
| + /**
|
| + * Remove an AccountHolder directly.
|
| + *
|
| + * @param accountHolder the account holder to remove
|
| + * @param broadcastEvent whether to broadcast an AccountChangedEvent
|
| + * @return whether the account holder was removed successfully
|
| + */
|
| + public boolean removeAccountHolderExplicitly(AccountHolder accountHolder,
|
| + boolean broadcastEvent) {
|
| boolean result = mAccounts.remove(accountHolder);
|
| - postAsyncAccountChangedEvent();
|
| + if (broadcastEvent) {
|
| + postAsyncAccountChangedEvent();
|
| + }
|
| return result;
|
| }
|
|
|
|
|