Home | History | Annotate | Download | only in provider

Lines Matching refs:ACCOUNT

74 import com.android.emailcommon.provider.Account;
188 private static final int ACCOUNT = ACCOUNT_BASE;
268 array.put(ACCOUNT_BASE >> BASE_SHIFT, Account.TABLE_NAME);
454 // Delete orphaned mailboxes/messages/policies (account no longer exists)
456 AccountColumns.ID, Account.TABLE_NAME);
458 AccountColumns.ID, Account.TABLE_NAME);
460 AccountColumns.POLICY_KEY, Account.TABLE_NAME);
477 * Restore user Account and HostAuth data from our backup database
497 "SELECT EXISTS (SELECT ? FROM " + Account.TABLE_NAME + " )",
500 LogUtils.w(TAG, "restoreIfNeeded: Account exists.");
620 case ACCOUNT:
660 accountId = Account.NO_ACCOUNT;
687 case ACCOUNT:
729 // Use the email- prefix because message, mailbox, and account are so generic (e.g. SMS, IM)
757 case ACCOUNT:
758 return "vnd.android.cursor.dir/email-account";
760 return "vnd.android.cursor.item/email-account";
822 case ACCOUNT:
840 // Notify the account when a new mailbox is added
850 case ACCOUNT:
879 // Hmm, a problem here is that we can't link the account as well, so it must be
891 // This implies adding a mailbox to an account.
930 // The combined account name changes on locale changes
992 sURIMatcher.addURI(EmailContent.AUTHORITY, "account", ACCOUNT);
993 // A specific account
994 // insert into this URI causes a mailbox to be added to the account
995 sURIMatcher.addURI(EmailContent.AUTHORITY, "account/#", ACCOUNT_ID);
1071 CONTENT_VALUES_RESET_NEW_MESSAGE_COUNT.put(Account.NEW_MESSAGE_COUNT, 0);
1080 // All quick responses associated with a particular account id
1081 sURIMatcher.addURI(EmailContent.AUTHORITY, "quickresponse/account/#",
1244 case ACCOUNT:
1278 // All quick responses for the given account
1365 * Copy the Account and HostAuth tables from one database to another
1381 toDatabase.delete(Account.TABLE_NAME, null, null);
1384 // Get our account cursor
1385 Cursor c = fromDatabase.query(Account.TABLE_NAME, Account.CONTENT_PROJECTION,
1392 Account account = new Account();
1393 account.restore(c);
1396 // state of the account, and we've reset that...
1399 account.mSecuritySyncKey = null;
1400 account.mSyncKey = null;
1401 account.mPolicyKey = 0;
1405 account.mHostAuthKeyRecv);
1407 // The account might have gone away, though very unlikely
1409 account.mHostAuthKeyRecv = toDatabase.insert(HostAuth.TABLE_NAME, null,
1413 if (account.mHostAuthKeySend > 0) {
1414 hostAuth = restoreHostAuth(fromDatabase, account.mHostAuthKeySend);
1416 // since we checked the validity of the account above, and the
1419 account.mHostAuthKeySend = toDatabase.insert(
1423 // Now, create the account in the "to" database
1424 toDatabase.insert(Account.TABLE_NAME, null, account.toContentValues());
1437 LogUtils.w(TAG, "Exception while copying account tables", ex);
1451 * Backup account data, returning the number of accounts backed up
1461 LogUtils.e(TAG, "Account backup failed!");
1474 * Restore account data, returning the number of accounts restored
1486 LogUtils.e(TAG, "Account recovery failed?");
1571 + " INNER JOIN " + Account.TABLE_NAME + " AS a"
1581 * Query to get the protocol and email address for an account. Note that this uses
1588 + " FROM " + Account.TABLE_NAME + " AS a"
1613 final android.accounts.Account account =
1615 restartPush(account);
1631 * @param accountId The id of the account for this mailbox.
1644 * Restart push if an account's settings change in a way that requires it.
1647 * @param values The {@link ContentValues} that were updated for the account.
1648 * @param accountId The id of the account.
1800 final android.accounts.Account amAccount =
1815 "Attempted to start delayed sync for invalid account %d",
1857 // Notify individual account and "all accounts"
1878 case ACCOUNT:
1897 newMessageCount.put(Account.NEW_MESSAGE_COUNT, set);
1902 notificationUri = Account.CONTENT_URI; // Only notify account cursors.
1907 // Affects all accounts. Just invalidate all account cache.
1908 notificationUri = Account.CONTENT_URI; // Only notify account cursors.
2049 case ACCOUNT:
2051 baseUri = Account.NOTIFIER_URI;
2100 // Ideally this intent would contain information about which account changed, to limit the
2101 // updates to that particular account. Unfortunately, that information is not available in
2195 * Array of pre-defined account colors (legacy colors from old email app)
2927 String protocol = Account.getProtocol(context, mailbox.mAccountKey);
2968 private static String getExternalUriString(String segment, String account) {
2970 .appendQueryParameter("account", account).build().toString();
2973 private static String getExternalUriStringEmail2(String segment, String account) {
2975 .appendQueryParameter("account", account).build().toString();
2990 final Account account = Account.restoreAccountWithId(context, accountId);
2991 if (account == null) {
2992 LogUtils.d(TAG, "Account %d not found during getCapabilities", accountId);
2995 // Account capabilities are based on protocol -- different protocols (and, for EAS,
2997 final String protocol = account.getProtocol(context);
3009 final String easVersion = account.mProtocolVersion;
3032 LogUtils.w(TAG, "Unknown protocol for account %d", accountId);
3043 // TODO: Should this be stored per-account, or some other mechanism?
3050 * Generate a "single account" SQLite query, given a projection from UnifiedEmail
3053 * @param id account row ID
3067 // Get account capabilities from the service
3183 combinedUriString("quickresponse/account", id));
3193 sb.append(" FROM " + Account.TABLE_NAME + " WHERE " + AccountColumns.ID + "=?");
3229 * @param id the id of the item (e.g. an account, mailbox, or message id)
3244 return Long.toString(Account.ACCOUNT_ID_COMBINED_VIEW + type);
3274 final long id = Account.getDefaultAccountId(getContext(), lastUsedAccountId);
3275 if (id == Account.NO_ACCOUNT) return;
3332 // TODO: Get these from default account?
3479 db.rawQuery("select _id from " + Account.TABLE_NAME, new String[0]);
3517 private Cursor uiQuickResponseAccount(String[] uiProjection, String account) {
3524 return db.rawQuery(query, new String[] {account});
3631 * account.
3676 * account. Some accounts might not have default recent folders, in which case an empty array
3678 * @param id account id
3817 // whether we are participating in account sync rules.
4009 * - Capabilities (due to this varying by account protocol).
4011 * - Load more uri (due to this varying by account protocol).
4016 * @param accountId The account id for the mailboxes in this query.
4040 // Get the EmailServiceInfo for the current account.
4042 final String protocol = Account.getProtocol(context, accountId);
4077 // Blank the load more uri for account types that don't offer it.
4078 // Note that all account types permit load more for search results.
4248 // Get notifications for any folder changes on this account. This is broader than
4343 // TODO(mhibdon): if the UI Attachment contained the account key, the third parameter could
4366 * Create a mailbox given the account and mailboxType.
4386 * Given an account name and a mailbox type, return that mailbox, creating it if necessary
4387 * @param accountId the account id to use
4389 * @return the mailbox of the given type for the account in the uri, or null if not found
4413 final Account account = Account.restoreAccountWithId(context, mailbox.mAccountKey);
4414 if (account == null) return null;
4420 msg.mFrom = account.getEmailAddress();
4503 ((account.mFlags & Account.FLAGS_SUPPORTS_SMART_FORWARD) == 0)) {
4874 String protocol = Account.getProtocol(context, m.mAccountKey);
4952 * Projection for use with getting mailbox & account keys for a message.
5037 final com.android.mail.providers.Account uiAccount =
5038 new com.android.mail.providers.Account(ac);
5130 * Notify about the Account id passed in
5131 * @param id the Account id to be notified
5134 // Notify on the specific account
5151 * @param accountId the account id to be notified (for folder list notification).
5156 if (accountId != Account.NO_ACCOUNT) {
5160 // Notify for combined account too
5207 * Create an android.accounts.Account object for this account.
5208 * @param accountId id of account to load.
5209 * @return an android.accounts.Account for this account, or null if we can't load it.
5211 private android.accounts.Account getAccountManagerAccount(final long accountId) {
5213 final Account account = Account.restoreAccountWithId(context, accountId);
5214 if (account == null) return null;
5215 return getAccountManagerAccount(context, account.mEmailAddress,
5216 account.getProtocol(context));
5220 * Create an android.accounts.Account object for an emailAddress/protocol pair.
5224 * @return an {@link android.accounts.Account} for this info.
5226 private static android.accounts.Account getAccountManagerAccount(final Context context,
5229 return new android.accounts.Account(emailAddress, info.accountType);
5233 * Update an account's periodic sync if the sync interval has changed.
5234 * @param accountId id for the account to update.
5235 * @param values the ContentValues for this update to the account.
5243 final android.accounts.Account account = getAccountManagerAccount(accountId);
5244 if (account == null) {
5245 // Unable to load the account, or unknown protocol.
5249 LogUtils.d(TAG, "Setting sync interval for account " + accountId + " to " + syncInterval +
5254 ContentResolver.getPeriodicSyncs(account, EmailContent.AUTHORITY);
5256 ContentResolver.removePeriodicSync(account, EmailContent.AUTHORITY, sync.extras);
5262 ContentResolver.addPeriodicSync(account, EmailContent.AUTHORITY, Bundle.EMPTY,
5269 * @param account The {@link android.accounts.Account} we want to sync.
5275 private static void startSync(final android.accounts.Account account, final long mailboxId,
5288 ContentResolver.requestSync(account, EmailContent.AUTHORITY, extras);
5289 LogUtils.i(TAG, "requestSync EmailProvider startSync %s, %s", account.toString(),
5300 final android.accounts.Account account = getAccountManagerAccount(mailbox.mAccountKey);
5301 startSync(account, mailbox.mId, deltaMessageCount);
5305 * Restart any push operations for an account.
5306 * @param account The {@link android.accounts.Account} we're interested in.
5308 private static void restartPush(final android.accounts.Account account) {
5318 ContentResolver.requestSync(account, EmailContent.AUTHORITY, extras);
5319 LogUtils.i(TAG, "requestSync EmailProvider startSync %s, %s", account.toString(),
5371 * Returns the search mailbox for the specified account, creating one if necessary
5372 * @return the search mailbox for the passed in account
5394 LogUtils.d(TAG, "runSearchQuery. account: %d mailbox id: %d",
5432 LogUtils.w(Logging.LOG_TAG, "In uiSearch, inbox doesn't exist for account "
5477 * Delete an account and clean it up
5483 // Get the account URI.
5484 final Account account = Account.restoreAccountWithId(context, accountId);
5485 if (account == null) {
5491 // Now delete the account itself
5492 uri = ContentUris.withAppendedId(Account.CONTENT_URI, accountId);
5501 LogUtils.w(Logging.LOG_TAG, "Exception while deleting account", e);
5509 // Get the account URI.
5510 final Account account = Account.restoreAccountWithId(context, accountId);
5511 if (account == null) {
5518 /** Projection used for getting email address for an account. */
5523 // the account may have been deleted from the DB. Therefore we have to get the email
5524 // address now and send that, rather than the account id.
5525 final String emailAddress = Utility.getFirstRowString(context, Account.CONTENT_URI,
5526 ACCOUNT_EMAIL_PROJECTION, Account.ID_SELECTION,
5529 LogUtils.e(TAG, "Could not find email address for account %d", accountId);
5540 // Delete account sync key.
5542 cv.putNull(Account.SYNC_KEY);
5543 resolver.update(Account.CONTENT_URI, cv, Account.ID_SELECTION, accountIdArgs);
5577 // widgetInfo now has pairs of account uri/folder uri
5630 Cursor cursor = query(Account.CONTENT_URI, Account.CONTENT_PROJECTION, null, null, null);
5636 Account account = new Account();
5637 account.restore(cursor);
5638 writer.println(" Account " + account.mDisplayName);
5640 HostAuth.restoreHostAuthWithId(context, account.mHostAuthKeyRecv);
5643 (TextUtils.isEmpty(account.mProtocolVersion) ? "" : " version " +
5644 account.mProtocolVersion));
5659 // TODO: It's possible that the account is deleted by the time we get here
5661 final android.accounts.Account account = request.mAccount;
5663 ContentResolver.requestSync(account, request.mAuthority, extras);
5665 account.toString(), extras.toString());
5677 private final android.accounts.Account mAccount;
5680 private SyncRequestMessage(final String authority, final android.accounts.Account account,
5683 mAccount = account;