auto import from //branches/cupcake/...@132276
This commit is contained in:
parent
ff4eb775df
commit
88a1d6f92d
@ -94,7 +94,9 @@
|
||||
|
||||
<activity
|
||||
android:name=".activity.AccountShortcutPicker"
|
||||
android:label="@string/app_name">
|
||||
android:label="@string/app_name"
|
||||
android:enabled="false"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CREATE_SHORTCUT" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Při příchodu e-mailu také vibrovat"</string>
|
||||
<string name="account_settings_ringtone">"Zvolit vyzváněcí tón"</string>
|
||||
<string name="account_settings_servers">"Nastavení serveru"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Odebrat účet"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"Účet <xliff:g id="ACCOUNT">%s</xliff:g> bude z aplikace Email odebrán."</string>
|
||||
<string name="provider_note_yahoo">"Přístup do schránky není u některých poštovních účtů Yahoo! podporován. Pokud máte problémy s připojením, získáte další informace na webové stránce yahoo.com."</string>
|
||||
<string name="provider_note_yahoo_uk">"Před nastavením tohoto e-mailového účtu přejděte na web Yahoo! a povolte u tohoto účtu e-mailový přístup POP3."</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Bei E-Mail-Eingang zusätzlich vibrieren"</string>
|
||||
<string name="account_settings_ringtone">"Klingelton auswählen"</string>
|
||||
<string name="account_settings_servers">"Servereinstellungen"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Konto entfernen"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"Das Konto \"<xliff:g id="ACCOUNT">%s</xliff:g>\" wird aus Email entfernt."</string>
|
||||
<string name="provider_note_yahoo">"Der Zugang zum Postfach bestimmter E-Mail-Konten von Yahoo! wird nicht unterstützt. Bei Verbindungsproblemen besuchen Sie die Website von Yahoo! für weitere Informationen."</string>
|
||||
<string name="provider_note_yahoo_uk">"Vor Eröffnung dieses E-Mail-Kontos bitte die Website von Yahoo! besuchen und E-Mail-Zugang über POP3 für dieses Konto aktivieren."</string>
|
||||
|
@ -37,7 +37,7 @@
|
||||
<string name="compose_action">"Redactar"</string>
|
||||
<string name="search_action">"Buscar"</string>
|
||||
<string name="open_action">"Abrir"</string>
|
||||
<string name="account_settings_action">"Configuración de la cuenta"</string>
|
||||
<string name="account_settings_action">"Configuración"</string>
|
||||
<string name="remove_account_action">"Eliminar cuenta"</string>
|
||||
<string name="accounts_action">"Cuentas"</string>
|
||||
<string name="mark_as_read_action">"Marcar como leída"</string>
|
||||
@ -152,7 +152,7 @@
|
||||
<string name="account_settings_default_summary">"Enviar correo electrónico desde esta cuenta de forma predeterminada"</string>
|
||||
<string name="account_settings_notify_label">"Notificaciones de correo electrónico"</string>
|
||||
<string name="account_settings_notify_summary">"Notificar en la barra de estado cuando llegue un mensaje"</string>
|
||||
<string name="account_settings_mail_check_frequency_label">"Frecuencia de comprobación del correo electrónico"</string>
|
||||
<string name="account_settings_mail_check_frequency_label">"Frecuencia de comprobación del correo"</string>
|
||||
<string name="account_settings_incoming_label">"Configuración entrante"</string>
|
||||
<string name="account_settings_outgoing_label">"Configuración saliente"</string>
|
||||
<string name="account_settings_add_account_label">"Añadir otra cuenta"</string>
|
||||
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Vibrar también cuando llegue un mensaje"</string>
|
||||
<string name="account_settings_ringtone">"Seleccionar tono de llamada"</string>
|
||||
<string name="account_settings_servers">"Configuración del servidor"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Eliminar cuenta"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"Se va a eliminar la cuenta \"<xliff:g id="ACCOUNT">%s</xliff:g>\" de \"Correo electrónico\"."</string>
|
||||
<string name="provider_note_yahoo">"Algunos tipos de cuentas de correo de Yahoo! no permiten acceder al buzón de correo. Si tienes problemas de conexión, visita yahoo.com para obtener información adicional al respecto."</string>
|
||||
<string name="provider_note_yahoo_uk">"Antes de configurar esta cuenta de correo electrónico, visita el sitio web de Yahoo! y habilita el acceso al correo electrónico POP3 para esta cuenta."</string>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<string name="reply_all_action">"Répondre à tous"</string>
|
||||
<string name="delete_action">"Supprimer"</string>
|
||||
<string name="forward_action">"Transférer"</string>
|
||||
<string name="done_action">"Terminé"</string>
|
||||
<string name="done_action">"OK"</string>
|
||||
<string name="discard_action">"Supprimer"</string>
|
||||
<string name="save_draft_action">"Enregistrer en tant que brouillon"</string>
|
||||
<string name="refresh_action">"Actualiser"</string>
|
||||
@ -115,7 +115,7 @@
|
||||
<string name="account_setup_incoming_delete_policy_label">"Supprimer les e-mails du serveur"</string>
|
||||
<string name="account_setup_incoming_delete_policy_never_label">"Jamais"</string>
|
||||
<string name="account_setup_incoming_delete_policy_7days_label">"Au bout de 7 jours"</string>
|
||||
<string name="account_setup_incoming_delete_policy_delete_label">"Lorsque je supprime des messages de la boîte de réception"</string>
|
||||
<string name="account_setup_incoming_delete_policy_delete_label">"Si messages suppr. de boîte de récep."</string>
|
||||
<string name="account_setup_incoming_imap_path_prefix_label">"Préfixe du chemin IMAP"</string>
|
||||
<string name="account_setup_incoming_imap_path_prefix_hint">"Facultatif"</string>
|
||||
<string name="account_setup_outgoing_title">"Paramètres de serveur sortant"</string>
|
||||
@ -126,7 +126,7 @@
|
||||
<string name="account_setup_outgoing_username_label">"Nom d\'utilisateur"</string>
|
||||
<string name="account_setup_outgoing_password_label">"Mot de passe"</string>
|
||||
<string name="account_setup_options_title">"Options de compte"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_label">"Fréquence de vérification des e-mails"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_label">"Vérification des e-mails"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_never">"Jamais"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_5min">"Toutes les 5 minutes"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_10min">"Toutes les 10 minutes"</string>
|
||||
@ -150,7 +150,7 @@
|
||||
<string name="account_settings_title_fmt">"Paramètres généraux"</string>
|
||||
<string name="account_settings_default_label">"Compte par défaut"</string>
|
||||
<string name="account_settings_default_summary">"Par défaut, envoyer les e-mails avec ce compte"</string>
|
||||
<string name="account_settings_notify_label">"Notifications de nouveaux e-mails"</string>
|
||||
<string name="account_settings_notify_label">"Notifications d\'e-mails"</string>
|
||||
<string name="account_settings_notify_summary">"Afficher une notification dans la barre d\'état lors de la réception d\'un e-mail"</string>
|
||||
<string name="account_settings_mail_check_frequency_label">"Fréquence de vérification des e-mails"</string>
|
||||
<string name="account_settings_incoming_label">"Paramètres de réception"</string>
|
||||
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Vibrer également lors de la réception d\'un e-mail"</string>
|
||||
<string name="account_settings_ringtone">"Sélectionner la sonnerie"</string>
|
||||
<string name="account_settings_servers">"Paramètres du serveur"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Supprimer le compte"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"Le compte \"<xliff:g id="ACCOUNT">%s</xliff:g>\" va être supprimé de votre messagerie."</string>
|
||||
<string name="provider_note_yahoo">"L\'accès à la boîte aux lettres n\'est pas possible avec certains types de comptes Yahoo!. En cas de problème de connexion, consultez le site yahoo.fr pour obtenir plus d\'informations."</string>
|
||||
<string name="provider_note_yahoo_uk">"Avant de configurer ce compte de messagerie, veuillez consulter le site de Yahoo! et activer l\'accès POP3 pour ce compte."</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Attiva anche vibrazione all\'arrivo di email"</string>
|
||||
<string name="account_settings_ringtone">"Seleziona suoneria"</string>
|
||||
<string name="account_settings_servers">"Impostazioni server"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Rimuovi account"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"L\'account \"<xliff:g id="ACCOUNT">%s</xliff:g>\" verrà rimosso da Email."</string>
|
||||
<string name="provider_note_yahoo">"Accesso alla casella di posta non supportato per alcuni tipi di account di posta Yahoo!. Se hai problemi di connessione, visita il sito yahoo.com per ulteriori informazioni."</string>
|
||||
<string name="provider_note_yahoo_uk">"Prima di impostare questo account email, visita il sito web Yahoo! e attiva l\'accesso email POP3 per questo account."</string>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="read_attachment_label">"メールの添付ファイルを読み取る"</string>
|
||||
<string name="read_attachment_desc">"このアプリケーションでメールの添付ファイルを表示できるようにします。"</string>
|
||||
<string name="read_attachment_desc">"メールの添付ファイルの表示をこのアプリケーションに許可します。"</string>
|
||||
<string name="app_name">"メール"</string>
|
||||
<string name="accounts_title">"アカウント"</string>
|
||||
<string name="compose_title">"作成"</string>
|
||||
@ -94,7 +94,7 @@
|
||||
<string name="account_setup_check_settings_canceling_msg">"キャンセル中..."</string>
|
||||
<string name="account_setup_names_title">"メールアカウントの登録"</string>
|
||||
<string name="account_setup_names_instructions">"アカウントの設定が完了しました。"</string>
|
||||
<string name="account_setup_names_account_name_label">"このアカウントに名前を付ける (省略可)"</string>
|
||||
<string name="account_setup_names_account_name_label">"アカウントに名前を付ける(省略可)"</string>
|
||||
<string name="account_setup_names_user_name_label">"名前 (送信メールに表示されます)"</string>
|
||||
<string name="account_setup_account_type_title">"新しいメールアカウントを追加"</string>
|
||||
<string name="account_setup_account_type_instructions">"このアカウントのタイプ"</string>
|
||||
@ -128,11 +128,11 @@
|
||||
<string name="account_setup_options_title">"アカウントのオプション"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_label">"メールチェックの頻度"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_never">"なし"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_5min">"5分ごと"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_10min">"10分ごと"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_15min">"15分ごと"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_30min">"30分ごと"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_1hour">"1時間ごと"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_5min">"5分毎"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_10min">"10分毎"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_15min">"15分毎"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_30min">"30分毎"</string>
|
||||
<string name="account_setup_options_mail_check_frequency_1hour">"1時間毎"</string>
|
||||
<string name="account_setup_options_default_label">"いつもこのアカウントでメールを送信する"</string>
|
||||
<string name="account_setup_options_notify_label">"メールの着信を知らせる"</string>
|
||||
<string name="account_setup_failed_dlg_title">"セットアップできませんでした"</string>
|
||||
@ -160,11 +160,10 @@
|
||||
<string name="account_settings_name_label">"名前"</string>
|
||||
<string name="account_settings_notifications">"通知設定"</string>
|
||||
<string name="account_settings_vibrate_enable">"バイブレーション"</string>
|
||||
<string name="account_settings_vibrate_summary">"メールの着信をバイブレーションでも知らせる"</string>
|
||||
<string name="account_settings_vibrate_summary">"メール受信: バイブレーションもON"</string>
|
||||
<string name="account_settings_ringtone">"着信音を選択"</string>
|
||||
<string name="account_settings_servers">"サーバーの設定"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"アカウントを削除"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"アカウント「<xliff:g id="ACCOUNT">%s</xliff:g>」をメールから削除します。"</string>
|
||||
<string name="provider_note_yahoo">"一部のタイプの Yahoo! メール アカウントでは、受信トレイへのアクセスがサポートされていません。接続できない場合は yahoo.com にアクセスして詳細をご確認ください。"</string>
|
||||
<string name="provider_note_yahoo_uk">"このメールアカウントを設定する前に、Yahoo!サイトでこのアカウントのPOP3メールアクセスを有効にしてください。"</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"이메일 도착 시 진동"</string>
|
||||
<string name="account_settings_ringtone">"벨소리 선택"</string>
|
||||
<string name="account_settings_servers">"서버 설정"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"계정 삭제"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"계정(<xliff:g id="ACCOUNT">%s</xliff:g>)이 이메일에서 삭제됩니다."</string>
|
||||
<string name="provider_note_yahoo">"일부 Yahoo! 메일 계정의 경우 편지함에 액세스할 수 없습니다. 접속에 문제가 있을 경우 자세한 정보는 yahoo.com을 참조하세요."</string>
|
||||
<string name="provider_note_yahoo_uk">"이메일 계정을 설정하기 전에 Yahoo! 웹사이트를 방문하여 이 계정에 대한 POP3 이메일 액세스를 사용 설정하세요."</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Ook trillen bij ontvangst van e-mail"</string>
|
||||
<string name="account_settings_ringtone">"Beltoon selecteren"</string>
|
||||
<string name="account_settings_servers">"Serverinstellingen"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Account verwijderen"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"De account <xliff:g id="ACCOUNT">%s</xliff:g> wordt verwijderd van E-mail"</string>
|
||||
<string name="provider_note_yahoo">"Toegang tot postvakken wordt niet ondersteund door sommige typen Yahoo!-mailaccounts. Als er problemen ontstaan bij het verbinden, ga je naar yahoo.com voor meer informatie."</string>
|
||||
<string name="provider_note_yahoo_uk">"Ga voordat je deze e-mailaccount instelt naar de website van Yahoo! en schakel toegang met POP3 in voor deze account."</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Sygnalizuj wibracjami otrzymanie wiadomości e-mail"</string>
|
||||
<string name="account_settings_ringtone">"Wybierz dzwonek"</string>
|
||||
<string name="account_settings_servers">"Ustawienia serwera"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Usuń konto"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"Konto <xliff:g id="ACCOUNT">%s</xliff:g> zostanie usunięte z usługi poczty e-mail."</string>
|
||||
<string name="provider_note_yahoo">"Dostęp do skrzynki pocztowej nie jest obsługiwany w przypadku kilku typów kont pocztowych w usłudze Yahoo! Jeśli podczas nawiązywania połączenia występują problemy, odwiedź witrynę yahoo.com w celu uzyskania dodatkowych informacji."</string>
|
||||
<string name="provider_note_yahoo_uk">"Przed skonfigurowaniem tego konta e-mail odwiedź witrynę usługi Yahoo! i włącz dostęp do poczty POP3."</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"Также включить вибрацию при получении почты"</string>
|
||||
<string name="account_settings_ringtone">"Выбрать мелодию"</string>
|
||||
<string name="account_settings_servers">"Настройки сервера"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"Удалить аккаунт"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"Аккаунт \"<xliff:g id="ACCOUNT">%s</xliff:g>\" будет удален из системы электронной почты."</string>
|
||||
<string name="provider_note_yahoo">"Доступ к почтовому ящику для некоторых типов почтовых аккаунтов Yahoo! не поддерживается. Если при подключении возникли проблемы, см. дополнительные сведения на yahoo.com."</string>
|
||||
<string name="provider_note_yahoo_uk">"Чтобы настроить этот аккаунт электронной почты, перейдите на веб-сайт Yahoo! и включите для этого аккаунта доступ по протоколу POP3."</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"收到电子邮件时发出振动"</string>
|
||||
<string name="account_settings_ringtone">"选择铃声"</string>
|
||||
<string name="account_settings_servers">"服务器设置"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"删除帐户"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"帐户“<xliff:g id="ACCOUNT">%s</xliff:g>”将从电子邮件中删除。"</string>
|
||||
<string name="provider_note_yahoo">"某些类型的 Yahoo! 邮件帐户不支持邮箱访问。如果您在连接时遇到问题,请访问 yahoo.com 了解更多信息。"</string>
|
||||
<string name="provider_note_yahoo_uk">"在设置此电子邮件帐户之前,请访问 Yahoo! 网站,并为此帐户启用 POP3 电子邮件服务。"</string>
|
||||
|
@ -163,8 +163,7 @@
|
||||
<string name="account_settings_vibrate_summary">"收到電子郵件時也振動"</string>
|
||||
<string name="account_settings_ringtone">"選取鈴聲"</string>
|
||||
<string name="account_settings_servers">"伺服器設定"</string>
|
||||
<!-- no translation found for account_delete_dlg_title (6806087520856396608) -->
|
||||
<skip />
|
||||
<string name="account_delete_dlg_title">"移除帳戶"</string>
|
||||
<string name="account_delete_dlg_instructions_fmt">"系統將從 [電子郵件] 中移除帳戶「<xliff:g id="ACCOUNT">%s</xliff:g>」。"</string>
|
||||
<string name="provider_note_yahoo">"不支援某些類型的 Yahoo! 郵件帳戶信箱。如果您無法順利連線,請造訪 yahoo.com 以取得詳細資訊。"</string>
|
||||
<string name="provider_note_yahoo_uk">"在設定此電子郵件帳戶前,請先造訪 Yahoo! 網站,並啟用這個帳戶的 POP3 電子郵件收發功能。"</string>
|
||||
|
@ -16,20 +16,18 @@
|
||||
|
||||
package com.android.email;
|
||||
|
||||
import java.io.File;
|
||||
import com.android.email.activity.AccountShortcutPicker;
|
||||
import com.android.email.activity.MessageCompose;
|
||||
import com.android.email.mail.internet.BinaryTempFileBody;
|
||||
import com.android.email.service.BootReceiver;
|
||||
import com.android.email.service.MailService;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Config;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.email.activity.MessageCompose;
|
||||
import com.android.email.mail.internet.BinaryTempFileBody;
|
||||
import com.android.email.mail.internet.MimeMessage;
|
||||
import com.android.email.service.BootReceiver;
|
||||
import com.android.email.service.MailService;
|
||||
import java.io.File;
|
||||
|
||||
public class Email extends Application {
|
||||
public static final String LOG_TAG = "Email";
|
||||
@ -142,6 +140,11 @@ public class Email extends Application {
|
||||
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
pm.setComponentEnabledSetting(
|
||||
new ComponentName(context, AccountShortcutPicker.class),
|
||||
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
pm.setComponentEnabledSetting(
|
||||
new ComponentName(context, BootReceiver.class),
|
||||
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
|
||||
|
@ -64,7 +64,6 @@ public class AccountShortcutPicker extends ListActivity implements OnItemClickLi
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
// TODO : enable/disable this activity if no accounts are configured
|
||||
|
||||
setContentView(R.layout.accounts);
|
||||
ListView listView = getListView();
|
||||
|
@ -16,45 +16,6 @@
|
||||
|
||||
package com.android.email.activity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.OpenableColumns;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.util.Rfc822Tokenizer;
|
||||
import android.util.Config;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnFocusChangeListener;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.AutoCompleteTextView.Validator;
|
||||
|
||||
import com.android.email.Account;
|
||||
import com.android.email.Email;
|
||||
import com.android.email.EmailAddressAdapter;
|
||||
@ -80,6 +41,48 @@ import com.android.email.mail.internet.TextBody;
|
||||
import com.android.email.mail.store.LocalStore;
|
||||
import com.android.email.mail.store.LocalStore.LocalAttachmentBody;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.OpenableColumns;
|
||||
import android.text.InputFilter;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.util.Rfc822Tokenizer;
|
||||
import android.util.Config;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnFocusChangeListener;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.AutoCompleteTextView.Validator;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class MessageCompose extends Activity implements OnClickListener, OnFocusChangeListener {
|
||||
private static final String ACTION_REPLY = "com.android.email.intent.action.REPLY";
|
||||
private static final String ACTION_REPLY_ALL = "com.android.email.intent.action.REPLY_ALL";
|
||||
@ -311,12 +314,69 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
||||
public void afterTextChanged(android.text.Editable s) { }
|
||||
};
|
||||
|
||||
/**
|
||||
* Implements special address cleanup rules:
|
||||
* The first space key entry following an "@" symbol that is followed by any combination
|
||||
* of letters and symbols, including one+ dots and zero commas, should insert an extra
|
||||
* comma (followed by the space).
|
||||
*/
|
||||
InputFilter recipientFilter = new InputFilter() {
|
||||
|
||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
||||
int dstart, int dend) {
|
||||
|
||||
// quick check - did they enter a single space?
|
||||
if (end-start != 1 || source.charAt(start) != ' ') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// determine if the characters before the new space fit the pattern
|
||||
// follow backwards and see if we find a comma, dot, or @
|
||||
int scanBack = dstart;
|
||||
boolean dotFound = false;
|
||||
while (scanBack > 0) {
|
||||
char c = dest.charAt(--scanBack);
|
||||
switch (c) {
|
||||
case '.':
|
||||
dotFound = true; // one or more dots are req'd
|
||||
break;
|
||||
case ',':
|
||||
return null;
|
||||
case '@':
|
||||
if (!dotFound) {
|
||||
return null;
|
||||
}
|
||||
// we have found a comma-insert case. now just do it
|
||||
// in the least expensive way we can.
|
||||
if (source instanceof Spanned) {
|
||||
SpannableStringBuilder sb = new SpannableStringBuilder(",");
|
||||
sb.append(source);
|
||||
return sb;
|
||||
} else {
|
||||
return ", ";
|
||||
}
|
||||
default:
|
||||
// just keep going
|
||||
}
|
||||
}
|
||||
|
||||
// no termination cases were found, so don't edit the input
|
||||
return null;
|
||||
}
|
||||
};
|
||||
InputFilter[] recipientFilters = new InputFilter[] { recipientFilter };
|
||||
|
||||
mToView.addTextChangedListener(watcher);
|
||||
mCcView.addTextChangedListener(watcher);
|
||||
mBccView.addTextChangedListener(watcher);
|
||||
mSubjectView.addTextChangedListener(watcher);
|
||||
mMessageContentView.addTextChangedListener(watcher);
|
||||
|
||||
// NOTE: assumes no other filters are set
|
||||
mToView.setFilters(recipientFilters);
|
||||
mCcView.setFilters(recipientFilters);
|
||||
mBccView.setFilters(recipientFilters);
|
||||
|
||||
/*
|
||||
* We set this to invisible by default. Other methods will turn it back on if it's
|
||||
* needed.
|
||||
|
101
tests/src/com/android/email/PreferencesUnitTests.java
Normal file
101
tests/src/com/android/email/PreferencesUnitTests.java
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.email;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
/**
|
||||
* This is a series of unit tests for the Preferences class.
|
||||
*
|
||||
* Technically these are functional because they use the underlying preferences framework. It
|
||||
* would be a really good idea if we could inject our own underlying preferences storage, to better
|
||||
* test cases like zero accounts behavior (right now, we have to allow for any number of accounts
|
||||
* already being on the device, and not trashing any.)
|
||||
*/
|
||||
@SmallTest
|
||||
public class PreferencesUnitTests extends AndroidTestCase {
|
||||
|
||||
private Preferences mPreferences;
|
||||
|
||||
private String mUuid;
|
||||
private Account mAccount;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
mPreferences = Preferences.getPreferences(getContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete any dummy accounts we set up for this test
|
||||
*/
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
|
||||
if (mAccount != null && mPreferences != null) {
|
||||
mAccount.delete(mPreferences);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the new getAccountByContentUri() API. This should return null if no
|
||||
* accounts are configured, or the Uri doesn't match, and it should return a desired account
|
||||
* otherwise.
|
||||
*
|
||||
* TODO: Not actually testing the no-accounts case
|
||||
*/
|
||||
public void testGetAccountByContentUri() {
|
||||
// Create a dummy account
|
||||
createTestAccount();
|
||||
|
||||
// test sunny-day lookup by Uri
|
||||
Uri testAccountUri = mAccount.getContentUri();
|
||||
Account lookup = mPreferences.getAccountByContentUri(testAccountUri);
|
||||
assertEquals(mAccount, lookup);
|
||||
|
||||
// now make it a bogus Uri - bad scheme, good path, good UUID
|
||||
testAccountUri = Uri.parse("bogus://accounts/" + mAccount.getUuid());
|
||||
lookup = mPreferences.getAccountByContentUri(testAccountUri);
|
||||
assertNull(lookup);
|
||||
|
||||
// now make it a bogus Uri - good scheme, bad path, good UUID
|
||||
testAccountUri = Uri.parse("content://bogus/" + mAccount.getUuid());
|
||||
lookup = mPreferences.getAccountByContentUri(testAccountUri);
|
||||
assertNull(lookup);
|
||||
|
||||
// now make it a bogus Uri - good scheme/path, bad UUID
|
||||
testAccountUri = Uri.parse("content://accounts/" + mAccount.getUuid() + "-bogus");
|
||||
lookup = mPreferences.getAccountByContentUri(testAccountUri);
|
||||
assertNull(lookup);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a dummy account with minimal fields
|
||||
*/
|
||||
private void createTestAccount() {
|
||||
mAccount = new Account(getContext());
|
||||
mAccount.save(mPreferences);
|
||||
|
||||
mUuid = mAccount.getUuid();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.email.activity;
|
||||
|
||||
import com.android.email.Account;
|
||||
import com.android.email.Preferences;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
/**
|
||||
* This is a series of unit tests for the Preferences class.
|
||||
*
|
||||
* This is just unit tests of simple statics - the activity is not instantiated
|
||||
*/
|
||||
@SmallTest
|
||||
public class FolderMessageListUnitTests extends AndroidTestCase {
|
||||
|
||||
private Preferences mPreferences;
|
||||
|
||||
private String mUuid;
|
||||
private Account mAccount;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
mPreferences = Preferences.getPreferences(getContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete any dummy accounts we set up for this test
|
||||
*/
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
|
||||
if (mAccount != null && mPreferences != null) {
|
||||
mAccount.delete(mPreferences);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of actionHandleAccount() variants. Make sure they generate correct intents and
|
||||
* then call startActivity() with them.
|
||||
*/
|
||||
public void testActionHandleAccount() {
|
||||
// Create a dummy account
|
||||
createTestAccount();
|
||||
|
||||
// Create a mock context to catch the startActivity calls
|
||||
MyContext mockContext = new MyContext(getContext());
|
||||
|
||||
// First, try with no initial folder
|
||||
FolderMessageList.actionHandleAccount(mockContext, mAccount);
|
||||
Intent i = mockContext.startActivityIntent;
|
||||
assertNotNull(i);
|
||||
checkIntent(i, null, mAccount, null);
|
||||
|
||||
// Next try with initial folder specified
|
||||
FolderMessageList.actionHandleAccount(mockContext, mAccount, "test-folder-name");
|
||||
i = mockContext.startActivityIntent;
|
||||
assertNotNull(i);
|
||||
checkIntent(i, null, mAccount, "test-folder-name");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of actionHandleAccountIntent(). Make sure it generates correct intents.
|
||||
*/
|
||||
public void testActionHandleAccountIntent() {
|
||||
// Create a dummy account
|
||||
createTestAccount();
|
||||
|
||||
// First try with no initial folder
|
||||
Intent result = FolderMessageList.actionHandleAccountIntent(
|
||||
getContext(), mAccount, null);
|
||||
checkIntent(result, null, mAccount, null);
|
||||
|
||||
// now try with a specified initial folder
|
||||
result = FolderMessageList.actionHandleAccountIntent(
|
||||
getContext(), mAccount, "test-folder-name");
|
||||
checkIntent(result, null, mAccount, "test-folder-name");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of actionHandleAccountUriIntent(). Make sure it generates correct intents.
|
||||
*/
|
||||
public void testActionHandleAccountUriIntent() {
|
||||
// Create a dummy account
|
||||
createTestAccount();
|
||||
|
||||
// First try with no initial folder
|
||||
Intent result = FolderMessageList.actionHandleAccountUriIntent(
|
||||
getContext(), mAccount, null);
|
||||
checkIntent(result, mAccount.getContentUri(), null, null);
|
||||
|
||||
// now try with a specified initial folder
|
||||
result = FolderMessageList.actionHandleAccountUriIntent(
|
||||
getContext(), mAccount, "test-folder-name");
|
||||
checkIntent(result, mAccount.getContentUri(), null, "test-folder-name");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the values in a generated intent
|
||||
*/
|
||||
private void checkIntent(Intent i,
|
||||
Uri expectData, Account expectAccount, String expectFolder) {
|
||||
|
||||
Uri resultUri = i.getData();
|
||||
assertEquals(expectData, resultUri);
|
||||
|
||||
Account resultAccount = (Account) i.getSerializableExtra("account");
|
||||
assertEquals(expectAccount, resultAccount);
|
||||
|
||||
String resultFolder = i.getStringExtra("initialFolder");
|
||||
assertEquals(expectFolder, resultFolder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a dummy account with minimal fields
|
||||
*/
|
||||
private void createTestAccount() {
|
||||
mAccount = new Account(getContext());
|
||||
mAccount.save(mPreferences);
|
||||
|
||||
mUuid = mAccount.getUuid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock Context so we can catch the startActivity call in actionHandleAccount()
|
||||
*/
|
||||
private static class MyContext extends ContextWrapper {
|
||||
|
||||
Intent startActivityIntent = null;
|
||||
|
||||
public MyContext(Context base) {
|
||||
super(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent i) {
|
||||
startActivityIntent = i;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -32,6 +32,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.content.Context;
|
||||
@ -368,6 +369,54 @@ public class MessageComposeInstrumentationTests
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the comma-inserting logic. The logic is applied equally to To: Cc: and Bcc:
|
||||
* but we only run the full set on To:
|
||||
*/
|
||||
public void testCommaInserting() throws Throwable {
|
||||
// simple appending cases
|
||||
checkCommaInsert("a", "", false);
|
||||
checkCommaInsert("a@", "", false);
|
||||
checkCommaInsert("a@b", "", false);
|
||||
checkCommaInsert("a@b.", "", true); // non-optimal, but matches current implementation
|
||||
checkCommaInsert("a@b.c", "", true);
|
||||
|
||||
// confirm works properly for internal editing
|
||||
checkCommaInsert("me@foo.com, you", " they@bar.com", false);
|
||||
checkCommaInsert("me@foo.com, you@", "they@bar.com", false);
|
||||
checkCommaInsert("me@foo.com, you@bar", " they@bar.com", false);
|
||||
checkCommaInsert("me@foo.com, you@bar.", " they@bar.com", true); // non-optimal
|
||||
checkCommaInsert("me@foo.com, you@bar.com", " they@bar.com", true);
|
||||
|
||||
// check a couple of multi-period cases
|
||||
checkCommaInsert("me.myself@foo", "", false);
|
||||
checkCommaInsert("me.myself@foo.com", "", true);
|
||||
checkCommaInsert("me@foo.co.uk", "", true);
|
||||
|
||||
// cases that should not append because there's already a comma
|
||||
checkCommaInsert("a@b.c,", "", false);
|
||||
checkCommaInsert("me@foo.com, you@bar.com,", " they@bar.com", false);
|
||||
checkCommaInsert("me.myself@foo.com,", "", false);
|
||||
checkCommaInsert("me@foo.co.uk,", "", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check comma insertion logic for a single try on the To: field
|
||||
*/
|
||||
private void checkCommaInsert(final String before, final String after, boolean expectComma)
|
||||
throws Throwable {
|
||||
String expect = new String(before + (expectComma ? ", " : " ") + after);
|
||||
|
||||
runTestOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
mToView.setText(before + after);
|
||||
mToView.setSelection(before.length());
|
||||
}
|
||||
});
|
||||
getInstrumentation().sendStringSync(" ");
|
||||
String result = mToView.getText().toString();
|
||||
assertEquals(expect, result);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user