Index: chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java |
index 998453bd1304a458ba387f0f8fb11433fbd3a8b6..48ba059f1af1a89cb2466a96b32ca6da8cd847be 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java |
@@ -22,12 +22,10 @@ import android.graphics.PorterDuff; |
import android.graphics.PorterDuffXfermode; |
import android.graphics.Rect; |
import android.graphics.drawable.BitmapDrawable; |
-import android.net.Uri; |
import android.os.Build; |
import android.os.Bundle; |
import android.os.UserManager; |
import android.preference.Preference; |
-import android.preference.Preference.OnPreferenceChangeListener; |
import android.preference.Preference.OnPreferenceClickListener; |
import android.preference.PreferenceFragment; |
import android.preference.PreferenceManager; |
@@ -37,22 +35,18 @@ import android.text.TextUtils; |
import android.util.Pair; |
import org.chromium.chrome.R; |
-import org.chromium.chrome.browser.IntentHandler; |
-import org.chromium.chrome.browser.UrlConstants; |
import org.chromium.chrome.browser.childaccounts.ChildAccountService; |
-import org.chromium.chrome.browser.document.ChromeLauncherActivity; |
import org.chromium.chrome.browser.preferences.ChromeBasePreference; |
-import org.chromium.chrome.browser.preferences.ChromeSwitchPreference; |
import org.chromium.chrome.browser.preferences.ManagedPreferenceDelegate; |
import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
import org.chromium.chrome.browser.preferences.Preferences; |
import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
+import org.chromium.chrome.browser.preferences.SyncPreference; |
import org.chromium.chrome.browser.profiles.Profile; |
import org.chromium.chrome.browser.profiles.ProfileAccountManagementMetrics; |
import org.chromium.chrome.browser.profiles.ProfileDownloader; |
import org.chromium.chrome.browser.signin.SignOutDialogFragment.SignOutDialogListener; |
import org.chromium.chrome.browser.signin.SigninManager.SignInStateObserver; |
-import org.chromium.chrome.browser.sync.GoogleServiceAuthError; |
import org.chromium.chrome.browser.sync.ProfileSyncService; |
import org.chromium.chrome.browser.sync.ProfileSyncService.SyncStateChangedListener; |
import org.chromium.chrome.browser.sync.ui.SyncCustomizationFragment; |
@@ -64,46 +58,41 @@ import java.util.ArrayList; |
import java.util.HashMap; |
/** |
- * The settings screen with information and settings related to the user's accounts. |
- * |
- * This shows which accounts the user is signed in with, allows the user to sign out of Chrome, |
- * links to sync settings, has links to add accounts and go incognito, and shows parental settings |
- * if a child account is in use. |
- * |
- * Note: This can be triggered from a web page, e.g. a GAIA sign-in page. |
+ * The settings screen with information and settings related to the user's accounts. This shows |
newt (away)
2016/02/12 22:03:50
Revert rewrapping of this comment. It's less reada
May
2016/02/16 17:32:07
I ran git cl format, and may have accidentally don
newt (away)
2016/02/16 23:05:01
Thanks. Ctrl+Shift+F on a whole file is pretty dan
|
+ * which accounts the user is signed in with, allows the user to sign out of Chrome, links to sync |
+ * settings, has links to add accounts and go incognito, and shows parental settings if a child |
+ * account is in use. Note: This can be triggered from a web page, e.g. a GAIA sign-in page. |
*/ |
-public class AccountManagementFragment extends PreferenceFragment |
- implements SignOutDialogListener, ProfileDownloader.Observer, |
- SyncStateChangedListener, SignInStateObserver { |
- |
+public class AccountManagementFragment |
newt (away)
2016/02/12 22:03:50
undo indentation changes
|
+ extends PreferenceFragment implements SignOutDialogListener, ProfileDownloader.Observer, |
+ SyncStateChangedListener, SignInStateObserver { |
public static final String SIGN_OUT_DIALOG_TAG = "sign_out_dialog_tag"; |
private static final String CLEAR_DATA_PROGRESS_DIALOG_TAG = "clear_data_progress"; |
/** |
- * The key for an integer value in |
- * {@link Preferences#EXTRA_SHOW_FRAGMENT_ARGUMENTS} bundle to |
- * specify the correct GAIA service that has triggered the dialog. |
- * If the argument is not set, GAIA_SERVICE_TYPE_NONE is used as the origin of the dialog. |
+ * The key for an integer value in {@link Preferences#EXTRA_SHOW_FRAGMENT_ARGUMENTS} bundle to |
+ * specify the correct GAIA service that has triggered the dialog. If the argument is not set, |
+ * GAIA_SERVICE_TYPE_NONE is used as the origin of the dialog. |
*/ |
- private static final String SHOW_GAIA_SERVICE_TYPE_EXTRA = "ShowGAIAServiceType"; |
+ public static final String SHOW_GAIA_SERVICE_TYPE_EXTRA = "ShowGAIAServiceType"; |
/** |
- * The signin::GAIAServiceType value used in openAccountManagementScreen when the dialog |
- * hasn't been triggered from the content area. |
+ * The signin::GAIAServiceType value used in openAccountManagementScreen when the dialog hasn't |
+ * been triggered from the content area. |
*/ |
- private static final int GAIA_SERVICE_TYPE_NONE = 0; |
+ public static final int GAIA_SERVICE_TYPE_NONE = 0; |
/** |
- * Account name preferences will be ordered sequentially, starting with this "order" value. |
- * This ensures that the account name preferences appear in the correct location in the |
- * preference fragment. See account_management_preferences.xml for details. |
+ * Account name preferences will be ordered sequentially, starting with this "order" value. This |
+ * ensures that the account name preferences appear in the correct location in the preference |
+ * fragment. See account_management_preferences.xml for details. |
*/ |
private static final int FIRST_ACCOUNT_PREF_ORDER = 100; |
/** |
- * SharedPreference name for the preference that disables signing out of Chrome. |
- * Signing out is forever disabled once Chrome signs the user in automatically |
- * if the device has a child account or if the device is an Android EDU device. |
+ * SharedPreference name for the preference that disables signing out of Chrome. Signing out is |
+ * forever disabled once Chrome signs the user in automatically if the device has a child |
+ * account or if the device is an Android EDU device. |
*/ |
private static final String SIGN_OUT_ALLOWED = "auto_signed_in_school_account"; |
@@ -113,21 +102,17 @@ public class AccountManagementFragment extends PreferenceFragment |
private static String sChildAccountId = null; |
private static Bitmap sCachedBadgedPicture = null; |
- public static final String PREF_GO_INCOGNITO = "go_incognito"; |
- |
- public static final String PREF_SIGN_OUT_SWITCH = "sign_out_switch"; |
- public static final String PREF_SIGN_IN_CHILD_MESSAGE = "sign_in_child_message"; |
+ public static final String PREF_SIGN_OUT = "sign_out"; |
public static final String PREF_ADD_ACCOUNT = "add_account"; |
- public static final String PREF_NOT_YOU = "not_you"; |
public static final String PREF_PARENTAL_SETTINGS = "parental_settings"; |
public static final String PREF_PARENT_ACCOUNTS = "parent_accounts"; |
public static final String PREF_CHILD_CONTENT = "child_content"; |
public static final String PREF_CHILD_SAFE_SITES = "child_safe_sites"; |
+ public static final String PREF_SYNC_SETTINGS = "sync_settings"; |
private int mGaiaServiceType; |
private ArrayList<Preference> mAccountsListPreferences = new ArrayList<Preference>(); |
- private Preference mPrimaryAccountPreference; |
@Override |
public void onCreate(Bundle savedState) { |
@@ -171,8 +156,9 @@ public class AccountManagementFragment extends PreferenceFragment |
} |
/** |
- * Initiate fetching the user accounts data (images and the full name). |
- * Fetched data will be sent to observers of ProfileDownloader. |
+ * Initiate fetching the user accounts data (images and the full name). Fetched data will be |
+ * sent to observers of ProfileDownloader. |
+ * |
* @param profile Profile to use. |
*/ |
private static void startFetchingAccountsInformation(Context context, Profile profile) { |
@@ -210,8 +196,8 @@ public class AccountManagementFragment extends PreferenceFragment |
configureSignOutSwitch(); |
configureAddAccountPreference(fullName); |
- configureGoIncognitoPreferences(fullName); |
configureChildAccountPreferences(); |
+ configureSyncSettings(); |
updateAccountsList(); |
} |
@@ -228,21 +214,15 @@ public class AccountManagementFragment extends PreferenceFragment |
private void configureSignOutSwitch() { |
boolean isChildAccount = ChildAccountService.isChildAccount(); |
- ChromeSwitchPreference signOutSwitch = |
- (ChromeSwitchPreference) findPreference(PREF_SIGN_OUT_SWITCH); |
+ Preference signOutSwitch = findPreference(PREF_SIGN_OUT); |
if (isChildAccount) { |
getPreferenceScreen().removePreference(signOutSwitch); |
} else { |
- getPreferenceScreen().removePreference(findPreference(PREF_SIGN_IN_CHILD_MESSAGE)); |
- signOutSwitch.setChecked(true); |
signOutSwitch.setEnabled(getSignOutAllowedPreferenceValue(getActivity())); |
- signOutSwitch.setSummary(canAddAccounts() ? R.string.sign_in_accounts_message |
- : R.string.sign_in_accounts_message_managed); |
- signOutSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { |
+ signOutSwitch.setOnPreferenceClickListener(new OnPreferenceClickListener() { |
@Override |
- public boolean onPreferenceChange(Preference preference, Object newValue) { |
+ public boolean onPreferenceClick(Preference preference) { |
if (!isVisible() || !isResumed()) return false; |
- if ((boolean) newValue) return true; |
if (ChromeSigninController.get(getActivity()).isSignedIn() |
&& getSignOutAllowedPreferenceValue(getActivity())) { |
@@ -251,19 +231,49 @@ public class AccountManagementFragment extends PreferenceFragment |
mGaiaServiceType); |
SignOutDialogFragment signOutFragment = new SignOutDialogFragment(); |
+ Bundle args = new Bundle(); |
+ args.putInt(SHOW_GAIA_SERVICE_TYPE_EXTRA, mGaiaServiceType); |
+ signOutFragment.setArguments(args); |
+ |
signOutFragment.setTargetFragment(AccountManagementFragment.this, 0); |
signOutFragment.show(getFragmentManager(), SIGN_OUT_DIALOG_TAG); |
+ return true; |
} |
- // Return false to prevent the switch from updating. The |
- // AccountManagementFragment is hidden when the user signs out of Chrome, so the |
- // switch never actually needs to be updated. |
return false; |
} |
+ |
}); |
} |
} |
+ private void configureSyncSettings() { |
+ SyncPreference pref = (SyncPreference) findPreference(PREF_SYNC_SETTINGS); |
+ final Preferences activity = (Preferences) getActivity(); |
newt (away)
2016/02/12 22:03:50
It doesn't look like you need this cast. It's much
May
2016/02/16 17:32:07
I do need the cast (because I need a Preferences o
newt (away)
2016/02/16 23:05:01
Oh, I see. In that case, maybe call this "preferen
|
+ final Account account = ChromeSigninController.get(getActivity()).getSignedInUser(); |
+ |
+ pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { |
+ @Override |
+ public boolean onPreferenceClick(Preference preference) { |
+ if (!isVisible() || !isResumed()) return false; |
+ |
+ if (ProfileSyncService.get() == null) return true; |
+ |
+ if (AndroidSyncSettings.isMasterSyncEnabled(activity)) { |
+ Bundle args = new Bundle(); |
+ args.putString(SyncCustomizationFragment.ARGUMENT_ACCOUNT, account.name); |
+ activity.startFragment(SyncCustomizationFragment.class.getName(), args); |
+ } else { |
+ Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS); |
+ intent.putExtra("account_types", new String[] {"com.google"}); |
newt (away)
2016/02/12 22:03:50
is there not a constant you can use instead of har
May
2016/02/16 17:32:07
Moved this code from a different file, but I'll ch
|
+ activity.startActivity(intent); |
+ } |
+ |
+ return true; |
+ } |
+ }); |
+ } |
+ |
private void configureAddAccountPreference(String fullName) { |
ChromeBasePreference addAccount = (ChromeBasePreference) findPreference(PREF_ADD_ACCOUNT); |
@@ -302,59 +312,6 @@ public class AccountManagementFragment extends PreferenceFragment |
} |
} |
- private void configureGoIncognitoPreferences(String fullName) { |
- boolean isChildAccount = ChildAccountService.isChildAccount(); |
- Preference notYouPref = findPreference(PREF_NOT_YOU); |
- ChromeBasePreference goIncognito = (ChromeBasePreference) findPreference(PREF_GO_INCOGNITO); |
- |
- if (isChildAccount) { |
- getPreferenceScreen().removePreference(notYouPref); |
- getPreferenceScreen().removePreference(goIncognito); |
- } else { |
- notYouPref.setTitle( |
- getResources().getString(R.string.account_management_not_you_text, fullName)); |
- goIncognito.setOnPreferenceClickListener(new OnPreferenceClickListener() { |
- @Override |
- public boolean onPreferenceClick(Preference preference) { |
- if (!isVisible() || !isResumed()) return false; |
- if (!PrefServiceBridge.getInstance().isIncognitoModeEnabled()) return false; |
- |
- AccountManagementScreenHelper.logEvent( |
- ProfileAccountManagementMetrics.GO_INCOGNITO, |
- mGaiaServiceType); |
- openIncognitoTab(getActivity()); |
- if (isAdded()) getActivity().finish(); |
- |
- return true; |
- } |
- }); |
- goIncognito.setManagedPreferenceDelegate(new ManagedPreferenceDelegate() { |
- @Override |
- public boolean isPreferenceControlledByPolicy(Preference preference) { |
- // Incognito mode can be enabled by policy, but this has no visible impact on |
- // the user. Thus, the managed icon is displayed only if incognito mode is |
- // disabled. |
- PrefServiceBridge prefs = PrefServiceBridge.getInstance(); |
- return prefs.isIncognitoModeManaged() && !prefs.isIncognitoModeEnabled(); |
- } |
- }); |
- } |
- } |
- |
- private static void openIncognitoTab(Activity activity) { |
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse( |
- IntentHandler.GOOGLECHROME_NAVIGATE_PREFIX + UrlConstants.NTP_URL)); |
- intent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, true); |
- intent.setPackage(activity.getApplicationContext().getPackageName()); |
- intent.setClassName(activity.getApplicationContext().getPackageName(), |
- ChromeLauncherActivity.class.getName()); |
- |
- intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT |
- | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK |
- | Intent.FLAG_ACTIVITY_CLEAR_TOP); |
- IntentHandler.startActivityForTrustedIntent(intent, activity); |
- } |
- |
private void configureChildAccountPreferences() { |
Preference parentAccounts = findPreference(PREF_PARENT_ACCOUNTS); |
Preference childContent = findPreference(PREF_CHILD_CONTENT); |
@@ -410,7 +367,6 @@ public class AccountManagementFragment extends PreferenceFragment |
prefScreen.removePreference(mAccountsListPreferences.get(i)); |
} |
mAccountsListPreferences.clear(); |
- mPrimaryAccountPreference = null; |
final Preferences activity = (Preferences) getActivity(); |
Account[] accounts = AccountManagerHelper.get(activity).getGoogleAccounts(); |
@@ -420,55 +376,28 @@ public class AccountManagementFragment extends PreferenceFragment |
ChromeBasePreference pref = new ChromeBasePreference(activity); |
pref.setTitle(account.name); |
- String signedInAccountName = |
- ChromeSigninController.get(getActivity()).getSignedInAccountName(); |
- boolean isPrimaryAccount = TextUtils.equals(account.name, signedInAccountName); |
boolean isChildAccount = ChildAccountService.isChildAccount(); |
pref.setIcon(new BitmapDrawable(getResources(), isChildAccount |
? getBadgedUserPicture(account.name) : getUserPicture(account.name))); |
- if (isPrimaryAccount) { |
- mPrimaryAccountPreference = pref; |
- pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { |
- @Override |
- public boolean onPreferenceClick(Preference preference) { |
- if (!isVisible() || !isResumed()) return false; |
- |
- AccountManagementScreenHelper.logEvent( |
- ProfileAccountManagementMetrics.CLICK_PRIMARY_ACCOUNT, |
- mGaiaServiceType); |
- |
- if (ProfileSyncService.get() == null) return true; |
+ pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { |
newt (away)
2016/02/12 22:03:50
Why do we launch Android sync settings when the us
May
2016/02/16 17:32:07
Yes, spec says, "Clicking on an individual account
|
+ @Override |
+ public boolean onPreferenceClick(Preference preference) { |
+ if (!isVisible() || !isResumed()) return false; |
- if (AndroidSyncSettings.isMasterSyncEnabled(activity)) { |
- Bundle args = new Bundle(); |
- args.putString( |
- SyncCustomizationFragment.ARGUMENT_ACCOUNT, account.name); |
- activity.startFragment(SyncCustomizationFragment.class.getName(), args); |
- } else { |
- Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS); |
- intent.putExtra("account_types", new String[]{"com.google"}); |
- activity.startActivity(intent); |
- } |
+ Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS); |
Bernhard Bauer
2016/02/03 14:37:39
Extract this into a shared method?
May
2016/02/16 17:32:07
Done.
|
+ intent.putExtra("account_types", new String[] {"com.google"}); |
+ activity.startActivity(intent); |
+ return true; |
+ } |
- return true; |
- } |
- }); |
- } |
+ }); |
pref.setOrder(nextPrefOrder++); |
prefScreen.addPreference(pref); |
mAccountsListPreferences.add(pref); |
} |
- |
- updateSyncStatus(); |
- } |
- |
- private void updateSyncStatus() { |
- if (mPrimaryAccountPreference != null) { |
- mPrimaryAccountPreference.setSummary(getSyncStatusSummary(getActivity())); |
- } |
} |
// ProfileDownloader.Observer implementation: |
@@ -545,7 +474,10 @@ public class AccountManagementFragment extends PreferenceFragment |
@Override |
public void syncStateChanged() { |
- updateSyncStatus(); |
+ SyncPreference pref = (SyncPreference) findPreference(PREF_SYNC_SETTINGS); |
+ pref.updateSyncSummary(); |
+ |
+ // TODO(crbug/557784): Show notification for sync error |
} |
// SignInStateObserver implementation: |
@@ -560,45 +492,9 @@ public class AccountManagementFragment extends PreferenceFragment |
update(); |
} |
- private static String getSyncStatusSummary(Activity activity) { |
- if (!ChromeSigninController.get(activity).isSignedIn()) return ""; |
- |
- ProfileSyncService profileSyncService = ProfileSyncService.get(); |
- Resources res = activity.getResources(); |
- |
- if (ChildAccountService.isChildAccount()) { |
- return res.getString(R.string.kids_account); |
- } |
- |
- if (!AndroidSyncSettings.isMasterSyncEnabled(activity)) { |
- return res.getString(R.string.sync_android_master_sync_disabled); |
- } |
- |
- if (profileSyncService == null) { |
- return res.getString(R.string.sync_is_disabled); |
- } |
- |
- if (profileSyncService.getAuthError() != GoogleServiceAuthError.State.NONE) { |
- return res.getString(profileSyncService.getAuthError().getMessage()); |
- } |
- |
- if (AndroidSyncSettings.isSyncEnabled(activity)) { |
- if (!profileSyncService.isBackendInitialized()) { |
- return res.getString(R.string.sync_setup_progress); |
- } |
- |
- if (profileSyncService.isPassphraseRequiredForDecryption()) { |
- return res.getString(R.string.sync_need_passphrase); |
- } |
- } |
- |
- return AndroidSyncSettings.isSyncEnabled(activity) |
- ? res.getString(R.string.sync_is_enabled) |
- : res.getString(R.string.sync_is_disabled); |
- } |
- |
/** |
* Open the account management UI. |
+ * |
* @param applicationContext An application context. |
* @param profile A user profile. |
* @param serviceType A signin::GAIAServiceType that triggered the dialog. |
@@ -615,6 +511,7 @@ public class AccountManagementFragment extends PreferenceFragment |
/** |
* Converts a square user picture to a round user picture. |
+ * |
* @param bitmap A bitmap to convert. |
* @return A rounded picture bitmap. |
*/ |
@@ -640,14 +537,14 @@ public class AccountManagementFragment extends PreferenceFragment |
/** |
* Creates a new image with the picture overlaid by the badge. |
+ * |
* @param userPicture A bitmap to overlay on. |
* @param badge A bitmap to overlay with. |
* @return A bitmap with the badge overlaying the {@code userPicture}. |
*/ |
- private Bitmap overlayChildBadgeOnUserPicture(Bitmap userPicture, Bitmap badge) { |
- Resources resources = getResources(); |
- assert userPicture.getWidth() |
- == resources.getDimensionPixelSize(R.dimen.user_picture_size); |
+ private static Bitmap overlayChildBadgeOnUserPicture( |
+ Bitmap userPicture, Bitmap badge, Resources resources) { |
+ assert userPicture.getWidth() == resources.getDimensionPixelSize(R.dimen.user_picture_size); |
int borderSize = resources.getDimensionPixelOffset(R.dimen.badge_border_size); |
int badgeRadius = resources.getDimensionPixelOffset(R.dimen.badge_radius); |
@@ -677,6 +574,7 @@ public class AccountManagementFragment extends PreferenceFragment |
/** |
* Updates the user name and picture in the cache. |
+ * |
* @param accountId User's account id. |
* @param fullName User name. |
* @param bitmap User picture. |
@@ -702,21 +600,33 @@ public class AccountManagementFragment extends PreferenceFragment |
* @param accountId A child account. |
* @return A user picture with badge for a given child account. |
*/ |
- private Bitmap getBadgedUserPicture(String accountId) { |
+ public static Bitmap getBadgedUserPicture(String accountId, Resources res) { |
if (sChildAccountId != null) { |
assert TextUtils.equals(accountId, sChildAccountId); |
return sCachedBadgedPicture; |
} |
sChildAccountId = accountId; |
- Bitmap picture = getUserPicture(accountId); |
- Bitmap badge = BitmapFactory.decodeResource(getResources(), R.drawable.ic_account_child); |
- sCachedBadgedPicture = overlayChildBadgeOnUserPicture(picture, badge); |
+ Bitmap picture = getUserPicture(accountId, res); |
+ Bitmap badge = BitmapFactory.decodeResource(res, R.drawable.ic_account_child); |
+ sCachedBadgedPicture = overlayChildBadgeOnUserPicture(picture, badge, res); |
return sCachedBadgedPicture; |
} |
/** |
- * Gets the user picture for the account from the cache, |
- * or returns the default picture if unavailable. |
+ * Gets the user picture for the account from the cache, or returns the default picture if |
newt (away)
2016/02/12 22:03:50
I'd put this longer more-helpful JavaDoc on the pu
May
2016/02/16 17:32:07
Done.
|
+ * unavailable. |
+ * |
+ * @param accountId An account. |
+ * @return A user picture for a given account. |
+ */ |
+ private Bitmap getBadgedUserPicture(String accountId) { |
+ return getUserPicture(accountId, getResources()); |
+ } |
+ |
+ /** |
+ * Gets the user picture for the account from the cache, or returns the default picture if |
+ * unavailable. |
+ * |
* @param accountId An account. |
* @param resources The collection containing the application resources. |
* @return A user picture for a given account. |
@@ -728,8 +638,9 @@ public class AccountManagementFragment extends PreferenceFragment |
} |
/** |
- * Gets the user picture for the account from the cache, |
- * or returns the default picture if unavailable. |
+ * Gets the user picture for the account from the cache, or returns the default picture if |
+ * unavailable. |
+ * |
* @param accountId An account. |
* @return A user picture for a given account. |
*/ |
@@ -738,8 +649,9 @@ public class AccountManagementFragment extends PreferenceFragment |
} |
/** |
- * Initiate fetching of an image and a picture of a given account. |
- * Fetched data will be sent to observers of ProfileDownloader. |
+ * Initiate fetching of an image and a picture of a given account. Fetched data will be sent to |
+ * observers of ProfileDownloader. |
+ * |
* @param context A context. |
* @param profile A profile. |
* @param accountName An account name. |
@@ -757,6 +669,7 @@ public class AccountManagementFragment extends PreferenceFragment |
/** |
* Prefetch the primary account image and name. |
+ * |
* @param context A context to use. |
* @param profile A profile to use. |
*/ |
@@ -789,6 +702,7 @@ public class AccountManagementFragment extends PreferenceFragment |
/** |
* Sets the sign out allowed preference value. |
+ * |
* @param context A context |
* @param isAllowed True if the sign out is not disabled due to a child/EDU account |
*/ |