Home | History | Annotate | Download | only in provider

Lines Matching defs:ACCOUNT

80 import com.android.emailcommon.provider.Account;
167 // delete the old backups and trigger a new backup to the account manager
207 private static final int ACCOUNT = ACCOUNT_BASE;
295 array.put(ACCOUNT_BASE >> BASE_SHIFT, Account.TABLE_NAME);
503 // Delete orphaned mailboxes/messages/policies (account no longer exists)
505 AccountColumns._ID, Account.TABLE_NAME);
507 AccountColumns._ID, Account.TABLE_NAME);
509 AccountColumns.POLICY_KEY, Account.TABLE_NAME);
526 * Restore user Account and HostAuth data from our backup database
544 // If there's a backup database (old style) delete it and trigger an account manager backup.
550 LogUtils.w(TAG, "Migrated from backup database to account manager");
556 "SELECT EXISTS (SELECT ? FROM " + Account.TABLE_NAME + " )",
559 LogUtils.w(TAG, "restoreIfNeeded: Account exists.");
681 case ACCOUNT:
722 accountId = Account.NO_ACCOUNT;
750 case ACCOUNT:
811 // Use the email- prefix because message, mailbox, and account are so generic (e.g. SMS, IM)
839 case ACCOUNT:
840 return "vnd.android.cursor.dir/email-account";
842 return "vnd.android.cursor.item/email-account";
940 case ACCOUNT:
959 // Notify the account when a new mailbox is added
969 case ACCOUNT:
998 // Hmm, a problem here is that we can't link the account as well, so it must be
1010 // This implies adding a mailbox to an account.
1051 // The combined account name changes on locale changes
1114 sURIMatcher.addURI(EmailContent.AUTHORITY, "account", ACCOUNT);
1115 // A specific account
1116 // insert into this URI causes a mailbox to be added to the account
1117 sURIMatcher.addURI(EmailContent.AUTHORITY, "account/#", ACCOUNT_ID);
1201 // All quick responses associated with a particular account id
1202 sURIMatcher.addURI(EmailContent.AUTHORITY, "quickresponse/account/#",
1376 case ACCOUNT:
1441 Account.FLAGS_SUPPORTS_SMART_FORWARD + " AS " +
1463 // All quick responses for the given account
1597 * Copy the Account and HostAuth tables from one database to another
1613 toDatabase.delete(Account.TABLE_NAME, null, null);
1616 // Get our account cursor
1617 Cursor c = fromDatabase.query(Account.TABLE_NAME, Account.CONTENT_PROJECTION,
1624 Account account = new Account();
1625 account.restore(c);
1628 // state of the account, and we've reset that...
1631 account.mSecuritySyncKey = null;
1632 account.mSyncKey = null;
1633 account.mPolicyKey = 0;
1637 account.mHostAuthKeyRecv);
1639 // The account might have gone away, though very unlikely
1641 account.mHostAuthKeyRecv = toDatabase.insert(HostAuth.TABLE_NAME, null,
1645 if (account.mHostAuthKeySend > 0) {
1646 hostAuth = restoreHostAuth(fromDatabase, account.mHostAuthKeySend);
1648 // since we checked the validity of the account above, and the
1651 account.mHostAuthKeySend = toDatabase.insert(
1655 // Now, create the account in the "to" database
1656 toDatabase.insert(Account.TABLE_NAME, null, account.toContentValues());
1669 LogUtils.w(TAG, "Exception while copying account tables", ex);
1678 * Backup account data, returning the number of accounts backed up
1682 final Cursor accountCursor = db.query(Account.TABLE_NAME, Account.CONTENT_PROJECTION,
1687 final Account account = new Account();
1688 account.restore(accountCursor);
1690 EmailServiceUtils.getServiceInfo(context, account.getProtocol(context));
1692 LogUtils.d(LogUtils.TAG, "Could not find service info for account");
1695 final String jsonString = account.toJsonString(context);
1696 final android.accounts.Account amAccount =
1697 account.getAccountManagerAccount(serviceInfo.accountType);
1708 account data, returning the number of accounts restored
1712 // Find all possible account types
1721 final List<android.accounts.Account> amAccounts = new ArrayList<android.accounts.Account>();
1728 for (final android.accounts.Account amAccount : amAccounts) {
1733 final Account account = Account.fromJsonString(jsonString);
1734 if (account != null) {
1735 AccountSettingsUtils.commitSettings(context, account);
1822 + " INNER JOIN " + Account.TABLE_NAME + " AS a"
1832 * Query to get the protocol and email address for an account. Note that this uses
1839 + " FROM " + Account.TABLE_NAME + " AS a"
1864 final android.accounts.Account account =
1866 if (account != null) {
1867 restartPush(account);
1884 * @param accountId The id of the account for this mailbox.
1897 * Restart push if an account's settings change in a way that requires it.
1900 * @param values The {@link ContentValues} that were updated for the account.
1901 * @param accountId The id of the account.
2054 final android.accounts.Account amAccount =
2069 "Attempted to start delayed sync for invalid account %d",
2111 // Notify individual account and "all accounts"
2207 case ACCOUNT:
2459 case ACCOUNT:
2461 baseUri = Account.NOTIFIER_URI;
2508 // Ideally this intent would contain information about which account changed, to limit the
2509 // updates to that particular account. Unfortunately, that information is not available in
2624 * Array of pre-defined account colors (legacy colors from old email app)
3376 String protocol = Account.getProtocol(context, mailbox.mAccountKey);
3417 private static String getExternalUriString(String segment, String account) {
3419 .appendQueryParameter("account", account).build().toString();
3422 private static String getExternalUriStringEmail2(String segment, String account) {
3424 .appendQueryParameter("account", account).build().toString();
3438 private static int getCapabilities(Context context, final Account account) {
3439 if (account == null) {
3442 // Account capabilities are based on protocol -- different protocols (and, for EAS,
3444 final String protocol = account.getProtocol(context);
3457 final String easVersion = account.mProtocolVersion;
3480 LogUtils.w(TAG, "Unknown protocol for account %d", account.getId());
3483 LogUtils.d(TAG, "getCapabilities() for %d (protocol %s): 0x%x %s", account.getId(), protocol,
3499 // TODO: Should this be stored per-account, or some other mechanism?
3509 * Generate a "single account" SQLite query, given a projection from UnifiedEmail
3512 * @param id account row ID
3525 final Account account = Account.restoreAccountWithId(context, accountId);
3526 if (account == null) {
3527 LogUtils.d(TAG, "Account %d not found during genQueryAccount", accountId);
3530 // Get account capabilities from the service
3532 (account == null ? 0 : getCapabilities(context, account)));
3611 final int hold = ((account != null &&
3612 ((account.getFlags() & Account.FLAGS_SECURITY_HOLD) == 0)) ? 0 : 1);
3617 (account == null ? "" : AccountSecurity.getUpdateSecurityUri(
3618 account.getId(), true).toString()));
3666 combinedUriString("quickresponse/account", id));
3684 sb.append(" FROM " + Account.TABLE_NAME + " WHERE " + AccountColumns._ID + "=?");
3691 * @param id the id of the item (e.g. an account, mailbox, or message id)
3706 return Long.toString(Account.ACCOUNT_ID_COMBINED_VIEW + type);
3736 final long id = Account.getDefaultAccountId(getContext(), lastUsedAccountId);
3737 if (id == Account.NO_ACCOUNT) return;
3772 values[colPosMap.get(UIProvider.AccountColumns.ACCOUNT_ID)] = "Account Id";
3945 db.rawQuery("select _id from " + Account.TABLE_NAME, new String[0]);
3983 private Cursor uiQuickResponseAccount(String[] uiProjection, String account) {
3990 return db.rawQuery(query, new String[] {account});
4132 * account.
4182 * account. Some accounts might not have default recent folders, in which case an empty array
4184 * @param id account id
4390 * - Capabilities (due to this varying by account protocol).
4392 * - Load more uri (due to this varying by account protocol).
4397 * @param accountId The account id for the mailboxes in this query.
4421 // Get the EmailServiceInfo for the current account.
4423 final String protocol = Account.getProtocol(context, accountId);
4460 // Blank the load more uri for account types that don't offer it.
4461 // Note that all account types permit load more for search results.
4667 // Get notifications for any folder changes on this account. This is broader than
4734 LogUtils.d(LogUtils.TAG, "No inbox found for account %s", id);
4795 // TODO(mhibdon): if the UI Attachment contained the account key, the third parameter could
4818 * Create a mailbox given the account and mailboxType.
4838 * Given an account name and a mailbox type, return that mailbox, creating it if necessary
4839 * @param accountId the account id to use
4841 * @return the mailbox of the given type for the account in the uri, or null if not found
4865 final Account account = Account.restoreAccountWithId(context, mailbox.mAccountKey);
4866 if (account == null) return null;
4872 msg.mFrom = account.getEmailAddress();
4954 ((account.mFlags & Account.FLAGS_SUPPORTS_SMART_FORWARD) == 0)) {
5343 String protocol = Account.getProtocol(context, m.mAccountKey);
5423 * Projection for use with getting mailbox & account keys for a message.
5504 // Find the account ID (needed in a few calls)
5552 final com.android.mail.providers.Account uiAccount =
5553 com.android.mail.providers.Account.builder().buildFrom(ac);
5645 * Notify about the Account id passed in
5646 * @param id the Account id to be notified
5649 // Notify on the specific account
5666 * @param accountId the account id to be notified (for folder list notification).
5671 if (accountId != Account.NO_ACCOUNT) {
5675 // Notify for combined account too
5727 * Create an android.accounts.Account object for this account.
5728 * @param accountId id of account to load.
5729 * @return an android.accounts.Account for this account, or null if we can't load it.
5731 private android.accounts.Account getAccountManagerAccount(final long accountId) {
5733 final Account account = Account.restoreAccountWithId(context, accountId);
5734 if (account == null) return null;
5735 return getAccountManagerAccount(context, account.mEmailAddress,
5736 account.getProtocol(context));
5740 * Create an android.accounts.Account object for an emailAddress/protocol pair.
5744 * @return an {@link android.accounts.Account} for this info.
5746 private static android.accounts.Account getAccountManagerAccount(final Context context,
5752 return new android.accounts.Account(emailAddress, info.accountType);
5756 * Update an account's periodic sync if the sync interval has changed.
5757 * @param accountId id for the account to update.
5758 * @param values the ContentValues for this update to the account.
5766 final android.accounts.Account account = getAccountManagerAccount(accountId);
5767 if (account == null) {
5768 // Unable to load the account, or unknown protocol.
5772 LogUtils.d(TAG, "Setting sync interval for account %s to %d minutes",
5777 ContentResolver.getPeriodicSyncs(account, EmailContent.AUTHORITY);
5779 ContentResolver.removePeriodicSync(account, EmailContent.AUTHORITY, sync.extras);
5785 ContentResolver.addPeriodicSync(account, EmailContent.AUTHORITY, Bundle.EMPTY,
5792 * @param account The {@link android.accounts.Account} we want to sync.
5798 private static void startSync(final android.accounts.Account account, final long mailboxId,
5811 ContentResolver.requestSync(account, EmailContent.AUTHORITY, extras);
5812 LogUtils.i(TAG, "requestSync EmailProvider startSync %s, %s", account.toString(),
5823 final android.accounts.Account account = getAccountManagerAccount(mailbox.mAccountKey);
5824 if (account != null) {
5825 startSync(account, mailbox.mId, deltaMessageCount);
5830 * Restart any push operations for an account.
5831 * @param account The {@link android.accounts.Account} we're interested in.
5833 private static void restartPush(final android.accounts.Account account) {
5843 ContentResolver.requestSync(account, EmailContent.AUTHORITY, extras);
5844 LogUtils.i(TAG, "requestSync EmailProvider startSync %s, %s", account.toString(),
5896 * Returns the search mailbox for the specified account, creating one if necessary
5897 * @return the search mailbox for the passed in account
5919 LogUtils.d(TAG, "runSearchQuery. account: %d mailbox id: %d",
5957 LogUtils.w(Logging.LOG_TAG, "In uiSearch, inbox doesn't exist for account "
6012 * Delete an account and clean it up
6018 // Get the account URI.
6019 final Account account = Account.restoreAccountWithId(context, accountId);
6020 if (account == null) {
6026 // Now delete the account itself
6027 uri = ContentUris.withAppendedId(Account.CONTENT_URI, accountId);
6035 // which would be a problem when the first account reconciliation shuts us down.
6038 LogUtils.w(Logging.LOG_TAG, "Exception while deleting account", e);
6046 // Get the account URI.
6047 final Account account = Account.restoreAccountWithId(context, accountId);
6048 if (account == null) {
6092 /** Projection used for getting email address for an account. */
6097 // the account may have been deleted from the DB. Therefore we have to get the email
6098 // address now and send that, rather than the account id.
6099 final String emailAddress = Utility.getFirstRowString(context, Account.CONTENT_URI,
6100 ACCOUNT_EMAIL_PROJECTION, Account.ID_SELECTION,
6103 LogUtils.e(TAG, "Could not find email address for account %d", accountId);
6114 // Delete account sync key.
6117 resolver.update(Account.CONTENT_URI, cv, Account.ID_SELECTION, accountIdArgs);
6151 // widgetInfo now has pairs of account uri/folder uri
6204 Cursor cursor = query(Account.CONTENT_URI, Account.CONTENT_PROJECTION, null, null, null);
6210 Account account = new Account();
6211 account.restore(cursor);
6212 writer.println(" Account " + account.mDisplayName);
6214 HostAuth.restoreHostAuthWithId(context, account.mHostAuthKeyRecv);
6217 (TextUtils.isEmpty(account.mProtocolVersion) ? "" : " version " +
6218 account.mProtocolVersion));
6233 // TODO: It's possible that the account is deleted by the time we get here
6235 final android.accounts.Account account = request.mAccount;
6237 ContentResolver.requestSync(account, request.mAuthority, extras);
6239 account.toString(), extras.toString());
6251 private final android.accounts.Account mAccount;
6254 private SyncRequestMessage(final String authority, final android.accounts.Account account,
6257 mAccount = account;
6332 Account.CONTENT_URI,
6333 Account.ID_PROJECTION,