Home | History | Annotate | Download | only in email

Lines Matching refs:account

25 import com.android.emailcommon.provider.Account;
269 * Returns the last used account ID as set by {@link #setLastUsedAccountId}.
273 * Note that the last used account may have been deleted in the background so there is also
274 * no guarantee that the account exists.
277 return mSharedPreferences.getLong(LAST_ACCOUNT_USED, Account.NO_ACCOUNT);
281 * Sets the specified ID of the last account used. Treated as an opaque ID and does not
292 * Gets whether the require manual sync dialog has been shown for the specified account.
293 * It should only be shown once per account.
295 public boolean getHasShownRequireManualSync(Context context, Account account) {
296 return getBoolean(context, account.getEmailAddress(), REQUIRE_MANUAL_SYNC_DIALOG_SHOWN,
301 * Sets whether the require manual sync dialog has been shown for the specified account.
302 * It should only be shown once per account.
304 public void setHasShownRequireManualSync(Context context, Account account, boolean value) {
305 setBoolean(context, account.getEmailAddress(), REQUIRE_MANUAL_SYNC_DIALOG_SHOWN, value);
312 * flag to true, and the dialog has not been shown before for the supplied account.
314 public boolean shouldShowRequireManualSync(Context context, Account account) {
315 return Account.isAutomaticSyncDisabledByRoaming(context, account.mId)
316 && !getHasShownRequireManualSync(context, account);
332 * Utility method for setting a boolean value on a per-account preference.
334 private void setBoolean(Context context, String account, String key, Boolean value) {
335 mSharedPreferences.edit().putBoolean(makeKey(account, key), value).apply();
339 * Utility method for getting a boolean value from a per-account preference.
341 private boolean getBoolean(Context context, String account, String key, boolean def) {
342 return mSharedPreferences.getBoolean(makeKey(account, key), def);
346 * Utility method for creating a per account preference key.
348 private String makeKey(String account, String key) {
349 return account != null ? account + "-" + key : key;