Lines Matching refs:account
25 import com.android.emailcommon.provider.Account;
40 public static Sender newInstance(Account account) throws MessagingException {
42 + account.mDisplayName);
45 private static Sender instantiateSender(Context context, String className, Account account)
52 c.getMethod("newInstance", Account.class, Context.class);
53 o = m.invoke(null, account, context);
56 "exception %s invoking method %s#newInstance(Account, Context) for %s",
57 e.toString(), className, account.mDisplayName));
58 throw new MessagingException("can not instantiate Sender for " + account.mDisplayName);
62 account.mDisplayName + ": " + className + " create incompatible object");
70 private static Sender findSender(Context context, int resourceId, Account account)
76 HostAuth sendAuth = account.getOrCreateHostAuthSend(context);
86 sender = instantiateSender(context, className, account);
99 * Get an instance of a mail sender for the given account. The account must be valid (i.e. has
103 * @param account the account of the sender.
105 * @throws MessagingException If the sender cannot be obtained or if the account is invalid.
107 public synchronized static Sender getInstance(Context context, Account account)
110 Sender sender = findSender(appContext, R.xml.senders_product, account);
112 sender = findSender(appContext, R.xml.senders, account);
115 throw new MessagingException("Cannot find sender for account " + account.mDisplayName);