Commit d96ef704 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][Signin] Use consistent name for account email variable

This CL changes the current variable name accountId to accountEmail so
that we can have a consistent name for account email.

Bug: 1131344
Change-Id: I652755e7485673d6611622f5bd60aceda5d849ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550827Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829639}
parent a43e8a57
...@@ -114,8 +114,8 @@ public class AssistantHeaderCoordinator implements ProfileDataCache.Observer { ...@@ -114,8 +114,8 @@ public class AssistantHeaderCoordinator implements ProfileDataCache.Observer {
} }
@Override @Override
public void onProfileDataUpdated(String account) { public void onProfileDataUpdated(String accountEmail) {
if (!mSignedInAccountName.equals(account)) { if (!mSignedInAccountName.equals(accountEmail)) {
return; return;
} }
setProfileImageFor(mSignedInAccountName); setProfileImageFor(mSignedInAccountName);
......
...@@ -257,7 +257,7 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs ...@@ -257,7 +257,7 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
// ProfileDataCache.Observer implementation. // ProfileDataCache.Observer implementation.
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
triggerPromoUpdate(); triggerPromoUpdate();
} }
......
...@@ -67,8 +67,8 @@ public class ChromePickerAdapter extends PickerAdapter implements ProfileDataCac ...@@ -67,8 +67,8 @@ public class ChromePickerAdapter extends PickerAdapter implements ProfileDataCac
// ProfileDataCache.Observer: // ProfileDataCache.Observer:
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
if (!mWaitingOnOwnerInfo || !TextUtils.equals(accountId, getOwnerEmail())) { if (!mWaitingOnOwnerInfo || !TextUtils.equals(accountEmail, getOwnerEmail())) {
return; return;
} }
......
...@@ -412,7 +412,7 @@ public class RecentTabsManager implements AndroidSyncSettingsObserver, SignInSta ...@@ -412,7 +412,7 @@ public class RecentTabsManager implements AndroidSyncSettingsObserver, SignInSta
// ProfileDataCache.Observer implementation. // ProfileDataCache.Observer implementation.
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
update(); update();
} }
......
...@@ -271,7 +271,7 @@ public abstract class SignInPromo extends OptionalLeaf { ...@@ -271,7 +271,7 @@ public abstract class SignInPromo extends OptionalLeaf {
// ProfileDataCache.Observer implementation. // ProfileDataCache.Observer implementation.
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
notifyDataChanged(); notifyDataChanged();
} }
} }
......
...@@ -53,9 +53,9 @@ public class ProfileDataCache implements ProfileDownloader.Observer, ProfileData ...@@ -53,9 +53,9 @@ public class ProfileDataCache implements ProfileDownloader.Observer, ProfileData
public interface Observer { public interface Observer {
/** /**
* Notifies that an account's profile data has been updated. * Notifies that an account's profile data has been updated.
* @param accountId An account ID. * @param accountEmail An account email.
*/ */
void onProfileDataUpdated(String accountId); void onProfileDataUpdated(String accountEmail);
} }
/** /**
...@@ -162,7 +162,6 @@ public class ProfileDataCache implements ProfileDownloader.Observer, ProfileData ...@@ -162,7 +162,6 @@ public class ProfileDataCache implements ProfileDownloader.Observer, ProfileData
* @param badgeResId Resource id of the badge to be attached. If it is 0 then no badge is * @param badgeResId Resource id of the badge to be attached. If it is 0 then no badge is
* attached * attached
*/ */
@MainThread
public void updateBadgeConfig(@DrawableRes int badgeResId) { public void updateBadgeConfig(@DrawableRes int badgeResId) {
ThreadUtils.assertOnUiThread(); ThreadUtils.assertOnUiThread();
assert mBadgeConfig != null; assert mBadgeConfig != null;
...@@ -243,21 +242,21 @@ public class ProfileDataCache implements ProfileDownloader.Observer, ProfileData ...@@ -243,21 +242,21 @@ public class ProfileDataCache implements ProfileDownloader.Observer, ProfileData
} }
@Override @Override
public void onProfileDownloaded(String accountId, String fullName, String givenName, public void onProfileDownloaded(
Bitmap bitmap) { String accountEmail, String fullName, String givenName, Bitmap bitmap) {
ThreadUtils.assertOnUiThread(); ThreadUtils.assertOnUiThread();
updateCachedProfileDataAndNotifyObservers(new DisplayableProfileData( updateCachedProfileDataAndNotifyObservers(new DisplayableProfileData(
accountId, prepareAvatar(bitmap, accountId), fullName, givenName)); accountEmail, prepareAvatar(bitmap, accountEmail), fullName, givenName));
} }
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
assert mProfileDataSource != null; assert mProfileDataSource != null;
ProfileDataSource.ProfileData profileData = ProfileDataSource.ProfileData profileData =
mProfileDataSource.getProfileDataForAccount(accountId); mProfileDataSource.getProfileDataForAccount(accountEmail);
if (profileData == null) { if (profileData == null) {
mCachedProfileData.remove(accountId); mCachedProfileData.remove(accountEmail);
notifyObservers(accountId); notifyObservers(accountEmail);
} else { } else {
updateCachedProfileDataAndNotifyObservers(createDisplayableProfileData(profileData)); updateCachedProfileDataAndNotifyObservers(createDisplayableProfileData(profileData));
} }
......
...@@ -30,13 +30,13 @@ public class ProfileDownloader { ...@@ -30,13 +30,13 @@ public class ProfileDownloader {
public interface Observer { public interface Observer {
/** /**
* Notifies that an account data in the profile has been updated. * Notifies that an account data in the profile has been updated.
* @param accountId An account ID. * @param accountEmail An account email.
* @param fullName A full name. * @param fullName A full name.
* @param givenName A given name. * @param givenName A given name.
* @param bitmap A user picture. * @param bitmap A user picture.
*/ */
void onProfileDownloaded( void onProfileDownloaded(
String accountId, String fullName, String givenName, Bitmap bitmap); String accountEmail, String fullName, String givenName, Bitmap bitmap);
} }
/** /**
......
...@@ -400,7 +400,7 @@ public class AccountManagementFragment extends PreferenceFragmentCompat ...@@ -400,7 +400,7 @@ public class AccountManagementFragment extends PreferenceFragmentCompat
// ProfileDataCache.Observer implementation: // ProfileDataCache.Observer implementation:
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
updateAccountsList(); updateAccountsList();
} }
......
...@@ -253,7 +253,7 @@ public class SignInPreference ...@@ -253,7 +253,7 @@ public class SignInPreference
// ProfileDataCache.Observer implementation. // ProfileDataCache.Observer implementation.
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
update(); update();
} }
......
...@@ -184,7 +184,7 @@ public class SyncErrorCardPreference extends Preference ...@@ -184,7 +184,7 @@ public class SyncErrorCardPreference extends Preference
* {@link ProfileDataCache.Observer} implementation. * {@link ProfileDataCache.Observer} implementation.
*/ */
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
update(); update();
} }
} }
...@@ -213,7 +213,7 @@ public class SyncPromoPreference ...@@ -213,7 +213,7 @@ public class SyncPromoPreference
// ProfileDataCache.Observer implementation. // ProfileDataCache.Observer implementation.
@Override @Override
public void onProfileDataUpdated(String accountId) { public void onProfileDataUpdated(String accountEmail) {
update(); update();
} }
......
...@@ -71,9 +71,9 @@ public interface ProfileDataSource { ...@@ -71,9 +71,9 @@ public interface ProfileDataSource {
interface Observer { interface Observer {
/** /**
* Notifies that an account's profile data has been updated. * Notifies that an account's profile data has been updated.
* @param accountId An account ID. * @param accountEmail An account email.
*/ */
void onProfileDataUpdated(String accountId); void onProfileDataUpdated(String accountEmail);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment