Home | History | Annotate | Download | only in email

Lines Matching refs:account

37 import com.android.emailcommon.provider.Account;
215 * API: Report that policies may have been updated due to rewriting values in an Account.
216 * @param accountId the account that has been updated, -1 if unknown/deleted
343 * This can be used when syncing a specific account, by passing a specific set of policies
344 * for that account. Or, it can be used at any time to compare the device
351 * will return 'false' as soon as the password expires - irrespective of which account caused
353 * based on the requirements of the account with the shortest interval.
502 Account account = Account.restoreAccountWithId(context, accountId);
503 if (account != null) {
504 setAccountHoldFlag(context, account, holdEnabled);
507 NotificationController.getInstance(context).showSecurityNeededNotification(account);
513 * API: Set/Clear the "hold" flag in any account. This flag serves a dual purpose:
517 * @param account the account whose hold flag is to be set/cleared
520 public static void setAccountHoldFlag(Context context, Account account, boolean newState) {
522 account.mFlags |= Account.FLAGS_SECURITY_HOLD;
524 account.mFlags &= ~Account.FLAGS_SECURITY_HOLD;
527 cv.put(AccountColumns.FLAGS, account.mFlags);
528 account.update(context, cv);
531 public static void clearAccountPolicy(Context context, Account account) {
532 setAccountPolicy(context, account, null, null);
536 * Set the policy for an account atomically; this also removes any other policy associated with
537 * the account and sets the policy key for the account. If policy is null, the policyKey is
538 * set to 0 and the securitySyncKey to null. Also, update the account object to reflect the
541 * @param account the account whose policy is to be set
543 * @param securitySyncKey the security sync key for this account (ignored if policy is null)
545 public static void setAccountPolicy(Context context, Account account, Policy policy,
552 // Add the new policy (no account will yet reference this)
555 // Make the policyKey of the account our newly created policy, and set the sync key
557 ContentUris.withAppendedId(Account.CONTENT_URI, account.mId))
563 ContentUris.withAppendedId(Account.CONTENT_URI, account.mId))
569 // Delete the previous policy associated with this account, if any
570 if (account.mPolicyKey > 0) {
573 Policy.CONTENT_URI, account.mPolicyKey)).build());
578 account.refresh(context);
581 throw new IllegalStateException("Exception setting account policy.");
588 * API: Report that policies may have been updated due to rewriting values in an Account; we
597 Account account = Account.restoreAccountWithId(mContext, accountId);
599 if (account.mPolicyKey > 0) {
600 oldPolicy = Policy.restorePolicyWithId(mContext, account.mPolicyKey);
604 account.mSecuritySyncKey))) {
607 setAccountPolicy(mContext, account, policy, securityKey);
616 Log.d(Logging.LOG_TAG, "Notify policies for " + account.mDisplayName +
619 NotificationController.getInstance(mContext).showSecurityNeededNotification(account);
621 // Set/clear the account hold.
622 setAccountHoldFlag(mContext, account, setHold);
628 * The caller needs to write the required policies into this account before making this call.
631 * @param accountId the account for which sync cannot proceed
634 Account account = Account.restoreAccountWithId(mContext, accountId);
635 // In case the account has been deleted, just return
636 if (account == null) return;
638 if (account.mPolicyKey == 0) {
639 Log.d(TAG, "policiesRequired for " + account.mDisplayName + ": none");
641 Policy policy = Policy.restorePolicyWithId(mContext, account.mPolicyKey);
645 Log.d(TAG, "policiesRequired for " + account.mDisplayName + ": " + policy);
650 // Mark the account as "on hold".
651 setAccountHoldFlag(mContext, account, true);
654 NotificationController.getInstance(mContext).showSecurityNeededNotification(account);
713 Cursor c = cr.query(Account.CONTENT_URI, EmailContent.ID_PROJECTION,
714 Account.SECURITY_NONZERO_SELECTION, null, null);
717 " secured account(s)");
744 * in this method operates based on the aggregate setting - irrespective of which account
746 * based on the requirements of the account with the shortest interval.
763 // the shortest-expiring account.
777 * Find the account with the shortest expiration time. This is always assumed to be
778 * the account that forces the password to be refreshed.
807 Account account = Account.restoreAccountWithId(context, accountId);
808 if (account != null) {
809 // Mark the account as "on hold".
810 setAccountHoldFlag(context, account, true);
840 Account.clearSecurityHoldOnAllAccounts(context);