@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncRecordKey that = (SyncRecordKey) o; if (account != null ? !account.equals(that.account) : that.account != null) return false; return authority != null ? authority.equals(that.authority) : that.authority == null; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthTokenRecord that = (AuthTokenRecord) o; return userId == that.userId && account.equals(that.account) && authTokenType.equals(that.authTokenType) && packageName.equals(that.packageName); }
private void setPasswordInternal(int userId, Account account, String password) { synchronized (accountsByUserId) { VAccount vAccount = getAccount(userId, account); if (vAccount != null) { vAccount.password = password; vAccount.authTokens.clear(); saveAllAccounts(); synchronized (authTokenRecords) { Iterator<AuthTokenRecord> iterator = authTokenRecords.iterator(); while (iterator.hasNext()) { AuthTokenRecord record = iterator.next(); if (record.userId == userId && record.account.equals(account)) { iterator.remove(); } } } sendAccountsChangedBroadcast(userId); } } }
private Account renameAccountInternal(int userId, Account accountToRename, String newName) { // TODO: Cancel Notification synchronized (accountsByUserId) { VAccount vAccount = getAccount(userId, accountToRename); if (vAccount != null) { vAccount.previousName = vAccount.name; vAccount.name = newName; saveAllAccounts(); Account newAccount = new Account(vAccount.name, vAccount.type); synchronized (authTokenRecords) { for (AuthTokenRecord record : authTokenRecords) { if (record.userId == userId && record.account.equals(accountToRename)) { record.account = newAccount; } } } sendAccountsChangedBroadcast(userId); return newAccount; } } return accountToRename; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncRecordKey that = (SyncRecordKey) o; if (account != null ? !account.equals(that.account) : that.account != null) return false; return authority != null ? authority.equals(that.authority) : that.authority == null; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncRecordKey that = (SyncRecordKey) o; if (account != null ? !account.equals(that.account) : that.account != null) return false; return authority != null ? authority.equals(that.authority) : that.authority == null; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthTokenRecord that = (AuthTokenRecord) o; return userId == that.userId && account.equals(that.account) && authTokenType.equals(that.authTokenType) && packageName.equals(that.packageName); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthTokenRecord that = (AuthTokenRecord) o; return userId == that.userId && account.equals(that.account) && authTokenType.equals(that.authTokenType) && packageName.equals(that.packageName); }
private static boolean accountExists(Context context, Account account) { Account[] accounts = AccountManagerHelper.get(context).getGoogleAccounts(); for (Account a : accounts) { if (a.equals(account)) { return true; } } return false; }
private void setPasswordInternal(int userId, Account account, String password) { synchronized (accountsByUserId) { VAccount vAccount = getAccount(userId, account); if (vAccount != null) { vAccount.password = password; vAccount.authTokens.clear(); saveAllAccounts(); synchronized (authTokenRecords) { Iterator<AuthTokenRecord> iterator = authTokenRecords.iterator(); while (iterator.hasNext()) { AuthTokenRecord record = iterator.next(); if (record.userId == userId && record.account.equals(account)) { iterator.remove(); } } } sendAccountsChangedBroadcast(userId); } } }
private void setPasswordInternal(int userId, Account account, String password) { synchronized (accountsByUserId) { VAccount vAccount = getAccount(userId, account); if (vAccount != null) { vAccount.password = password; vAccount.authTokens.clear(); saveAllAccounts(); synchronized (authTokenRecords) { Iterator<AuthTokenRecord> iterator = authTokenRecords.iterator(); while (iterator.hasNext()) { AuthTokenRecord record = iterator.next(); if (record.userId == userId && record.account.equals(account)) { iterator.remove(); } } } sendAccountsChangedBroadcast(userId); } } }
boolean accountExists = false; for (Account account : accounts) { if(account.equals(currentAccount)){ accountExists = true; break;
private Account renameAccountInternal(int userId, Account accountToRename, String newName) { // TODO: Cancel Notification synchronized (accountsByUserId) { VAccount vAccount = getAccount(userId, accountToRename); if (vAccount != null) { vAccount.previousName = vAccount.name; vAccount.name = newName; saveAllAccounts(); Account newAccount = new Account(vAccount.name, vAccount.type); synchronized (authTokenRecords) { for (AuthTokenRecord record : authTokenRecords) { if (record.userId == userId && record.account.equals(accountToRename)) { record.account = newAccount; } } } sendAccountsChangedBroadcast(userId); return newAccount; } } return accountToRename; }
private Account renameAccountInternal(int userId, Account accountToRename, String newName) { // TODO: Cancel Notification synchronized (accountsByUserId) { VAccount vAccount = getAccount(userId, accountToRename); if (vAccount != null) { vAccount.previousName = vAccount.name; vAccount.name = newName; saveAllAccounts(); Account newAccount = new Account(vAccount.name, vAccount.type); synchronized (authTokenRecords) { for (AuthTokenRecord record : authTokenRecords) { if (record.userId == userId && record.account.equals(accountToRename)) { record.account = newAccount; } } } sendAccountsChangedBroadcast(userId); return newAccount; } } return accountToRename; }
if (extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE)) { Account signedInAccount = ChromeSigninController.get(getContext()).getSignedInUser(); if (account.equals(signedInAccount)) { ContentResolver.setIsSyncable(account, authority, 1); } else {
if(account != null && !account.equals(currentAccount)) { currentAccount = account; viewModel.username.set(userManager.getUsername(account));