diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 4c3de3ea5..29ff20015 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ - - + + - - + - - + - - - - - - + + - - - - - - - - - - - - Building version number ${version-name} + + - - Setting version to ${version-name} - You can't set the version without passing -Dversion-name=1.234 - - - - - - - + - - Bumping K-9 to ${version-name} - + To customize existing targets, there are two options: + - Customize only one target: + - copy/paste the target into this file, *before* the + task. + - customize it to your needs. + - Customize the whole content of build.xml + - copy/paste the content of the rules files (minus the top node) + into this file, replacing the task. + - customize to your needs. - - - - - - - - - - - - - - + *********************** + ****** IMPORTANT ****** + *********************** + In all cases you must update the value of version-tag below to read 'custom' instead of an integer, + in order to avoid having your file be overridden by tools such as "android update project" + --> + + + + + + + + + + + + + + Building version number ${version-name} + + + + + + + Building version number ${version-name} + + + + Setting version to ${version-name} + You can't set the version without passing -Dversion-name=1.234 + + + + + + + + + + + Bumping K-9 to ${version-name} + + + + + + + + + + + + + + + + - - Creating library ${rclib} for remote control - applications - - + + Creating library ${rclib} for remote control applications + - Uploading to Google Code using Google::Code::Upload @@ -125,7 +159,7 @@ - + Installing ${out.debug.file} onto default emulator... @@ -134,12 +168,20 @@ + + + Reinstalling ${out.debug.file} onto default emulator... + + + + + + - - + @@ -160,28 +202,7 @@ Bumps the project version to 3.123,tags and commits it astyle: Make K-9's source look like it's supposed to eclipse: Apply template Eclipse settings - - - - - + @@ -189,4 +210,7 @@ + + + diff --git a/docs/activity_diagram.graphml b/docs/activity_diagram.graphml new file mode 100644 index 000000000..a2f1a4216 --- /dev/null +++ b/docs/activity_diagram.graphml @@ -0,0 +1,936 @@ + + + + + + + + + + + + + + + + + + + + + + + Accounts + + + + + + + + + + + FolderList + + + + + + + + + + + MessageList + + + + + + + + + + + MessageView + + + + + + + + + + + AccountSettings + + + + + + + + + + + AccountSetupIncoming + + + + + + + + + + + AccountSetupOutgoing + + + + + + + + + + + Prefs + + + + + + + + + + + FontSizeSettings + + + + + + + + + + + AccountSetupOptions + + + + + + + + + + + AccountSetupNames + + + + + + + + + + + AccountSetupComposition + + + + + + + + + + + AccountSetupCheckSettings + + + + + + + + + + + AccountSetupBasics + + + + + + + + + + + AccountSetupAccountType + + + + + + + + + + + FolderSettings + + + + + + + + + + + ChooseAccount + + + + + + + + + + + ChooseFolder + + + + + + + + + + + ChooseIdentity + + + + + + + + + + + EditIdentity + + + + + + + + + + + LauncherShortcuts + + + + + + + + + + + ManageIdentities + + + + + + + + + + + MessageCompose + + + + + + + + + + + Other Apps / OS + + + + + + + + + + + Search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/k9mail.iml b/k9mail.iml index 1f9d13dd0..e43c002f0 100644 --- a/k9mail.iml +++ b/k9mail.iml @@ -28,7 +28,7 @@ - + diff --git a/proguard.cfg b/proguard.cfg new file mode 100644 index 000000000..b1cdf17b5 --- /dev/null +++ b/proguard.cfg @@ -0,0 +1,40 @@ +-optimizationpasses 5 +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-dontpreverify +-verbose +-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* + +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference +-keep public class com.android.vending.licensing.ILicensingService + +-keepclasseswithmembernames class * { + native ; +} + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet); +} + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet, int); +} + +-keepclassmembers class * extends android.app.Activity { + public void *(android.view.View); +} + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} diff --git a/default.properties b/project.properties similarity index 81% rename from default.properties rename to project.properties index 8fc4bac37..213821e1f 100644 --- a/default.properties +++ b/project.properties @@ -1,15 +1,15 @@ # This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# +# # This file must be checked in Version Control Systems. -# +# # To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your +# "ant.properties", and override values to adapt the script to your # project structure. # Indicates whether an apk should be generated for each density. split.density=false -# Project target. -target=android-10 -extensible.libs.classpath=compile-only-libs java.encoding=utf8 +# Project target. +target=android-9 +extensible.libs.classpath=compile-only-libs diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index 1eecccdeb..7b25cc3ed 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -83,8 +83,6 @@ Esborra el compte Suprimeix totes les accions pendents (Compte!) - - Comptes @@ -110,6 +108,9 @@ Veu/amaga detalls Afegeix Cc/Bcc Edita assumpte + + + Afegeix adjunt Afegeix adjunt (Imatge) Afegeix adjunt (Vídeo) @@ -265,11 +266,10 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An %s ha escrit:\n\n Text citat Has d’afegir-hi, com a mínim, un destinatari. - + No s\'ha trobat cap adreça de correu. Alguns adjunts no s’han carregat. Es carregaran automàticament abans no s’enviï aquest missatge. Alguns adjunts no es poden reenviar perquè no s’han carregat. - - + De: %s <%s> A: @@ -289,7 +289,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Recollint l’adjunt. No ha estat capaç de trobar un visualitzador per %s. - Descarrega el missatge complet @@ -316,7 +315,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Sobre %s Versió: %s - Mostra estels Els estels indiquen els missatges senyalats Selecció múltiple @@ -336,6 +334,8 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Utilitza una amplada fixa de lletra quan es mostri missatges de text net Torna a la llista després esborrar Torna a la llista de missatges després esborrar missatges + + Confirma accions Mostra un diàleg cada vegada que executis accions seleccionades @@ -348,13 +348,11 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Bloca notificacions No mostris l’assumpte del missatge a la barra de notificacions quan el telèfon estigui blocat - Mode silenciós Deshabilita so de trucada, brunzit i llums durant la nit Mode silenciós comença Mode silenciós acaba - Configura un compte nou Entra l’adreça de correu d’aquest compte: (Pots afegir-hi %d més comptes.) @@ -517,7 +515,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An 1000 missatges Tots els missatges - No es pot copiar o moure un missatge que no està sincronitzat amb el servidor No s’ha pogut acabar la configuració @@ -561,6 +558,9 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Tramesa correu + + + Contesta després del text citat Quan contestis, el missatge original apareixerà sobre de la contesta. @@ -568,6 +568,9 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Text net (es trauran el format i les imatges) HTML (es conservaran el format i les imatges) + + + Contesta amb estil cita Prefix (com a Gmail, Pine) Capçalera (com a l’Outlook, Yahoo!, Hotmail) @@ -591,7 +594,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Emmagatzematge - Color del compte Tria el color del compte utilitzat a la llista de carpetes i de comptes @@ -613,6 +615,8 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An 512Kb 1Mb 2Mb + + qualsevol mida (sense límit) Sincronitza des de @@ -629,7 +633,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An els darrers 6 mesos el darrer any - Carpetes a mostrar Tot Només carpetes de 1a Classe @@ -704,7 +707,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An LED faci pampallugues Que el LED faci pampallugues quan arribi un correu - Configuració del servidor Opcions de composició del missatge @@ -752,7 +754,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Tria compte/identitat Envia com - Vés a la configuració del compte -> Gestiona identitats per crear identitats No pots esborrar una identitat si només en tens una No pots utilitzar una identitat sense una adreça de correu @@ -794,8 +795,11 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An a la teva adreça i contrasenya correctes, pots no haver pagat el compte \"Plus\". Si us plau, executeu el navegador d’Internet per obtenir accés a aquests comptes de correu. - Si vols utilitzar POP3 per aquest proveïdor, hauries de permetre d’utilitzar POP3 a la pàgina de configuració del correu de Yahoo. + + + + Certificat no reconegut Accepta la clau @@ -824,8 +828,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Mostra carpetes de 1a i 2a Classe Mostra-ho tot excepte carpetes de 2a Classe - - Posició de la signatura Abans del text citat Després del text citat @@ -848,8 +850,6 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Controls zoom sistema Habilita ginys de zoom or pica sobre el zoom si el teu aparell ho permet - - Per defecte del sistema Sincronització 2n pla @@ -1055,4 +1055,8 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Desa adjunts a... Desa adjunt No s\'ha trobat l\'arxiu al navegador. On vols desar l\'adjunt? + + + + diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 4f517ce88..94781ad96 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -88,8 +88,6 @@ Odstranit účet Vynulovat nevyřízené akce (nebezpečné!) - - Účty @@ -115,6 +113,9 @@ Zobrazit/skrýt podrobnosti Přidat kopii/skrytou Upravit předmět + + + Přidat přílohu Přidat přílohu (obrázek) Přidat přílohu (video) @@ -274,8 +275,7 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Některé přílohy nebyly staženy. Budou staženy automaticky, než bude tato zpráva odeslána. Některé přílohy nelze přeposlat, protože ještě nebyly staženy. - - + Odesílatel: %s <%s> Komu: @@ -295,7 +295,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Stahuji přílohu. Nelze nalézt prohlížeč pro %s. - Stáhnout úplnou zprávu @@ -322,7 +321,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro O aplikaci%s Verze: %s - Zprávy s \u2605 Hvězdička indikuje označenou zprávu Výběrová zaškrtávací pole @@ -342,6 +340,8 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Použít písmo s pevnou šířkou při zobrazování textových zpráv Návrat do seznamu po smazání Vrátit se do seznamu zpráv po smazání zprávy + + Potvrzování akcí Zobrazit dialog, když provádíte zvolené akce @@ -354,13 +354,11 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Oznámení při zamčené obrazovce Nezobrazovat v oznámení předmět zpráv, když je systém zamčen - Doba klidu Zakázat v noci zvonění, vibrace a blikání Doba klidu začíná Doba klidu končí - Založit nový účet Zadejte emailovou adresu tohoto účtu: (Můžete ještě přidat %d účtů.) @@ -524,7 +522,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro 1000 zpráv všechny zprávy - Nelze kopírovat nebo přesunovat zprávu, která není synchronizována se serverem Konfiguraci nastavení nelze dokončit @@ -568,6 +565,9 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Odesílání zpráv + + + Odpovědět za citovaným textem Při odpovídání na zprávu se původní zpráva objeví ned vaší odpovědí. @@ -575,6 +575,9 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro + + + @@ -598,7 +601,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Úložiště - Barva účtu Vyberte barvu účtu používanou v seznamech složek a zpráv @@ -620,6 +622,8 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro 512 KiB 1 MiB 2 MiB + 5 MiB + 10 MiB jakékoli velikosti (bez omezení) Synchronizovat odeslané zprávy @@ -636,7 +640,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro za posledních 6 měsíců za poslední rok - Zobrazované složky Všechny Jen složky 1. třídy @@ -711,7 +714,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Blikání LED Blikat LED, když přijde pošta - Nastavení serveru Možnosti tvorby nových zpráv @@ -759,7 +761,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Vyberte účet/identitu Odeslat jako - Vytvořte identity v Nastavení účtu -> Správa identit Nemůžete odebrat vaši jedinou zbývající identitu Nemůžete použít identitu bez emailové adresy @@ -801,8 +802,11 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro s vaší správnou emailovou adresou a heslem, nemusíte mít placený \"Plus\" účet. Spusťte si prosím webový prohlížeč, kterým na takové účty získáte přístup. - Pokud chcete používat POP3 s tímto poskytovatelem, měli byste povolit použití POP3 na stránce Nastavení pošty Yahoo. + + + + Neznámý certifikát Přijmout klíč @@ -831,8 +835,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Zobrazit složky 1. a 2. třídy Zobrazit všechny vyjma složek 2. třídy - - Umístění podpisu Před citovanými zprávami Za citovanými zprávami @@ -855,8 +857,6 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Systémové ovládání zvětšování Povolit zvětšovací doplňky nebo zvětšování štípnutím, pokud to zařízení podporuje - - Systémový výchozí Synchronizace na pozadí @@ -1061,4 +1061,8 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro + + + + diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index b5d51b605..942ccea78 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -83,8 +83,6 @@ Konto entfernen Ausstehende Aktionen abbrechen (Warnung!) - - Konten @@ -109,6 +107,9 @@ Details anzeigen/verbergen CC/BCC hinzufügen Betreff bearbeiten + Empfangsbestätigung + Eine Empfangsbestätigung wird angefordert. + Es wird keine Empfangsbestätigung angefordert. Anhang hinzufügen Anhang hinzufügen (Bild) Anhang hinzufügen (Video) @@ -265,8 +266,7 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Es wurde keine E-Mail-Adresse für diesen Kontakt gefunden. Einige Anhänge wurden nicht heruntergeladen. Sie werden automatisch heruntergeladen, bevor diese Nachricht gesendet wird. Einige Anhänge können nicht weitergeleitet werden, da diese nicht heruntergeladen wurden. - - + Original-Nachricht zitieren Von: %s <%s> An: @@ -275,7 +275,7 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Speichern \u25BC \u25B2 - Sichern + Archivieren Verschieben Spam dd. MMM yyyy HH:mm @@ -286,7 +286,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Lade Anhang. Es wurde kein Anzeigeprogramm für %s gefunden. - Gesamte Nachricht herunterladen @@ -313,7 +312,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Über %s Version: %s - Wichtige Nachrichten Sterne weisen auf wichtige Nachrichten hin. Mehrfachauswahl @@ -333,6 +331,8 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Verwende Schriftart mit gleicher Zeichenbreite für Plain-Text Nachrichten Nach Löschen zurück Nach Löschen zur Nachrichtenliste zurückkehren + Nach Löschen nächste Nachricht + Nach Löschen standardmäßig die nächste Nachricht anzeigen Bestätigungsdialog Verlange Bestätigung bei gewissen Aktionen @@ -345,13 +345,11 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Vertrauliche Benachrichtigung Der Betreff der Nachricht wird nicht in der Benachrichtigungszeile angezeigt - Ruhezeit Deaktivere Klingeln, Vibrieren und Leuchten in der Nacht Ruhezeit startet Ruhezeit endet - E-Mail-Konto einrichten E-Mail-Adresse Ihres Kontos: (Sie können %d weitere Konten hinzufügen.) @@ -515,7 +513,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü 1000 Nachrichten alle Nachrichten - Nachrichten, die nicht mit dem Server synchronisiert wurden, können nicht kopiert oder verschoben werden. Setup konnte nicht abgeschlossen werden @@ -549,7 +546,7 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Immer Spam-Leiste - Zeige Sichern-, Verschieben- und Spam-Schaltfläche. + Zeige Archivieren-, Verschieben- und Spam-Schaltfläche. Scrolle Spam-Leiste Bilder automatisch anzeigen @@ -559,13 +556,19 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Nachricht verfassen + Nachricht beim Antworten zitieren + Beim Antworten die Original-Nachricht als Zitat einfügen. + Antwort unter Zitat - Die Antwort auf eine Nachricht unterhalb der Originalnachricht platzieren. + Die Antwort auf eine Nachricht unterhalb der Original-Nachricht platzieren. Formatierung Einfacher Text (Bilder und Formatierungen werden entfernt) HTML (Bilder und Formatierungen bleiben erhalten) + Empfangsbestätigung + Immer eine Empfangsbestätigung anfordern + Antwortkopf Normal (wie in Gmail, Pine) Erweitert (wie in Outlook, Yahoo!, Hotmail) @@ -589,7 +592,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Speicher - Farbe des Kontos Wählen Sie die Farbe, in der das Konto in der Konten- und Ordnerliste dargestellt wird @@ -611,6 +613,8 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü 512Kb 1Mb 2Mb + 5Mb + 10Mb jede Größe (kein Limit) Nachrichten synchronisieren @@ -627,7 +631,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü der letzten 6 Monate des letzten Jahres - Ordner anzeigen Alle Nur Hauptordner @@ -702,7 +705,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü LED Blinken LED blinkt bei neuer Nachricht - Servereinstellungen Optionen für das Verfassen von Nachrichten @@ -750,7 +752,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Konto/Identität auswählen Sende als - Gehen Sie zu \"Kontoeinstellungen\" -> \"Identitäten verwalten\" um Identitäten zu erstellen Sie können Ihre einzige Identität nicht löschen Sie können keine Identität ohne E-Mail-Adresse verwenden @@ -792,8 +793,11 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü der richtigen E-Mail-Adresse und dem richtigen Kennwort anmelden können, haben Sie möglicherweise die Gebühren für das \"Plus\"-Konto nicht bezahlt. Starten Sie den Webbrowser, um auf diese Mailkonten zuzugreifen. - - Wenn Sie für diesen Provider POP3 verwenden möchten, sollten Sie in den "Yahoo! Mail"-Enstellungen POP3 aktivieren. + Wenn Sie für diesen Provider POP3 verwenden möchten, sollten Sie in den "Yahoo! Mail"-Einstellungen POP3 aktivieren. + Wenn Sie für diesen Provider IMAP oder POP3 verwenden möchten, sollten Sie dies auf der "Naver Mail"-Einstellungsseite aktivieren. + Wenn Sie für diesen Provider IMAP oder POP3 verwenden möchten, sollten Sie dies auf der "Hanmail(Daum)"-Einstellungsseite aktivieren. + Wenn Sie für diesen Provider IMAP oder POP3 verwenden möchten, sollten Sie dies auf der "Paran"-Einstellungsseite aktivieren. + Wenn Sie für diesen Provider IMAP oder POP3 verwenden möchten, sollten Sie dies auf der "Nate Mail"-Einstellungsseite aktivieren. Ungültiges Zertifikat Zertifikat akzeptieren @@ -821,8 +825,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Haupt- und Nebenordner anzeigen Alle außer Nebenordner anzeigen - - Position der Signatur Vor zitierter Nachricht Nach zitierter Nachricht @@ -845,8 +847,6 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü System Zoom Aktiviere Zoom-Widgets oder 2-Finger-Zoom, wenn vom Gerät unterstützt - - Systemvorgabe Hintergrund-Synchronisierung @@ -873,7 +873,7 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Gewählte als ungelesen markieren Gewählte als wichtig markieren Markierung bei Gewählten entfernen - Gewählte sichern + Gewählte archivieren Gewählte als Spam markieren Gewählte verschieben Gewählte kopieren @@ -908,8 +908,8 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü \"Zurück\"-Taste Die \"Zurück\"-Taste bringt Sie eine Ebene nach oben - Integrierter Posteingang bei Start - Zeige beim Startup den integrierten Posteingang + Gemeinsamer Posteingang bei Start + Zeige gemeinsamen Posteingang beim Programmstart Konto-Größe anzeigen Deaktivieren für schnellere Anzeige @@ -917,8 +917,8 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Suchergebnisse zählen Deaktivieren für schnellere Anzeige - - + Spezial-Konten verbergen + "Gemeinsamer Posteingang" und "Alle Nachrichten" verbergen %s %s - Wichtig @@ -1011,7 +1011,7 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Entwurf speichern? Entwurf speichern oder verwerfen? - Die Nachricht konnte nicht dargestellt werden da das Charset \"%s\" nicht gefunden wurde. + Die Nachricht konnte nicht dargestellt werden, da das Charset \"%s\" nicht gefunden wurde. Selektieren Sie Text um ihn zu kopieren. @@ -1041,4 +1041,8 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Anhang speichern unter... Anhang speichern Es wurde kein Dateimanager gefunden. Wo soll der Anhang abgelegt werden? + + Nach oben verschieben + Nach unten verschieben + diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index f0f47667c..995b7aca1 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -83,8 +83,6 @@ Eliminar cuenta Limipar acciones pendientes (peligroso!) - - Cuentas @@ -109,6 +107,9 @@ Ver/Ocultar detalles Añadir Cc/Bcc Editar Asunto + + + Añadir adjunto Añadir adjunto (Imagen) Añadir adjunto (Vídeo) @@ -266,8 +267,7 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Algunos adjuntos no se han descargado. Serán descargados automáticamente antes de que se envíe el mensaje Algunos adjuntos no pueden reenviarse porque no han sido descargados. - - + Desde: %s <%s> Para: @@ -287,7 +287,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Obteniendo adjuntos. Imposible encontrar visualizador para %s. - Descargar mensaje completo @@ -314,7 +313,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Sobre %s Versión: %s - Ver estrellas Las estrellas indican un mensaje destacado Selección múltiple @@ -334,6 +332,8 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Utilizar tamaño fijo de fuente cuando se muestre mensajes en texto plano Volver a la lista después de borrar Volver a la lista después de la acción de borrado + + Confirmar acción Mostrar un diálogo cuando se realice una de estas acciones @@ -346,13 +346,11 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Bloquear notificaciones No mostrar asunto del mensaje en la barra de notificaciones cuando el sistema está bloqueado. - Tiempo de Silencio Desactivar sonidos, alertas y luces por la noche Silencio comienza Silencio termina - Configurar nueva cuenta Introduzca dirección de correo (Debe Añadir %d más cuentas.) @@ -516,7 +514,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa 1000 mensajes Todos los mensajes - No se puede copiar/mover un mensaje que no ha sido sincronizado con el servidor No se ha podido finalizar la Configuración @@ -560,6 +557,9 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Configuración Saliente + + + Respuesta tras cita Cuando se responda a un correo, el texto original estará por encima de su respuesta @@ -567,6 +567,9 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Texto plano (se quitan las imágenes y el formato) HTML (se mantienen las imágenes y el formato) + + + Estilo de cita al responder Prefijo (como Gmail, Pine) Cabecera (como Outlook, Yahoo!, Hotmail) @@ -590,7 +593,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Almacenamiento - Color de la cuenta Seleccione el color a utilizar en la carpeta y en la cuenta @@ -612,6 +614,8 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa 512Kb 1Mb 2Mb + 5Mb + 10Mb cualquier tamaño (sin límite) Sincronizar desde @@ -628,7 +632,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa los últimos 6 meses el último año - Carpetas a mostrar Todas Sólo 1a clase @@ -703,7 +706,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Parpadeo LED Parpadear el LED cuando llega nuevo correo - Configurar Servidor Opciones de edición de mensaje @@ -751,7 +753,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Seleccionar cuenta/identidad Enviar como - Ir a Configuración cuentas -> y a identidad para crear una nueva identidad No puedes eliminar tu única identidad No puedes utilizar una identidad sin dirección de correo @@ -791,8 +792,11 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Sólo algunas cuentas \"Plus\" pueden utilizar acceso POP Si no puede acceder con su contraseña y usuario y no tiene una cuenta de pago. Es posible que pueda acceder sólo via web. - Si quiere utilizar el correo POP3 para este proveedor debe activar este acceso en la Configuración de yahoo. + + + + Certificado desconocido Aceptar certificado @@ -821,8 +825,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Ver carpetas de 1a y 2a Clase Ver todas excepto las de 2a Clase - - Posición de la Frima Antes del texto citado Después del texto citado @@ -845,8 +847,6 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Controles del Zoom por sistema Permitir opciones de zoom que soporta el propio dispositivo - - Configurado en el sistema Sincronizar en segundo plano @@ -1051,4 +1051,8 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa + + + + diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index 3528256d7..4496c4658 100644 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -83,8 +83,6 @@ Poista tili Tyhjennä odottavat toimenpiteet (vaara!) - - Tilit @@ -110,6 +108,9 @@ Näytä/piilota lisätiedot Lisää Kopio/Piilokopio Muokkaa aihetta + + + Lisää liite Lisää liite (kuva) Lisää liite (video) @@ -264,8 +265,7 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Kaikkia liitteitä ei ladattu. Ne ladataan automaattisest ennen tämän viestin lähettämistä. Joitakin liitteitä ei voida jatkolähettää, koska niitä ei ole ladattu. - - + Lähettäjä: %s <%s> Vast.ottaja: @@ -285,7 +285,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Haetaan liitettä. Ei löydy katseluohjelmaa tyypille %s. - Lataa koko viesti @@ -312,7 +311,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Tietoja %s Versio: %s - Viestin tähdet Tähdet ilmaisevat merkityt viestit Usean valinnan valintaruudut @@ -332,6 +330,8 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Käytä kiinteää kirjasinleveyttä muotoilemattomille viesteille Palaa poiston jälkeen listanäkymään Palaa viestilistaan viestin poiston jälkeen + + Vahvista toimenpiteet Näytä keskusteluikkuna valitun toimenpiteen suorituksesta @@ -344,13 +344,11 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Lukitusnäytön ilmoitukset Älä näytä viestin aihetta ilmoituspalkissa jos laite on lukittuna - Hiljainen aika Poista käytöstä soittoäänen pirinä, pärinä ja vilkkuminen yöllä Hiljainen aika alkaa Hiljainen aika päättyy - Lisää uusi tili Anna tilin sähköpostiosoite: (Voit lisätä vielä %d tiliä.) @@ -512,7 +510,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak 1000 viestiä Kaikki viestit - Viestiä ei voi kopioida tai siirtää koska se ei ole synkronoitu palvelimelle Asennus ei onnistunut @@ -556,6 +553,9 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Lähetetään postia + + + Vastaa lainauksen jälkeen Kun viestiin vastataan, alkuperäinen viesti on vastauksesi yläpuolella. @@ -563,6 +563,9 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Pelkkä teksti (kuvat ja muotoilu on poistettu) HTML (kuvat ja muotoilu säilytetään) + + + Vastaa lainaamalla tyyli Etuliite (kuten Gmail, Pine) Otsikko (kuten Outlook, Yahoo!, Hotmail) @@ -586,7 +589,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Tallennus - Tilin väri Valitse väri tilin kansio- ja tililistaukseen @@ -608,6 +610,8 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak 512 kt 1 Mt 2 Mt + 5 Mt + 10 Mt mikä tahansa (ei rajoitusta) Synkronoi viestit @@ -624,7 +628,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak viimeiset 6 kuukautta viime vuonna - Näytä kansiot Kaikki Vain 1. luokan kansiot @@ -699,7 +702,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Merkkivalo vilkkuu Viestin saapuessa merkkivalo vilkkuu - Palvelimen asetukset Viestin kirjoituksen asetukset @@ -747,7 +749,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Valitse tili/identiteetti Lähetä - Mene tilin asetuksiin -> Hallitse identiteettejä luodaksesi identiteetin Et voi poistaa ainoaa identiteettiäsi Identiteettiä ei voi käyttää ilman sähköpostiosoitetta @@ -788,8 +789,11 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak       joka sallii tämän ohjelman ottaa yhteyden. Jos et voi kirjautua       oikealla sähköpostiosoitteella ja salasanalla, sinulla ei voi olla maksullista       \"Plus\"-tiliä. Ole hyvä ja käytä www-selainta käyttääksesi niihin sähköpostitileihin. - Jos haluat käyttää tämän palveluntarjoajan POP3:a, sinun tulee sallia käyttää POP3 Yahoon sähköpostin asetukset-sivulla. + + + + Tunnistamaton sertifikaatti Hyväksy-avain @@ -818,8 +822,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Näytä 1. ja 2. luokan kansiot Näytä kaikki paitsi 2. luokan kansiot - - Allekirjoituksen sijainti Ennen lainattua viestiä Lainatun viestin jälkeen @@ -842,8 +844,6 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Järjestelmän zoomin ohjaus Ota widgetin zoomaus tai nipistys-zoomaus, jos laite tukee - - Järjestelmän oletus Synkronointi taustalla @@ -1048,4 +1048,8 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak + + + + diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 82da970d7..b8f9b74dc 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -83,8 +83,6 @@ Eliminar conta Limpar accións pendentes (perigroso!) - - Contas @@ -109,6 +107,9 @@ Ver/Ocultar detalles Engadir Cc/Bcc Editar Asunto + + + Engadir adxunto Engadir adxunto (Imaxe) Engadir adxunto (Vídeo) @@ -266,8 +267,7 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Non atopo enderezo electrónico. Algúns adxuntos non se descargaron. Serán descargados automáticamente antes de que mandar a mensaxe Algúns adxuntos non poden reenviarse porque non foron descargados. - - + Dende: %s <%s> Para: @@ -287,7 +287,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Obtendo adxuntos. Imposible atopar visor para %s. - Descargar mensaxe completa @@ -314,7 +313,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Sobre %s Versión: %s - Ver estrelas As estrelas indican unha mensaxe destacada Selección múltiple @@ -334,6 +332,8 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Usar tamaño fixo de fonte nas mensaxes en texto plano Voltar á lista despois de borrar Voltar á lista despois da acción de borrado + + Confirmar acción Amosar un diálogo cuando se realice una de estas acciones @@ -346,13 +346,11 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Bloquear notificacións Non amosar asunto da mensaxe na barra de notificacións cando o sistema está bloqueado. - Tempo de Silencio Desactivar sons, alertas e luces pola noite Silencio empeza Silencio remata - Configurar nova conta Introduzca enderezo de correo (Debe Engadir %d máis contas.) @@ -516,7 +514,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An 1000 mensaxes Todas as mensaxes - Non se pode copiar/mover unha mensaxe que non foi sincronizada co servidor No se puido rematar a Configuración @@ -560,6 +557,9 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Configuración Saínte + + + Resposta tras cita Cando se responda a un correo, o texto orixinal estará por riba da sua resposta @@ -567,6 +567,9 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Texto plano (borraránse imaxes e formato) HTML (mantéñense imaxes e formato) + + + Responder estilo comentario Prefixo (coma Gmail, Pine) Cabeceira (coma Outlook, Yahoo!, Hotmail) @@ -590,7 +593,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Almacenamento - Cor da conta Elixe a cor a usar na carpeta e na conta @@ -612,6 +614,8 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An 512Kb 1Mb 2Mb + 5Mb + 10Mb calquera tamaño (sen límite) Sincronizar dende @@ -628,7 +632,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An os últimos 6 meses o último ano - Carpetas a amosar Todas Só 1a clase @@ -703,7 +706,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Pestanexo LED Pestanexar o LED cando chega novo correo - Configurar Servidor Opcións de edición de mensaxe @@ -751,7 +753,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Seleccionar conta/identidade Enviar como - Ir a Configuración contas -> e a identidade para crear unha nova identidade Non podes eliminar a túa única identidade Non podes usar unha identidade sen enderezo de correo @@ -791,8 +792,11 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Só algunhas contas \"Plus\" poden usar acceso POP Se non podes acceder coa tua contrasinal e usuario e non tes unha conta de pago. É posible que podas acceder só vía web. - Se queres usar o correo POP3 para este proveedor debes activar este acceso na Configuración de Yahoo. + + + + Certificado descoñecido Aceptar certificado @@ -821,8 +825,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Ver carpetas de 1a e 2a Clase Ver todas agás as de 2a Clase - - Posición da sinatura Antes do texto citado Despois do texto citado @@ -845,8 +847,6 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Controles do Zoom por sistema Permitir opcións de zoom que soporta o propio dispositivo - - Configurado no sistema Sincronizar en segundo plano @@ -1052,4 +1052,8 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An + + + + diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index b9c5918b0..d75288455 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -83,8 +83,6 @@ Rimuovi account Annulla tutte le azioni in corso (pericolo!) - - Account @@ -271,8 +269,7 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Alcuni allegati non sono stati scaricati. Verranno scaricati automaticamente prima che questo messaggio venga inviato. Alcuni allegati non possono essere inoltrati in quanto non sono stati scaricati. - - + Da: %s <%s> A: @@ -292,7 +289,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Recupero allegato in corso. Impossibile trovare un visualizzatore per %s. - Scarica intero messaggio @@ -319,7 +315,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Informazioni su %s Versione: %s - Mostra stelle Le stelle indicano i messaggi evidenziati Caselle di selezione multipla @@ -339,6 +334,8 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Usa font a larghezza fissa quando mostri i messaggi di testo Torna all\'elenco dopo l\'eliminazione Ritorna all\'elenco dei messaggi dopo l\'eliminazione del messaggio + + Conferma azioni Mostra una finestra di dialogo ogni volta che si eseguono le azioni selezionate @@ -351,13 +348,11 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Notifiche con blocco dello schermo Non visualizzare l\'oggetto del messaggio nella barra di notifica quando il sistema è bloccato - Silenzioso a tempo Disabilita chiamata, vibrazione e lampeggi di notte Attiva alle Disattiva alle - Configura un nuovo account Inserisci l\'indirizzo e-mail di questo account: (Puoi aggiungere altri %d account) @@ -521,7 +516,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope 1000 messaggi tutti i messaggi - Non è possibile copiare o spostare un messaggio che non sia sincronizzato con il server Impossibile completare la configurazione @@ -565,6 +559,9 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Composizione messaggio + + + Risposta dopo testo quotato Quando si risponde ai messaggi, il messaggio originale viene visualizzato sopra la tua risposta. @@ -598,7 +595,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Memorizzazione - Colore dell\'account Scegli il colore dell\'account utilizzato nell\'elenco delle cartelle e degli account @@ -620,6 +616,8 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope 512KB 1MB 2MB + 5MB + 10MB qualsiasi dimensione (nessun limite) Sincronizza messaggi da @@ -636,7 +634,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope gli ultimi 6 mesi l\'ultimo anno - Visualizza cartelle Tutte Soltanto cartelle di 1a Classe @@ -711,7 +708,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope LED lampeggiante LED lampeggiante quando arriva un messaggio - Impostazioni del server Opzioni composizione messaggi @@ -759,7 +755,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Scegli account/identità Invia come - Vai a Impostazioni account -> Gestione identità per creare identità Non è possibile rimuovere la propria unica identità Non è possibile utilizzare una identità senza un indirizzo e-mail @@ -801,8 +796,11 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope indirizzo email e password corretti, è possibile che non sia stato pagato un account \"Plus\". Esegui il browser Internet per acquistare l\'accesso a questo genere di account e-mail. - Se si desidera utilizzare POP3 per questo provider, si deve consentire l\'utilizzo di POP3 sulla pagina delle impostazioni di Yahoo. + + + + Certificato non riconosciuto Accetta chiave @@ -831,8 +829,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Visualizza cartelle di 1a e 2a Classe Visualizza tutte eccetto le cartelle di 2a Classe - - Posizione della firma Prima del testo quotato Dopo il testo quotato @@ -855,8 +851,6 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Zoom di sistema Abilita widgets dello zoom o pinch-zoom se il dispositivo lo supporta - - Impostazioni predefinite di sistema Sincronizzazione in background @@ -1061,4 +1055,8 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope + + + + diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 401b83e74..494e9f839 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -83,8 +83,6 @@ アカウント削除 保留中のアクションをクリア (危険!) - - アカウント一覧 \u25c0 \u25c0 @@ -272,8 +270,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール ダウンロードしていないため、一部の添付ファイルを転送することはできません。 元のメッセージを引用する - - 送信者: %s <%s> 宛先: Cc: @@ -318,7 +314,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール %s について バージョン: %s - スターを表示 スターは印の付いたメッセージを示す 複数選択チェックボックス @@ -336,8 +331,10 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール 固定幅フォント プレーンテキストメッセージの表示に固定幅フォントを利用 - 削除後メッセージ一覧へ戻る + 削除後メッセージ一覧に戻る メッセージの削除後、メッセージ一覧に戻る + 削除後次のメッセージを表示 + メッセージの削除後、次のメッセージを表示する 確認 選択した動作を実行するときに常にダイアログを表示する @@ -350,13 +347,11 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール スクリーンロック時の通知 システムがロックされているときは通知バーにメッセージの表題を表示しない - 夜間時間帯 夜間での各種通知や表示を抑制する時間帯を設定 開始時刻 終了時刻 - 電子メールセットアップ このアカウントで使用するメールアドレスを入力して下さい (追加する場合は %d と異なるメールアドレスを入力して下さい) @@ -599,7 +594,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール ストレージ - アカウントの色 アカウント一覧とフォルダで使用する色を選択 @@ -639,7 +633,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール 6ヶ月前 1年前 - 表示するフォルダ すべて 1st クラスフォルダのみ @@ -714,7 +707,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール LEDを点滅 メール着信時にLEDを点滅 - サーバ設定 メール本文構成管理 @@ -762,7 +754,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール アカウント選択 他のアカウントで送信 - アカウント設定 -> 差出人情報管理 で差出人情報を作成してください 最後の差出人情報は削除できません メールアドレスの無い差出人情報は選択できません @@ -829,8 +820,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール 1st と 2nd クラスフォルダ表示 2nd クラスフォルダを除くすべて表示 - - 署名挿入場所 引用テキストの前に挿入 引用テキストの後に挿入 @@ -853,8 +842,6 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール ズーム制御 デバイスが対応するならば、ズームウィジェットやピンチズームを有効にする - - システム設定 バックグラウンド同期 @@ -1055,4 +1042,8 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール 添付ファイルの保存先 添付ファイルの保存先 ファイルブラウザがインストールされていません。添付ファイルの保存場所を直接入力してください。 + + 上に移動 + 下に移動 + diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 7f4b5ac94..25a65169a 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -2,25 +2,28 @@ K-9 메일 K-9 메일 베타 + Google, The K-9 Dog Walkers. + Copyright 2008-%s The K-9 Dog Walkers. Portions Copyright 2006-%s the Android Open Source Project. + Licensed under the Apache License, Version 2.0. Authors: %s 릴리즈 정보: %s K-9 메일은 아래의 서드파티 라이브러리를 이용합니다 : %s Emoji 아이콘: %s - + 첨부 읽기 K-9이 이메일의 첨부를 읽도록 합니다 이메일 읽기 K-9이 이메일을 읽도록 합니다. 이메일 삭제 K-9이 이메일을 삭제하도록 합니다 - - %s + + %s 계정 고급 %s K-9 계정 - - %s:%s + + %s:%s 작성 디버그 @@ -79,7 +82,7 @@ 환경 설정 계정 삭제 예정된 작업 삭제(위험!) - + 계정 @@ -89,7 +92,8 @@ 발신자 선택 모든 편지를 읽음으로 표시 - \'%s\' 폴더의 모든 메시지를 읽음으로 표시하시겠습니까? (K-9에서 보여지지 않은 폴더의 메시지포함) + \'%s\' 폴더의 모든 메시지를 읽은 메시지로 표시하시겠습니까? + (K-9에서 보여지지 않은 폴더의 메시지포함) 즐겨찾기 등록 즐겨찾기 해제 @@ -104,6 +108,9 @@ 세부내용 보기/숨기기 참조/숨은참조 추가 제목 수정 + + + 첨부 추가 첨부 추가 (이미지) 첨부 추가 (비디오) @@ -163,14 +170,14 @@ 메일 전송중 : - 받은 메일함 - 보낸 메일함 + 받은편지함 + 보낸편지함 - 임시 메일함 + 임시보관함 휴지통 - 보낸 메일함 + 보낸편지함 보관 - 스팸메일함 + 스팸편지함 %s (임시보관함) @@ -182,12 +189,12 @@ 일부 메시지를 보내는데 실패하였습니다 %s 폴더 자세히 보기 K-9에서 메시지를 보내는데 문제가 발생하였습니다. - 하지만 문제의 특성상 K-9은 메시지가 확실히 보내졌는지 여부를 확인할 수 없습니다. - 수신자는 이미 메시지를 받았을 수도 있습니다. + 하지만 문제의 특성상 K-9은 메시지가 확실히 보내졌는지 여부를 확인할 수 없습니다. + 수신자는 이미 메시지를 받았을 수도 있습니다. \u000a\u000a발생된 문제 유형의 메시지는 보낸편지함에 즐겨찾기(stared) 표시가 되어있습니다. 이 즐겨찾기(stared)를 없애면 K-9은 메시지를 재전송을 시도할것입니다. - 다른 발신 작업을 하기위해서는 보낸편지함을 길게 눌러 메시지 보내기를 찾으십시오.\u000A\u000a - %s 폴더에 실패에 대한 에러메시지가 있습니다. + 다른 발신 작업을 하기위해서는 보낸편지함을 길게 눌러 메시지 보내기를 찾으십시오.\u000A\u000a + %s 폴더에 실패에 대한 에러메시지가 있습니다. K-9 알람 네트워크 문제로 동기화, 메일보내기가 지연되고있습니다. @@ -206,14 +213,14 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 \n * 폴더 구독 \n * 모든 폴더 동기화 \n * 회신주소 수정 -\n * 키보드 단축 +\n * 키보드 단축키 \n * 향상된 IMAP 지원 \n * SD 카드에 첨부파일 저장 \n * 휴지통 비우기 \n * 메시지 정렬 \n * ...그리고 그 밖에 \n -\nK-9 메일은 다른 메일 클라이언트와 마찬가지로 대부분의 무료 hotmail 계정을 Microsoft Exchange와 연결할때 발생되는 문제로 인해 지원하지 않습니다. +\nK-9 메일은 다른 메일 클라이언트와 마찬가지로 대부분의 무료 hotmail 계정을 Microsoft Exchange와 연결할때 발생되는 문제로 인해 지원하지 않습니다. \n \n 버그 리포트, 새로운 기능 그리고 질문에 대한 문의는 http://k9mail.googlecode.com/ 로 남겨주시기바랍니다. @@ -229,7 +236,7 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 모든 메일 모든 계정의 모든 메시지 - 받은 편지함의 모든 메일 + 받은편지함의 모든 메일 %s:%s %s @@ -261,8 +268,7 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 이메일 주소를 찾을 수 없습니다. 일부 첨부파일을 다운로드 할 수 없습니다. 이 메시지가 보내지기 이전에 자동적으로 다운로드 됩니다. 다운로드 완료되지않은 일부 첨부파일을 보낼수 없습니다. - - + 발신자: %s <%s> 수신자: @@ -282,7 +288,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 첨부파일 가져오는 중. %s에 대한 뷰어를 찾을 수 없습니다. - 다운로드 완료 메시지 @@ -309,7 +314,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 About %s 버전: %s - 즐겨찾기 보기 체크된 메시지 즐겨찾기등록 체크박스 여러게 선택하기 @@ -329,6 +333,8 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 일반텍스트(Plain) 메시지를 보여줄때 고정 넓이 폰트사용 삭제후 목록으로 메시지 삭제후에 메시지 목록으로 되돌아갑니다. + 삭제 후 다음 메시지 보기 + 메시지 삭제 후 다음 메시지를 보도록 기본값으로 설정합니다 동작시 행동 설정한 행동을 할 경우 확인창을 보여줍니다. @@ -341,13 +347,11 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 잠긴화면에서 알림 화면이 잠겨있을경우 메시지 수신시 제목을 화면에 보여주지 않습니다. - 무음 시간 벨소리, 부져, 플래쉬를 밤시간에 사용하지않습니다 무음 시작 시간 무음 끝나는 시간 - 계정 추가 이메일 계정을 입력하시오: (%d개의 계정을 추가하였습니다.) @@ -511,7 +515,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 1000 메시지 모든 메시지 - 서버와 동기화 되지않은 메시지를 복사하거나 이동할 수 없습니다. 설정이 완료되지 않았습니다 @@ -555,6 +558,9 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 메일 보내기 + + + Reply after quoted text 메시지 회신시 원본 메시지를 회신메시지에 포함시킵니다. @@ -562,6 +568,9 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 일반 텍스트(Plain) (이미지와 꾸밈format은 없어집니다) HTML (이미지와 꾸밈format이 보존됩니다) + + + 회신시 인용문 위치 Prefix (Gmail, Pine 처럼) Header (Outlook, Yahoo!, Hotmail 처럼) @@ -585,7 +594,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 저장장치 - 계정 색깔 계정 목록과 폴더내에서 사용될 계정 색깔을 선택하시오. @@ -607,6 +615,8 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 512Kb 1Mb 2Mb + 5Mb + 10Mb any size (제한없음) 메시지 동기화 기간 @@ -623,7 +633,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 최근 6달 최근 1년 - 보여질 폴더 모든 폴더 Only 1st Class folders @@ -698,7 +707,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 LED 깜빡임 메일 도착시 LED를 깜빡입니다. - 서버 설정 메시지 작성 옵션 @@ -746,7 +754,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 계정을 선택하시오 다른 계정으로 보내기 - 신원 설정 가기 -> 새로운 신원(Identity) 생성을 위한 신원(Identity) 관리 신원(Identity)를 제거할 수 없습니다. 이메일 주소없이 신원(Identity)을 사용할 수 없습니다 @@ -783,17 +790,15 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 계정 비우기 \"%s\"의 모든 메일이 K-9에서 삭제될것입니다. 하지만 계정 설정은 보존됩니다. - \"Plus\" 계정만이 이 프로그램을 POP 접근 하도록 허락합니다. - 올바른 이메일 주소와 비밀번호로 로그인 실패할 경우 \"Plus\" 계정을 위해 유료전환 해야 할 것입니다. - 웹브라우저를 통해 접근을 얻도록 하십시오 - + \"Plus\" 계정만이 이 프로그램을 POP 접근 하도록 허락합니다. + 올바른 이메일 주소와 비밀번호로 로그인 실패할 경우 \"Plus\" 계정을 위해 유료전환 해야 할 것입니다. + 웹브라우저를 통해 접근을 얻도록 하십시오 POP3를 이용하기위해서는 야휴 메일 설정페이지에서 POP3 이용을 설정하여야합니다. - IMAP/POP3를 이용하기위해서는 네이버 메일 설정페이지에서 IMAP/POP3 이용을 설정하여야합니다. IMAP/POP3을 이용하기위해서는 한메일 환경설정 페이지에서 IMAP/POP3 이용을 설정하여야합니다. IMAP/POP3을 이용하기위해서는 파란 메일 환경설정 페이지에서 IMAP/POP3 이용을 설정하여야합니다. IMAP/POP3을 이용하기위해서는 네이트 메일 환경설정 페이지에서 IMAP/POP3 이용을 설정하여야합니다. - + 잘못된 인증정보 Accept Key Reject Key @@ -821,8 +826,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 Display 1st and 2nd Class folders Display all except 2nd Class folders - - 서명 위치 본문 앞에 본문 뒤에 @@ -845,8 +848,6 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 시스템 줌 컨트롤 Enable zoom widgets or pinch-zoom if your device supports it - - 시스템 기본값 벡그라운드 동기화 @@ -908,8 +909,8 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 \"뒤로\" 버튼 관리 \"뒤로\" 버튼이 항상 위로 - 통합 메일함으로 시작 - 통합 메일함을 시작시 보여줍니다 + 통합 편지함으로 시작 + 통합 편지함을 시작시 보여줍니다 계정 용량을 보여줍니다 빠른 처리를 위해 비활성화 @@ -918,7 +919,7 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 빠른 처리를 위해 비활성화 특정 계정 숨기기 - 통합 이메일함과 모든 편지함 숨기기 + 통합 편지함과 모든 편지함 숨기기 %s %s - 즐겨찾기 메일수 @@ -927,13 +928,13 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 모든 편지 검색가능한 모든 편지 - 통합 이메일함 + 통합 편지함 통합된 폴더의 모든 이메일 Tap envelope or star for unread or starred messages 통합 - 모든 메시지는 통합 이메일함에 보여집니다 + 모든 메시지는 통합 편지함에 보여집니다 찾을 폴더 모두 @@ -1049,7 +1050,11 @@ K-9 메일 설치를 환영합니다. K-9은 표준 안드로이드 메일 클 \"%s\" 계정을 이용할 수 없습니다.; 저장장치를 확인하십시오. - 첨부파일 저장위치 - 첨부파일 저장 - 파일 브라우져를 찾을 수 없습니다. 첨부파일을 저장할 경로를 입력하시오 + 첨부파일 저장위치 + 첨부파일 저장 + 파일 브라우져를 찾을 수 없습니다. 첨부파일을 저장할 경로를 입력하시오 + + 위로 + 아래로 + diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index ab70814a8..7d3ae4106 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -83,8 +83,6 @@ Verwijder account Leeg maken in afwachting van acties (gevaar!) - - Accounts @@ -109,6 +107,9 @@ Bekijk/ verberg details Voeg Cc/Bcc toe Verander onderwerp + + + Voeg bijlage toe Voeg bijlage toe (Afbeelding) Voeg bijlage toe (Video) @@ -266,8 +267,7 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Geen e-mailadres gevonden. Sommige bijlagen zijn niet gedownload. Deze worden automatisch gedownload voor dat dit bericht is verzonden. Sommige bijlagen kunnen niet worden doorgestuurd omdat ze niet zijn gedownload. - - + Van: %s <%s> Aan: @@ -287,7 +287,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge bijlage ophalen. Niet in staat viewer te vinden voor %s. - Download compleet bericht @@ -314,7 +313,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Over %s Versie: %s - Bericht sterren Sterren geven gemarkeerde berichten aan Multi-selecteer selectieboxen @@ -334,6 +332,8 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Gebruik een lettertype met vaste breedte bij het weergeven van plain-tekstberichten Terug naar lijst na verwijderen Terug naar de berichtenlijst na bericht verwijderen + + Bevestig acties Toon een dialoogvenster altijd wanneer u de geselecteerde acties uitvoerd @@ -346,13 +346,11 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Lock-screen meldingen Niet weergegeven onderwerp van het bericht in de notificatie bar als het systeem is vergrendeld - Stilteperiode Schakel beltoon, vibratie en leds uit gedurende de nacht Stilteperiode start Stilteperiode eindigt - Een nieuwe account instellen Toets het e-mailadres in van deze account: (Je mag meer %d accounts toevoegen.) @@ -516,7 +514,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge 1000 berichten alle berichten - Kan bericht niet kopiëren of verplaatsen omdat deze niet gesynchroniseerd is met de server Setup kon niet afronden @@ -560,6 +557,9 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Schrijven berichten + + + Antwoorden na quote Wanneer u antwoord op berichten, zal het originele bericht boven uw antwoord staan. @@ -567,6 +567,9 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Platte Tekst (plaatjes en formattering worden verwijderd) HTML (plaatjes en formattering blijven behouden) + + + Quotestijl bij antwoorden Prefix (zoals Gmail, Pine) Header (zoals Outlook, Yahoo!, Hotmail) @@ -590,7 +593,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Opslag - Account kleur Kies de kleur van het account gebruikt in mappen en account lijst @@ -612,6 +614,8 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge 512Kb 1Mb 2Mb + 5Mb + 10Mb elke grootte (geen limiet) Sync berichten van @@ -628,7 +632,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge afgelopen 6 maanden afgelopen jaar - Mappen om te laten zien Alle Alleen 1e klasse mappen @@ -703,7 +706,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Knipper LED Knipper LED wanneer mail binnenkomt - Server instellingen Bericht samenstelling opties @@ -751,7 +753,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Kies account/identiteit Verzenden als - Ga naar Account Instellingen -> Beheer identiteiten om identiteiten aan te maken Je kan je eigen identiteit niet verwijderen Je kan een identiteit niet gebruiken zonder e-mailadres @@ -790,8 +791,11 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Alleen sommige \"Plus\" accounts staan POP access toe om verbinding te krijgen met dit programma. Als het niet mogelijk is om in te loggen met de juiste gebruikersnaam en wachtwoord, heb je misschien geen betaalde \"Plus\" account. Start de webbrowser om de toegang tot deze e-mailaccount te krijgen. - Als je POP3 wilt gebruiken, moet je het geebruik van POP3 activeren op de Yahoo mail settings pagina. + + + + Onbekend Certificaat Accepteer Sleutel @@ -820,8 +824,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Laat 1e en 2e klasse mappen zien Laat alles zien behalve 2e klasse mappen - - Positie handtekening Voor gequote berichten Na gequote berichten @@ -844,8 +846,6 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Apparaat zoom Gebruik zoom widgets of pinch-zoom als het apparaat dat ondersteunt - - Volgens systeem Achtergrond sync @@ -1051,4 +1051,8 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Sla bijlagen op naar... Sla bijlage op Geen bestandsverkenner gevonden. Waar wil je deze bijlage opslaan? + + + + diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index fa847c92b..5734c4cdc 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -96,8 +96,6 @@ Usuń konto Anuluj oczekujące zadania (niebezpieczne!) - - Konta @@ -123,6 +121,9 @@ Pokaż/Ukryj szczegóły Dodaj DW/UDW Edytuj temat + + + Dodaj załącznik Dodaj załącznik (Zdjęcie) Add załącznik (Film) @@ -278,8 +279,7 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Żaden adres email nie został znaleziony. Niektóre załączniki nie zostały pobrane. Zostaną pobrane automatycznie przed wysłaniem tej wiadomości. Niektóre załączniki nie mogą byc przesłane dalej ponieważ nie zostały wcześniej pobrane. - - + Od: %s <%s> Do: @@ -299,7 +299,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Pobieram załącznik... Nie moge znaleźć programu do wyświetlenia pliku %s. - Pobierz całą wiadomość @@ -326,7 +325,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej %s wersja %s - Oznaczaj gwiazdkami Gwiazka wskazuje oznakowane wiadomości Zaznaczanie wielu maili @@ -346,6 +344,8 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Użyj czcionki o stałej szerokości do wyświetlania maili tekstowych Skasuj i wróć do listy Wraca do listy wiadomości po usunięciu danego maila + + Potwierdź akcje Pokaż okno dialogowe kiedy wykonujesz wybrane akcje @@ -358,13 +358,11 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Powiadomienia ekranowe przy zablokowanym ekranie Nie pokazuj tematu wiadomości w pasku powiadimień gdy ekran jest zablokowany - Okres ciszy Wyłącz dzwonienie, wibracje i mruganie w nocy Początek okresu ciszy Koniec okresu ciszy - Dodaj konto Wpisz dane konta (Możesz utworzyć %d dodatkowych kont.) @@ -528,7 +526,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej 1000 wiadomości Wszystkie wiadomości - Nie mogę skopiować ani przenieść wiadomości, która nie jest zsynchronizowana z serwerem Wystąpił błąd @@ -572,6 +569,9 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Tworzenie wiadomości + + + Odpowiadaj po cytowanym tekście Podczas odpowiadania, wiadomość oryginalna pojawi się nad Twoją odpowiedzią. @@ -579,6 +579,9 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Czysty tekst (bez obrazków i formatowania) HTML (z obrazkami i formatowaniem) + + + Styl cytowania podczas odpowiedzi Prefix (jak Gmail, Pine) Nagłówek (jak Outlook, Yahoo!, Hotmail) @@ -602,7 +605,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Przechowanie - Kolor konta Wybierz kolor, który będzie użyty przy wyświetlaniu folderów i listy kont @@ -624,6 +626,8 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej 512Kb 1Mb 2Mb + 5Mb + 10Mb dowolny rozmiar (bez limitu) Synchronizuj nowsze niż @@ -640,7 +644,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej ostatnie 6 miesięcy ostatni rok - Wyświetlaj foldery Wszystkie Tylko foldery klasy 1 @@ -715,7 +718,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Mrugaj diodą Zamrugaj diodą przy nowej wiadomości - Ustawienia serwera Opcje tworzenia wiadomości @@ -763,7 +765,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Wybierz konto/tożsamość Wyślij jako - Przejdź do "Ustawienia Konta" -> "Tożsamości" aby utworzyć tożsamość Nie możesz usunąć jedynej tożsamości Nie możesz użyć tożsamości bez podanego adresu email @@ -805,8 +806,11 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej do swojego konta z użyciem poprawnego hasła i adresu email, najprawdopodobniej nie masz płatnego konta typu \"Plus\". W takim przypadku musisz z poczty korzystać w dotychczasowy sposób, za pośrednictwem przeglądarki. - Jeśli chcesz uzywać POP3 dla tego dostawcy, powinieneś zezwolić na użycie POP3 na stronie ustawień poczty Yahoo. + + + + Nieznany certyfikat Akceptuj @@ -835,8 +839,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Klasy 1 oraz 2 Wszystkie poza klasą 2 - - Umieść sygnaturę Przed cytowaną wiadomością Pod cytowaną wiadomością @@ -859,8 +861,6 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Systemowe powiększenie Użyj zoom widgets i pinch-zoom jeśli Twoje urzędzenie je obsługuje - - Domyślny systemowy Synchronizacja w tle @@ -1064,4 +1064,8 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej + + + + diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 283b63674..eb4d22b7b 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -83,8 +83,6 @@ Remover conta Limpar ações pendentes (perigoso!) - - Contas â—€ â—€ @@ -110,6 +108,9 @@ Ver/esconder detalhes Incluir Cc/Bcc Editar assunto + + + Incluir anexo Incluir anexo (Imagem) Incluir anexo (Video) @@ -264,8 +265,7 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Alguns anexos não foram incluídos. Eles poderão ser incluídos automaticamente antes desta mensagem ser enviada. Alguns anexos não podem ser encaminhados porque não foram inclusos na mensagem. - - + De: %s <%s> Para: @@ -285,7 +285,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Buscando anexo. Não foi possível encontrar um visualizador para %s. - Transferir mensagem completa @@ -312,7 +311,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Sobre %s Versão: %s - Mostrar favoritos Estrelas indicam mensagens favoritas Caixas de multi-seleção @@ -332,6 +330,8 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Use um tamanho fixo de fonte quando mostrar mensagens com texto simples Retornar para lista após exclusão Retornar para lista de mensagem após exclusão de mensagens + + Confirmar ações Mostrar diálogo sempre quando for disparada uma ação @@ -344,13 +344,11 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Notificações de bloqueio de tela Não mostrar assunto da mensagem na barra de status do sistema quando estiver bloqueado - Período de silêncio Desabilitar sons, vibração e luz indicadora à noite Início do período de silêncio Fim do período de silêncio - Configurar uma nova conta Informe o endereço de e-mail da conta: (Você você pode incluir %d mais contas.) @@ -514,7 +512,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código 1000 mensagens Todas as mensagens - Não é possível copiar ou mover uma mensagem que não foi sincronizada com o servidor A configuração não pode ser concluída @@ -558,6 +555,9 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Enviando e-mails + + + Resposta após texto da mensagem Quando respondendo mensagens, o texto original deverá aparecer acima da minha resposta. @@ -565,6 +565,9 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código + + + @@ -588,7 +591,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Armazenamento - Cor da conta Escolha uma cor para pastas e listas desta conta @@ -610,6 +612,8 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código 512Kb 1Mb 2Mb + 5Mb + 10Mb Qualquer tamanho (sem limites) Sincronização de mensagens @@ -626,7 +630,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Dos últimos 6 mêses Do último ano - Visualização Todas Somente Pastas de Primeira Classe @@ -701,7 +704,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Piscar LED Piscar LED quando chegar e-mail - Configuração de servidor Opções para composição de uma mensagem @@ -749,7 +751,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Escolher conta/identidade Enviar como - Abra Configurações de Conta -> Gerenciamento de identidade para criar uma nova Você não pode remover sua única identidade Você não pode usar uma identidade sem um endereço de e-mail @@ -790,8 +791,11 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código permitindo que este programa se conecte. Se não estiver conseguindo logar nela com seu endereço de e-mail e senha corretos, talvez você não tenha uma conta \"Plus\" paga. Por favor, abra seu Web browser para conseguir acesso a estes tipos de contas. - Se desejar utilizar POP3 para este provedor, você deverá permitir o uso deste na página de configurações de se e-mail Yahoo. + + + + Certificado desconhecido Aceitar chave @@ -820,8 +824,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Mostrar pastas de Primeira e Segunda Classe Mostar todas exceto as de Segunda Classe - - Local da Assinatura Antes de escrever o texto Depois do texto escrito @@ -844,8 +846,6 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Controle de zoom do sistema Habilitar widgets de zoom se o telefone suportar - - Padrões de sistema Sincronização em segundo plano @@ -1048,4 +1048,8 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código + + + + diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 759bfd64d..128e30a42 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -108,6 +108,9 @@ Показать/спрятать подробности Добавить Копию/СК Редактировать тему + + + Добавить вложение Добавить вложение (Изображение) Добавить вложение (Видео) @@ -256,9 +259,9 @@ Не найден адрес почты. Некоторые вложения не были загружены. Они будут автоматически загружены перед отправкой этого сообщения. Некоторые вложения не могут быть пересланы, поскольку они не загрузились. - Цитировать сообщение + Цитировать сообщение - От: %s <%s> + От: %s <%s> Для: Копия: Открыть @@ -302,7 +305,6 @@ О Программе %s Версия: %s - Показывать звезды Звезды указывают отмеченные сообщения Флажки множественного выбора @@ -322,6 +324,8 @@ Использовать шрифт фиксированной ширины при показе плоского текста Вернуться к списку после удаления Вернуться к списку сообщений после удаления сообщения + + Подтверждение действий Показывать диалог при совершении действий @@ -334,7 +338,6 @@ Уведомления при заблокированном экране Не показывать тему письма в уведомлениях, когда система заблокирована - Время тишины Запретить сигнал, вибрацию, мигание в ночное время Начинало времени тишины @@ -546,16 +549,19 @@ Написание сообщений - Цитировать оригинальное сообщение при ответе - Оригинальное сообщение вставляется в ответное сообщение. + Цитировать оригинальное сообщение при ответе + Оригинальное сообщение вставляется в ответное сообщение. - Отвечать после цитаты + Отвечать после цитаты При ответе цитата будет выше ответа. Формат сообщения Плоский текст (изображения и форматирование не сохраняется) HTML (сохранять изображения и форматирование) + + + Стиль цитирования Префикс (например Gmail, Pine) Заголовок (например Outlook, Yahoo!, Hotmail) @@ -579,7 +585,6 @@ Хранилище - Цвет учётной записи Выберите цвет учётной записи, используемый в папке и списке учётных записей @@ -601,6 +606,8 @@ 512Kb 1Mb 2Mb + 5Mb + 10Mb любого размера без ограничений Синхронизировать сообщения @@ -617,7 +624,6 @@ за 6 последних месяцев за последний год - Выбор показываемых папок Все Только папки 1-го класса @@ -739,7 +745,6 @@ Выбрать учётную запись/личность Послать как - Добавить личность можно в Настройке Ящиков -> Управление личностями Нельзя удалить единственную личность. Личность без адреса электронной почты не позволяется. @@ -779,15 +784,13 @@ Только некоторые \"Plus\" ящики поддерживают получение почты через \"POP\". Если вы не можете подключится с верными данными подключения, то ваш почтовый ящик не имеет такого доступа. Воспользуйтесь мобильной версией Yahoo! Mail для получения сообщений. - Если вы хотите использовать POP3 для данного поставщика, вы должны разрешить использование POP3 на странице настроек почты Yahoo. + Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Naver. + Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Hanmail(Daum). + Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Paran. + Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Nate. - Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Naver. - Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Hanmail(Daum). - Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Paran. - Если вы хотите использовать IMAP или POP3 для данного поставщика, вы должны разрешить использование IMAP или POP3 на странице настроек почты Nate. - - Сертификат не признан + Сертификат не признан Принять сертификат Отклонить сертификат @@ -814,8 +817,6 @@ Показывать папки 1-го и 2-го классов Показывать все папки, за исключением 2-го класса - - Размещение подписи перед цитатой после цитаты @@ -849,16 +850,16 @@ Никаких сообщшний не выбранно Формат даты - - SHORT - MEDIUM - dd-MMM-yyyy - yyyy-MM-dd + + SHORT + MEDIUM + dd-MMM-yyyy + yyyy-MM-dd - Групповые операции + Групповые операции Удалить выбранное Пометить выбранное как прочитанное Пометить выбранное как не прочитанное @@ -934,111 +935,117 @@ Дистанционное управление K-9 Mail Позволяет этому приложению управлеть деятельностью и настройками K-9 Mail. - Размер шрифта - Настройте размер шрифта + Размер шрифта + Настройте размер шрифта - Список учётных записей - Название учётной записи - Описание учётной записи + Список учётных записей + Название учётной записи + Описание учётной записи - Список папок - Имя папки - Статус папки + Список папок + Имя папки + Статус папки - Список сообщений - Тема - Отпрвитель - Дата - Предпросмотр + Список сообщений + Тема + Отпрвитель + Дата + Предпросмотр - Сообщения - отправитель - Кому - Скрытая копия - дополнительные заголовки - Тема - Время - Дата - Тело сообщения + Сообщения + отправитель + Кому + Скрытая копия + дополнительные заголовки + Тема + Время + Дата + Тело сообщения - самый крочшечный - Крошечный - Еще меньше - Маленький - средний - Большой - Наибольший + самый крочшечный + Крошечный + Еще меньше + Маленький + средний + Большой + Наибольший - Крошечный - Маленький - Нормальный - Большой - Наибольший + Крошечный + Маленький + Нормальный + Большой + Наибольший - - Выберите \"Настройка\" -> \"Использовать обход проблемы...\", чтобы вкладывать картинки и изображения используя Gallery 3D. + + Выберите \"Настройка\" -> \"Использовать обход проблемы...\", чтобы вкладывать картинки и изображения используя Gallery 3D. - - Выберите \"Добавить вложение (Картинка)\" или "Добвить вложение (Видео)\", чтобы вкладывать картинки и изображения используя Gallery 3D. + + Выберите \"Добавить вложение (Картинка)\" или "Добвить вложение (Видео)\", чтобы вкладывать картинки и изображения используя Gallery 3D. - Разное - Использовать обход проблемы с \"Использовать галерею\" - Показывать кнопки для добавления картинок и видео вложений (чтобы обойти проблемы с 3D в Gallery) - - Нет подходящего приложения для действия. - Установленная версия APG не поддерживается. - подписать - Зашифровать - Расшифровать - проверить - <неизвестный> - id: %s - K-9 Mail не имеет разрешения для полного доступа к APG, please пожалуйста переустановите приложение. - PGP/MIME сообщения пока не поддерживаются. - Предупреждение: вложения еще не подписаны и не зашифрованы. - Отправка отменена. + Разное + Использовать обход проблемы с \"Использовать галерею\" + Показывать кнопки для добавления картинок и видео вложений (чтобы обойти проблемы с 3D в Gallery) - Сохранить черновик сообщения? - Сохранить или уничтожить сообщение? + + Нет подходящего приложения для действия. + Установленная версия APG не поддерживается. + подписать + Зашифровать + Расшифровать + проверить + <неизвестный> + id: %s + K-9 Mail не имеет разрешения для полного доступа к APG, please пожалуйста переустановите приложение. + PGP/MIME сообщения пока не поддерживаются. + Предупреждение: вложения еще не подписаны и не зашифрованы. + Отправка отменена. - Это сообщение не может быть отображено, так как кодовая страница \"%s\" не найдена. + Сохранить черновик сообщения? + Сохранить или уничтожить сообщение? - Выберите текс для копирования. + Это сообщение не может быть отображено, так как кодовая страница \"%s\" не найдена. - Подтвердите удаление - Вы хотите удалить это сообщение? - Удалить - Не удалять + Выберите текс для копирования. - Подтвердите перенос в папку Спам - - Вы действительно хотите переместить сообщение в папку Спам? - Вы действительно хотите переместить %1$d сообщений в папку Спам? + Подтвердите удаление + Вы хотите удалить это сообщение? + Удалить + Не удалять + + Подтвердите перенос в папку Спам + + Вы действительно хотите переместить сообщение в папку Спам? + Вы действительно хотите переместить %1$d сообщений в папку Спам? - - Да - Нет + + Да + Нет - Скачивание вложения + Скачивание вложения - Разрешить журналирование отладочной информайии + Разрешить журналирование отладочной информайии - » - - Не получается соединиться. + » + + Не получается соединиться. - Учётная запись\"%s\" недоступна; проверьте хранилище + Учётная запись\"%s\" недоступна; проверьте хранилище + + Сохранять вложения в... + Сохранить вложение + Не найден браузер файлов. Где бы вы хотели сохранить вложение? + + + - Сохранять вложения в... - Сохранить вложение - Не найден браузер файлов. Где бы вы хотели сохранить вложение? diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index a9b11cf75..bab518521 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -83,8 +83,6 @@ Ta bort konto Rensa avvaktande handlingar (farligt!) - - Konton @@ -110,6 +108,9 @@ Visa/dölj detaljer Lägg till Cc/Bcc Redigera ämne + + + Lägg till bilaga Lägg till bilaga (Bild) Lägg till bilaga (Video) @@ -268,8 +269,7 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Några bilagor hämtades inte. De kommer att hämtas automatiskt innan detta brev sänds. Några bilagor kan inte vidarebefordras eftersom de inte har hämtats. - - + Från: %s <%s> Till: @@ -289,7 +289,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Hämtar bilaga. Kan inte hitta visare för %s. - Hämta hem hela brevet @@ -316,7 +315,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Om %s Version: %s - Stjärnor Stjärnor indikerar flaggade brev Checkboxar för flerval @@ -336,6 +334,8 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Använd ett teckensnitt med fast bredd för att visa brev med enbart text Återvänd till listan efter radering Återvänd till listan efter att ha raderat ett brev + + Bekräfta åtgärder Visa en dialogruta när du genomför utvalda åtgärder @@ -348,13 +348,11 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Privatläge Visa inte e-postens ämnen i notifieringsytan när systemet är låst - Tyst tid Avaktivera ringsignaler, vibration och blinkande på natten Tyst tid börjar Tyst tid slutar - Konfigurera ett nytt konto Ange detta kontos e-post-adress: (Du kan lägga till ytterligare%d konton.) @@ -518,7 +516,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen 1000 brev alla brev - Kan inte kopiera eller flytta ett brev som inte är synkroniserat med servern Kunde inte fullborda konfigurationen @@ -562,6 +559,9 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Skriva brev + + + Svar efter citat Vid svar på e-post placeras originalmeddelandet ovanför ditt svar. @@ -569,6 +569,9 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Ren text (bilder och formatering tas bort) HTML (bilder och formatering behålls) + + + Citationsstil vid svar Prefix (som Gmail, Pine) Header (som Outlook, Yahoo!, Hotmail) @@ -592,7 +595,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Lagring - Kontofärg Välj färg för att visa detta konto i mappar och kontolistor @@ -614,6 +616,8 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen 512Kb 1Mb 2Mb + 5Mb + 10Mb Ingen gräns Synka e-post från @@ -630,7 +634,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen senaste 6 månaderna senaste året - Mappar att visa Alla Bara första klassens mappar @@ -705,7 +708,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Blinka LED Blinka LED när det kommer ny e-post - Serverinställningar Inställningar för att skriva brev @@ -753,7 +755,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Välj konto/identitet Skicka som - Gå till Kontoinställningar -> Hantera identiteter för att skapa en identitet Du kan inte radera din enda identitet Du kan inte använda en identitet utan e-postadress @@ -794,8 +795,11 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen vilket krävs för detta program för att ansluta. Om du misslyckas med att logga in med din korrekta adress och lösenord så kanske du inte har ett betalt \"Plus\"-konto. Vänligen starta webbläsaren för att komma åt dessa konton. - Om du vill använda POP3 med denna leverantör måste du välja att tillåta POP3 på inställningssidan för Yahoo!. + + + + Okänt Certifikat Acceptera nyckel @@ -824,8 +828,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Visa första och andra klassens mappar Visa alla förutom andra klassens mappar - - Signaturposition Före citerad text Efter citerad text @@ -848,8 +850,6 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Kontroll av zoom Aktivera zoom-widgets eller nyp-zoom om din enhet stödjer det - - Systemstandard Bakgrundssynkronisering @@ -1054,4 +1054,8 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen + + + + diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 4973a8c47..b7bc585e9 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -83,8 +83,6 @@ 删除账户 取消挂起的操作(慎用) - - 账户 @@ -109,6 +107,9 @@ 显示/隐藏详细信息 添加抄送/暗送 编辑主题 + + + 添加附件 添加图片附件 添加视频附件 @@ -255,8 +256,7 @@ 一些附件没有被下载。在这个邮件发送前会自动的下载这些附件。 由于一些附件还没有被下载,因此无法转发这些附件。 - - + 发件人:%s <%s> 收件人: @@ -276,7 +276,6 @@ 正在接收附件。 无法打开%s。找不到可以阅读该文件的程序。 - 下载完整邮件 @@ -303,7 +302,6 @@ 关于%s 版本:%s - 显示星标 星标指示标记过的邮件 复选框 @@ -323,6 +321,8 @@ 使用定宽字体显示纯文本邮件 删除后回到自动返回到列表 邮件删除后自动返回到邮件列表 + + 确认操作 进行选择操作时总是显示一个对话框进行确认 @@ -335,13 +335,11 @@ 锁屏通知 屏幕锁定时不要在通知栏中显示邮件主题 - - 设置新账户 输入该账户的电子邮件地址: (你还可以再添加%d个账户) @@ -505,7 +503,6 @@ 1000封 - 没有与服务器同步的邮件无法进行拷贝或移动 无法完成设置 @@ -549,6 +546,9 @@ 正在发送邮件 + + + 在引用的文本后进行回复 回复邮件时,原始邮件会显示在您的邮件的上方。 @@ -556,6 +556,9 @@ + + + @@ -579,7 +582,6 @@ - 账户颜色 选择账户在文件夹和账户列表中显示时所使用的颜色 @@ -601,6 +603,8 @@ 512Kb 1Mb 2Mb + 5Mb + 10Mb 任意(无限制) 同步该时段内的邮件 @@ -617,7 +621,6 @@ 六个月内 一年内 - 显示的文件夹 全部 仅初级文件夹 @@ -692,7 +695,6 @@ 闪烁LED灯 有新邮件时闪烁LED灯 - 服务器设置 撰写新邮件选项 @@ -740,7 +742,6 @@ 选择账户/身份标识 - 请使用“账户设置”->“管理身份标识”来创建身份标识 您必须保留一个身份标识 身份标识中必须包含电子邮件地址 @@ -778,8 +779,11 @@ 账户“%s”中的全部邮件将从K-9 Mail中删除,但是账户设置将保留。 只有一些“高级账户”允许POP访问并允许该程序连接。如果您使用了正确的用户名和密码却仍旧无法登录,则您可能没有购买这些“高级账户”。请使用浏览器来访问这些账户。 - + + + + 无法识别的证书信息 接收密钥 @@ -807,8 +811,6 @@ 显示初级和次级文件夹 仅不显示次级文件夹 - - 签名位置 在引用的文本之前 在引用的文本之后 @@ -831,8 +833,6 @@ 系统放大控制 如果设备支持则启用放大插件或多点触摸放大 - - 系统默认值 后台同步 @@ -1035,4 +1035,8 @@ + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 3d4a6da93..fe0bcd940 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -83,8 +83,6 @@ Remove account Clear pending actions (danger!) - - Accounts @@ -273,7 +271,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Some attachments cannot be forwarded because they have not been downloaded. Quote message - From: %s <%s> To: Cc: @@ -292,7 +289,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Fetching attachment. Unable to find viewer for %s. - Download complete message @@ -319,7 +315,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin About %s Version: %s - Show stars Stars indicate flagged messages Multi-select checkboxes @@ -339,6 +334,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Use a fixed-width font when showing plain-text messages Return to list after delete Return to message list after message deletion + Show next message after delete + Show next message by default after message deletion Confirm actions Show a dialog whenever you perform selected actions @@ -351,13 +348,11 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Lock-screen notifications Don\'t display message subject in notification bar when system is locked - Quiet Time Disable ringing, buzzing and flashing at night Quiet Time starts Quiet Time ends - Set up a new account Enter this account\'s email address: (You may add %d more accounts.) @@ -523,7 +518,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin 1000 messages all messages - Cannot copy or move a message that is not synchronized with the server Setup could not finish @@ -603,7 +597,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Storage - Account color Choose the color of the account used in folder and account list @@ -643,7 +636,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin the last 6 months the last year - Folders to display All Only 1st Class folders @@ -718,7 +710,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Blink LED Blink LED when mail arrives - Server settings Message composition options @@ -766,7 +757,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Choose account/identity Send as - Go to Account Settings -> Manage Identities to create identities You can\'t remove your only identity You can\'t use an identity without an email address @@ -808,14 +798,12 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin your correct email address and password, you may not have a paid \"Plus\" account. Please launch the Web browser to gain access to these mail accounts. - If you would like to use POP3 for this provider, You should permit to use POP3 on Yahoo mail settings page. - If you would like to use IMAP or POP3 for this provider, You should permit to use IMAP or POP3 on Naver mail settings page. If you would like to use IMAP or POP3 for this provider, You should permit to use IMAP or POP3 on Hanmail(Daum) mail settings page. If you would like to use IMAP or POP3 for this provider, You should permit to use IMAP or POP3 on Paran mail settings page. If you would like to use IMAP or POP3 for this provider, You should permit to use IMAP or POP3 on Nate mail settings page. - + Unrecognized Certificate Accept Key Reject Key @@ -843,8 +831,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Display 1st and 2nd Class folders Display all except 2nd Class folders - - Signature position Before quoted text After quoted text @@ -867,8 +853,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin System zoom controls Enable zoom widgets or pinch-zoom if your device supports it - - System default Background sync @@ -1077,5 +1061,5 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Move up Move down - + diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index d3297c942..58c41afdf 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -217,6 +217,12 @@ android:title="@string/global_settings_messageview_return_to_list_label" android:summary="@string/global_settings_messageview_return_to_list_summary" /> + + 0) { - sb.append(','); - } - sb.append(uuids[i]); - } - String accountUuids = sb.toString(); - return accountUuids; - } - protected synchronized void delete(Preferences preferences) { String[] uuids = preferences.getPreferences().getString("accountUuids", "").split(","); String[] newUuids = new String[uuids.length - 1]; @@ -401,7 +389,7 @@ public class Account implements BaseAccount { } } - String accountUuids = combineUuids(newUuids); + String accountUuids = Utility.combine(newUuids, ','); SharedPreferences.Editor editor = preferences.getPreferences().edit(); editor.putString("accountUuids", accountUuids); @@ -519,7 +507,7 @@ public class Account implements BaseAccount { } } } - String accountUuids = combineUuids(newUuids); + String accountUuids = Utility.combine(newUuids, ','); editor.putString("accountUuids", accountUuids); editor.commit(); preferences.refreshAccounts(); @@ -1053,7 +1041,7 @@ public class Account implements BaseAccount { } // It'd be great if this actually went into the store implementation - // to get this, but that's expensive and not easilly accessible + // to get this, but that's expensive and not easily accessible // during initialization public boolean isSearchByDateCapable() { if (getStoreUri().startsWith("imap")) { @@ -1135,7 +1123,7 @@ public class Account implements BaseAccount { ident++; } while (gotOne); - if (newIdentities.size() == 0) { + if (newIdentities.isEmpty()) { String name = prefs.getString(mUuid + ".name", null); String email = prefs.getString(mUuid + ".email", null); boolean signatureUse = prefs.getBoolean(mUuid + ".signatureUse", true); diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java index 60314d288..fd43cfc6a 100644 --- a/src/com/fsck/k9/K9.java +++ b/src/com/fsck/k9/K9.java @@ -168,6 +168,7 @@ public class K9 extends Application { private static int mContactNameColor = 0xff00008f; private static boolean mMessageViewFixedWidthFont = false; private static boolean mMessageViewReturnToList = false; + private static boolean mMessageViewShowNext = false; private static boolean mGesturesEnabled = true; private static boolean mUseVolumeKeysForNavigation = false; @@ -258,7 +259,7 @@ public class K9 extends Application { public static final int PUSH_WAKE_LOCK_TIMEOUT = 60000; - public static final int MAIL_SERVICE_WAKE_LOCK_TIMEOUT = 30000; + public static final int MAIL_SERVICE_WAKE_LOCK_TIMEOUT = 60000; public static final int BOOT_RECEIVER_WAKE_LOCK_TIMEOUT = 60000; @@ -435,6 +436,7 @@ public class K9 extends Application { editor.putInt("registeredNameColor", mContactNameColor); editor.putBoolean("messageViewFixedWidthFont", mMessageViewFixedWidthFont); editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList); + editor.putBoolean("messageViewShowNext", mMessageViewShowNext); editor.putString("language", language); editor.putInt("theme", theme); @@ -491,6 +493,7 @@ public class K9 extends Application { mContactNameColor = sprefs.getInt("registeredNameColor", 0xff00008f); mMessageViewFixedWidthFont = sprefs.getBoolean("messageViewFixedWidthFont", false); mMessageViewReturnToList = sprefs.getBoolean("messageViewReturnToList", false); + mMessageViewShowNext = sprefs.getBoolean("messageViewShowNext", false); useGalleryBugWorkaround = sprefs.getBoolean("useGalleryBugWorkaround", K9.isGalleryBuggy()); @@ -575,7 +578,7 @@ public class K9 extends Application { @Override public void searchStats(final AccountStats stats) { - // let observers know a fetch occured + // let observers know a fetch occurred K9.this.sendBroadcast(new Intent(K9.Intents.EmailReceived.ACTION_REFRESH_OBSERVER, null)); } @@ -596,7 +599,7 @@ public class K9 extends Application { catch (Exception e) { // Discard , as it means we're not running on a device with strict mode - Log.v(K9.LOG_TAG, "Failed to turn on strict mode " + e); + Log.v(K9.LOG_TAG, "Failed to turn on strict mode", e); } } @@ -875,6 +878,14 @@ public class K9 extends Application { mMessageViewReturnToList = messageViewReturnToList; } + public static boolean messageViewShowNext() { + return mMessageViewShowNext; + } + + public static void setMessageViewShowNext(boolean messageViewShowNext) { + mMessageViewShowNext = messageViewShowNext; + } + public static Method getMethod(Class classObject, String methodName) { try { return classObject.getMethod(methodName, boolean.class); diff --git a/src/com/fsck/k9/Preferences.java b/src/com/fsck/k9/Preferences.java index 6ee07f538..f30c7e578 100644 --- a/src/com/fsck/k9/Preferences.java +++ b/src/com/fsck/k9/Preferences.java @@ -129,8 +129,13 @@ public class Preferences { } public synchronized void deleteAccount(Account account) { - accounts.remove(account.getUuid()); - accountsInOrder.remove(account); + if (accounts != null) { + accounts.remove(account.getUuid()); + } + if (accountsInOrder != null) { + accountsInOrder.remove(account); + } + account.delete(this); if (newAccount == account) { @@ -149,7 +154,7 @@ public class Preferences { if (defaultAccount == null) { Collection accounts = getAvailableAccounts(); - if (accounts.size() > 0) { + if (!accounts.isEmpty()) { defaultAccount = accounts.iterator().next(); setDefaultAccount(defaultAccount); } diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 420ac7d78..4bc0d3291 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -388,7 +388,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC mAdapter = new AccountsAdapter(newAccounts.toArray(EMPTY_BASE_ACCOUNT_ARRAY)); getListView().setAdapter(mAdapter); - if (newAccounts.size() > 0) { + if (!newAccounts.isEmpty()) { mHandler.progress(Window.PROGRESS_START); } pendingWork.clear(); @@ -745,7 +745,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC StringBuilder libs = new StringBuilder().append(""); diff --git a/src/com/fsck/k9/activity/K9Activity.java b/src/com/fsck/k9/activity/K9Activity.java index 3fa72700b..b2c1827c6 100644 --- a/src/com/fsck/k9/activity/K9Activity.java +++ b/src/com/fsck/k9/activity/K9Activity.java @@ -14,15 +14,15 @@ import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; -import android.widget.ScrollView; import com.fsck.k9.K9; import com.fsck.k9.helper.DateFormatter; +import com.fsck.k9.view.ToggleScrollView; public class K9Activity extends Activity { private GestureDetector gestureDetector; - protected ScrollView mTopView; + protected ToggleScrollView mTopView; @Override public void onCreate(Bundle icicle) { @@ -86,12 +86,26 @@ public class K9Activity extends Activity { public java.text.DateFormat getDateFormat() { return mDateFormat; } - protected void onNext() { - } - protected void onPrevious() { + /** + * Called when a swipe from right to left is handled by {@link MyGestureDetector}. See + * {@link android.view.GestureDetector.OnGestureListener#onFling(android.view.MotionEvent, android.view.MotionEvent, float, float)} + * for more information on the {@link MotionEvent}s being passed. + * @param e1 First down motion event that started the fling. + * @param e2 The move motion event that triggered the current onFling. + */ + protected void onSwipeRightToLeft(final MotionEvent e1, final MotionEvent e2) { } + /** + * Called when a swipe from left to right is handled by {@link MyGestureDetector}. See + * {@link android.view.GestureDetector.OnGestureListener#onFling(android.view.MotionEvent, android.view.MotionEvent, float, float)} + * for more information on the {@link MotionEvent}s being passed. + * @param e1 First down motion event that started the fling. + * @param e2 The move motion event that triggered the current onFling. + */ + protected void onSwipeLeftToRight(final MotionEvent e1, final MotionEvent e2) { + } protected Animation inFromRightAnimation() { return slideAnimation(0.0f, +1.0f); @@ -114,6 +128,25 @@ public class K9Activity extends Activity { } class MyGestureDetector extends SimpleOnGestureListener { + private boolean gesturesEnabled = false; + + /** + * Creates a new {@link android.view.GestureDetector.OnGestureListener}. Enabled/disabled based upon + * {@link com.fsck.k9.K9#gesturesEnabled()}}. + */ + public MyGestureDetector() { + super(); + } + + /** + * Create a new {@link android.view.GestureDetector.OnGestureListener}. + * @param gesturesEnabled Setting to true will enable gesture detection, + * regardless of the system-wide gesture setting. + */ + public MyGestureDetector(final boolean gesturesEnabled) { + super(); + this.gesturesEnabled = gesturesEnabled; + } private static final float SWIPE_MIN_DISTANCE_DIP = 130.0f; private static final float SWIPE_MAX_OFF_PATH_DIP = 250f; @@ -137,7 +170,8 @@ public class K9Activity extends Activity { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (K9.gesturesEnabled()) { + // Do fling-detection if gestures are force-enabled or we have system-wide gestures enabled. + if (gesturesEnabled || K9.gesturesEnabled()) { // Convert the dips to pixels final float mGestureScale = getResources().getDisplayMetrics().density; int min_distance = (int)(SWIPE_MIN_DISTANCE_DIP * mGestureScale + 0.5f); @@ -150,9 +184,9 @@ public class K9Activity extends Activity { return false; // right to left swipe if (e1.getX() - e2.getX() > min_distance && Math.abs(velocityX) > min_velocity) { - onNext(); + onSwipeRightToLeft(e1, e2); } else if (e2.getX() - e1.getX() > min_distance && Math.abs(velocityX) > min_velocity) { - onPrevious(); + onSwipeLeftToRight(e1, e2); } } catch (Exception e) { // nothing diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 70cd53bb1..c14486d37 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -727,7 +727,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc private boolean setRecipients(TextView view, List recipients) { boolean recipientAdded = false; if (recipients != null) { - StringBuffer addressList = new StringBuffer(); + StringBuilder addressList = new StringBuilder(); for (String recipient : recipients) { addressList.append(recipient); addressList.append(", "); @@ -910,7 +910,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc boolean replyAfterQuote = false; String action = getIntent().getAction(); if (mAccount.isReplyAfterQuote() && - (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action))) { + (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || + ACTION_EDIT_DRAFT.equals(action))) { replyAfterQuote = true; } @@ -1365,7 +1366,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc } if (mEncryptCheckbox.isChecked() && !mPgpData.hasEncryptionKeys()) { // key selection before encryption - String emails = ""; + StringBuilder emails = new StringBuilder(); Address[][] addresses = new Address[][] { getAddresses(mToView), getAddresses(mCcView), getAddresses(mBccView) @@ -1373,18 +1374,18 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc for (Address[] addressArray : addresses) { for (Address address : addressArray) { if (emails.length() != 0) { - emails += ","; + emails.append(','); } - emails += address.getAddress(); + emails.append(address.getAddress()); } } if (emails.length() != 0) { - emails += ","; + emails.append(','); } - emails += mIdentity.getEmail(); + emails.append(mIdentity.getEmail()); mPreventDraftSaving = true; - if (!mAccount.getCryptoProvider().selectEncryptionKeys(MessageCompose.this, emails, mPgpData)) { + if (!mAccount.getCryptoProvider().selectEncryptionKeys(MessageCompose.this, emails.toString(), mPgpData)) { mPreventDraftSaving = false; } return; @@ -1930,7 +1931,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc if (message.getSubject() != null) { final String subject = prefix.matcher(message.getSubject()).replaceFirst(""); - if (!subject.toLowerCase().startsWith("re:")) { + if (!subject.toLowerCase(Locale.US).startsWith("re:")) { mSubjectView.setText("Re: " + subject); } else { mSubjectView.setText(subject); @@ -1964,7 +1965,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc mInReplyTo = message.getMessageId(); if (message.getReferences() != null && message.getReferences().length > 0) { - StringBuffer buffy = new StringBuffer(); + StringBuilder buffy = new StringBuilder(); for (int i = 0; i < message.getReferences().length; i++) buffy.append(message.getReferences()[i]); @@ -2027,10 +2028,11 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc } } } else if (ACTION_FORWARD.equals(action)) { - if (message.getSubject() != null && !message.getSubject().toLowerCase().startsWith("fwd:")) { - mSubjectView.setText("Fwd: " + message.getSubject()); + String subject = message.getSubject(); + if (subject != null && !subject.toLowerCase(Locale.US).startsWith("fwd:")) { + mSubjectView.setText("Fwd: " + subject); } else { - mSubjectView.setText(message.getSubject()); + mSubjectView.setText(subject); } // Quote the message and setup the UI. @@ -2189,14 +2191,22 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc Part textPart = MimeUtility.findFirstPartByMimeType(message, "text/plain"); if (textPart != null) { String text = MimeUtility.getTextFromPart(textPart); + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "Loading message with offset " + bodyOffset + ", length " + bodyLength + ". Text length is " + text.length() + "."); + } + // If we had a body length (and it was valid), separate the composition from the quoted text // and put them in their respective places in the UI. if (bodyLength != null && bodyLength + 1 < text.length()) { // + 1 to get rid of the newline we added when saving the draft - String bodyText = text.substring(0, bodyLength); - String quotedText = text.substring(bodyLength + 1, text.length()); + String bodyText = text.substring(bodyOffset, bodyOffset + bodyLength); + + // Regenerate the quoted text without our user content in it. + StringBuilder quotedText = new StringBuilder(); + quotedText.append(text.substring(0, bodyOffset)); // stuff before the reply + quotedText.append(text.substring(bodyOffset + bodyLength)); mMessageContentView.setText(bodyText); - mQuotedText.setText(quotedText); + mQuotedText.setText(quotedText.toString()); } else { mMessageContentView.setText(text); } @@ -2557,13 +2567,13 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc // Read subject from the "subject" parameter. List subject = uri.getQueryParameters("subject"); - if (subject.size() > 0) { + if (!subject.isEmpty()) { mSubjectView.setText(subject.get(0)); } // Read message body from the "body" parameter. List body = uri.getQueryParameters("body"); - if (body.size() > 0) { + if (!body.isEmpty()) { mMessageContentView.setText(body.get(0)); } } diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 79a125b2f..626f522fb 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -818,7 +818,7 @@ public class MessageList mBatchDoneButton.setOnClickListener(this); // Gesture detection - gestureDetector = new GestureDetector(new MyGestureDetector()); + gestureDetector = new GestureDetector(new MyGestureDetector(true)); gestureListener = new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { @@ -847,7 +847,7 @@ public class MessageList /* (non-Javadoc) * - * Method overriden for proper typing within this class (the return type is + * Method overridden for proper typing within this class (the return type is * more specific than the super implementation) * * @see android.app.Activity#onRetainNonConfigurationInstance() @@ -863,7 +863,7 @@ public class MessageList /* * (non-Javadoc) * - * Method overriden for proper typing within this class (the return type is + * Method overridden for proper typing within this class (the return type is * more specific than the super implementation) * * @see android.app.Activity#getLastNonConfigurationInstance() @@ -1633,7 +1633,7 @@ public class MessageList } case R.id.same_sender: { MessageList.actionHandle(MessageList.this, - "From " + holder.sender, holder.senderAddress, true, + "From " + holder.sender, holder.senderAddress, false, null, null); break; } @@ -1660,35 +1660,34 @@ public class MessageList } } - class MyGestureDetector extends SimpleOnGestureListener { - @Override - public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (e2 == null || e1 == null) - return true; + @Override + protected void onSwipeRightToLeft(final MotionEvent e1, final MotionEvent e2) { + // Handle right-to-left as an un-select + handleSwipe(e1, false); + } - float deltaX = e2.getX() - e1.getX(), - deltaY = e2.getY() - e1.getY(); + @Override + protected void onSwipeLeftToRight(final MotionEvent e1, final MotionEvent e2) { + // Handle left-to-right as a select. + handleSwipe(e1, true); + } - boolean movedAcross = (Math.abs(deltaX) > Math.abs(deltaY * 4)); - boolean steadyHand = (Math.abs(deltaX / deltaY) > 2); + /** + * Handle a select or unselect swipe event + * @param downMotion Event that started the swipe + * @param selected true if this was an attempt to select (i.e. left to right). + */ + private void handleSwipe(final MotionEvent downMotion, final boolean selected) { + int position = mListView.pointToPosition((int) downMotion.getX(), (int) downMotion.getY()); + if (position != AdapterView.INVALID_POSITION) { + MessageInfoHolder msgInfoHolder = (MessageInfoHolder) mAdapter.getItem(position); - if (movedAcross && steadyHand) { - boolean selected = (deltaX > 0); - int position = mListView.pointToPosition((int)e1.getX(), (int)e1.getY()); - - if (position != AdapterView.INVALID_POSITION) { - MessageInfoHolder msgInfoHolder = (MessageInfoHolder) mAdapter.getItem(position); - - if (msgInfoHolder != null && msgInfoHolder.selected != selected) { - msgInfoHolder.selected = selected; - mSelectedCount += (selected ? 1 : -1); - mAdapter.notifyDataSetChanged(); - toggleBatchButtons(); - } - } + if (msgInfoHolder != null && msgInfoHolder.selected != selected) { + msgInfoHolder.selected = selected; + mSelectedCount += (selected ? 1 : -1); + mAdapter.notifyDataSetChanged(); + toggleBatchButtons(); } - - return false; } } @@ -1978,7 +1977,7 @@ public class MessageList } } - if (messagesToSearch.size() > 0) { + if (!messagesToSearch.isEmpty()) { mController.searchLocalMessages(mAccountUuids, mFolderNames, messagesToSearch.toArray(EMPTY_MESSAGE_ARRAY), mQueryString, mIntegrate, mQueryFlags, mForbiddenFlags, new MessagingListener() { @Override @@ -1988,11 +1987,11 @@ public class MessageList }); } - if (messagesToRemove.size() > 0) { + if (!messagesToRemove.isEmpty()) { removeMessages(messagesToRemove); } - if (messagesToAdd.size() > 0) { + if (!messagesToAdd.isEmpty()) { mHandler.addMessages(messagesToAdd); } diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index d1df6dcad..66670ab3a 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -82,14 +82,13 @@ public class MessageView extends K9Activity implements OnClickListener { private View mArchive; private View mMove; private View mSpam; - private ToggleScrollView mToggleScrollView; private Account mAccount; private MessageReference mMessageReference; private ArrayList mMessageReferences; private Message mMessage; private static final int PREVIOUS = 1; private static final int NEXT = 2; - private int mLastDirection = PREVIOUS; + private int mLastDirection = (K9.messageViewShowNext()) ? NEXT : PREVIOUS; private MessagingController mController = MessagingController.getInstance(getApplication()); private MessageReference mNextMessage = null; private MessageReference mPreviousMessage = null; @@ -132,14 +131,14 @@ public class MessageView extends K9Activity implements OnClickListener { public boolean dispatchTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_UP) { // Text selection is finished. Allow scrolling again. - mToggleScrollView.setScrolling(true); + mTopView.setScrolling(true); } else if (K9.zoomControlsEnabled()) { // If we have system zoom controls enabled, disable scrolling so the screen isn't wiggling around while // trying to zoom. if (ev.getAction() == MotionEvent.ACTION_POINTER_2_DOWN) { - mToggleScrollView.setScrolling(false); + mTopView.setScrolling(false); } else if (ev.getAction() == MotionEvent.ACTION_POINTER_2_UP) { - mToggleScrollView.setScrolling(true); + mTopView.setScrolling(true); } } return super.dispatchTouchEvent(ev); @@ -187,7 +186,7 @@ public class MessageView extends K9Activity implements OnClickListener { * Selecting text started via shift key. Disable scrolling as * this causes problems when selecting text. */ - mToggleScrollView.setScrolling(false); + mTopView.setScrolling(false); break; } case KeyEvent.KEYCODE_DEL: { @@ -379,7 +378,7 @@ public class MessageView extends K9Activity implements OnClickListener { requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.message_view); - mTopView = mToggleScrollView = (ToggleScrollView) findViewById(R.id.top_view); + mTopView = (ToggleScrollView) findViewById(R.id.top_view); mMessageView = (SingleMessageView) findViewById(R.id.message_view); //set a callback for the attachment view. With this callback the attachmentview @@ -871,7 +870,22 @@ public class MessageView extends K9Activity implements OnClickListener { } } + /** + * Handle a right-to-left swipe as "move to next message." + */ @Override + protected void onSwipeRightToLeft(MotionEvent e1, MotionEvent e2) { + onNext(); + } + + /** + * Handle a left-to-right swipe as "move to previous message." + */ + @Override + protected void onSwipeLeftToRight(MotionEvent e1, MotionEvent e2) { + onPrevious(); + } + protected void onNext() { if (mNextMessage == null) { Toast.makeText(this, getString(R.string.end_of_folder), Toast.LENGTH_SHORT).show(); @@ -886,7 +900,6 @@ public class MessageView extends K9Activity implements OnClickListener { mNext.requestFocus(); } - @Override protected void onPrevious() { if (mPreviousMessage == null) { Toast.makeText(this, getString(R.string.end_of_folder), Toast.LENGTH_SHORT).show(); @@ -1019,7 +1032,7 @@ public class MessageView extends K9Activity implements OnClickListener { }); break; case R.id.select_text: - mToggleScrollView.setScrolling(false); + mTopView.setScrolling(false); mMessageView.beginSelectingText(); break; default: diff --git a/src/com/fsck/k9/activity/setup/AccountSetupBasics.java b/src/com/fsck/k9/activity/setup/AccountSetupBasics.java index 2c31e1920..81773b8ba 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupBasics.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupBasics.java @@ -240,7 +240,6 @@ public class AccountSetupBasics extends K9Activity } } - @Override protected void onNext() { String email = mEmailView.getText().toString(); String[] emailParts = splitEmail(email); diff --git a/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java b/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java index 89c61726d..7a8eef99b 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java @@ -162,9 +162,17 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList afe.getMessage() == null ? "" : afe.getMessage()); } catch (final CertificateValidationException cve) { Log.e(K9.LOG_TAG, "Error while testing settings", cve); - acceptKeyDialog( - R.string.account_setup_failed_dlg_certificate_message_fmt, - cve); + + // Avoid NullPointerException in acceptKeyDialog() + if (TrustManagerFactory.getLastCertChain() != null) { + acceptKeyDialog( + R.string.account_setup_failed_dlg_certificate_message_fmt, + cve); + } else { + showErrorDialog( + R.string.account_setup_failed_dlg_server_message_fmt, + (cve.getMessage() == null ? "" : cve.getMessage())); + } } catch (final Throwable t) { Log.e(K9.LOG_TAG, "Error while testing settings", t); showErrorDialog( @@ -250,7 +258,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList } mProgressBar.setIndeterminate(false); - StringBuffer chainInfo = new StringBuffer(100); + StringBuilder chainInfo = new StringBuilder(100); MessageDigest sha1 = null; try { sha1 = MessageDigest.getInstance("SHA-1"); @@ -260,8 +268,8 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList for (int i = 0; i < chain.length; i++) { // display certificate chain information //TODO: localize this strings - chainInfo.append("Certificate chain[" + i + "]:\n"); - chainInfo.append("Subject: " + chain[i].getSubjectDN().toString() + "\n"); + chainInfo.append("Certificate chain[").append(i).append("]:\n"); + chainInfo.append("Subject: ").append(chain[i].getSubjectDN().toString()).append("\n"); // display SubjectAltNames too // (the user may be mislead into mistrusting a certificate @@ -272,7 +280,8 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList if (subjectAlternativeNames != null) { // The list of SubjectAltNames may be very long //TODO: localize this string - StringBuffer altNamesText = new StringBuffer("Subject has " + subjectAlternativeNames.size() + " alternative names\n"); + StringBuilder altNamesText = new StringBuilder(); + altNamesText.append("Subject has ").append(subjectAlternativeNames.size()).append(" alternative names\n"); // we need these for matching String storeURIHost = (Uri.parse(mAccount.getStoreUri())).getHost(); @@ -316,11 +325,11 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList // display them if (name.equalsIgnoreCase(storeURIHost) || name.equalsIgnoreCase(transportURIHost)) { //TODO: localize this string - altNamesText.append("Subject(alt): " + name + ",...\n"); + altNamesText.append("Subject(alt): ").append(name).append(",...\n"); } else if (name.startsWith("*.")) { if (storeURIHost.endsWith(name.substring(2)) || transportURIHost.endsWith(name.substring(2))) { //TODO: localize this string - altNamesText.append("Subject(alt): " + name + ",...\n"); + altNamesText.append("Subject(alt): ").append(name).append(",...\n"); } } } @@ -331,12 +340,12 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList Log.w(K9.LOG_TAG, "cannot display SubjectAltNames in dialog", e1); } - chainInfo.append("Issuer: " + chain[i].getIssuerDN().toString() + "\n"); + chainInfo.append("Issuer: ").append(chain[i].getIssuerDN().toString()).append("\n"); if (sha1 != null) { sha1.reset(); try { char[] sha1sum = Hex.encodeHex(sha1.digest(chain[i].getEncoded())); - chainInfo.append("Fingerprint (SHA-1): " + new String(sha1sum) + "\n"); + chainInfo.append("Fingerprint (SHA-1): ").append(new String(sha1sum)).append("\n"); } catch (CertificateEncodingException e) { Log.e(K9.LOG_TAG, "Error while encoding certificate", e); } diff --git a/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java index 336b33f8a..2924e9b3f 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -404,7 +404,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener } } - @Override protected void onNext() { try { int securityType = (Integer)((SpinnerOption)mSecurityTypeView.getSelectedItem()).value; diff --git a/src/com/fsck/k9/activity/setup/AccountSetupNames.java b/src/com/fsck/k9/activity/setup/AccountSetupNames.java index 493633e99..6079f3825 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupNames.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupNames.java @@ -79,7 +79,6 @@ public class AccountSetupNames extends K9Activity implements OnClickListener { Utility.setCompoundDrawablesAlpha(mDoneButton, mDoneButton.isEnabled() ? 255 : 128); } - @Override protected void onNext() { if (Utility.requiredFieldValid(mDescription)) { mAccount.setDescription(mDescription.getText().toString()); diff --git a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 9ba752990..0b30c6f74 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -282,7 +282,6 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, } } - @Override protected void onNext() { int securityType = (Integer)((SpinnerOption)mSecurityTypeView.getSelectedItem()).value; URI uri; diff --git a/src/com/fsck/k9/activity/setup/FolderSettings.java b/src/com/fsck/k9/activity/setup/FolderSettings.java index cd48f0475..a461fd083 100644 --- a/src/com/fsck/k9/activity/setup/FolderSettings.java +++ b/src/com/fsck/k9/activity/setup/FolderSettings.java @@ -156,7 +156,7 @@ public class FolderSettings extends K9PreferenceActivity { try { saveSettings(); } catch (MessagingException e) { - Log.e(K9.LOG_TAG, "Saving folder settings failed " + e); + Log.e(K9.LOG_TAG, "Saving folder settings failed", e); } } return super.onKeyDown(keyCode, event); diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index aa9168c65..86baa13fd 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -1,9 +1,10 @@ package com.fsck.k9.activity.setup; import java.io.File; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -import java.util.Vector; +import java.util.List; import android.content.Context; import android.content.Intent; @@ -69,6 +70,7 @@ public class Prefs extends K9PreferenceActivity { private static final String PREFERENCE_COMPACT_LAYOUTS = "compact_layouts"; private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list"; + private static final String PREFERENCE_MESSAGEVIEW_SHOW_NEXT = "messageview_show_next"; private static final String PREFERENCE_MESSAGEVIEW_ZOOM_CONTROLS_ENABLED = "messageview_zoom_controls"; private static final String PREFERENCE_QUIET_TIME_ENABLED = "quiet_time_enabled"; private static final String PREFERENCE_QUIET_TIME_STARTS = "quiet_time_starts"; @@ -106,6 +108,7 @@ public class Prefs extends K9PreferenceActivity { private CheckBoxPreference mChangeContactNameColor; private CheckBoxPreference mFixedWidth; private CheckBoxPreference mReturnToList; + private CheckBoxPreference mShowNext; private CheckBoxPreference mZoomControlsEnabled; private CheckBoxPreference mMobileOptimizedLayout; private ListPreference mBackgroundOps; @@ -132,8 +135,8 @@ public class Prefs extends K9PreferenceActivity { addPreferencesFromResource(R.xml.global_preferences); mLanguage = (ListPreference) findPreference(PREFERENCE_LANGUAGE); - Vector entryVector = new Vector(Arrays.asList(mLanguage.getEntries())); - Vector entryValueVector = new Vector(Arrays.asList(mLanguage.getEntryValues())); + List entryVector = new ArrayList(Arrays.asList(mLanguage.getEntries())); + List entryValueVector = new ArrayList(Arrays.asList(mLanguage.getEntryValues())); String supportedLanguages[] = getResources().getStringArray(R.array.supported_languages); HashSet supportedLanguageSet = new HashSet(Arrays.asList(supportedLanguages)); for (int i = entryVector.size() - 1; i > -1; --i) { @@ -256,6 +259,9 @@ public class Prefs extends K9PreferenceActivity { mReturnToList = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST); mReturnToList.setChecked(K9.messageViewReturnToList()); + mShowNext = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_SHOW_NEXT); + mShowNext.setChecked(K9.messageViewShowNext()); + mZoomControlsEnabled = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_ZOOM_CONTROLS_ENABLED); mZoomControlsEnabled.setChecked(K9.zoomControlsEnabled()); @@ -365,6 +371,7 @@ public class Prefs extends K9PreferenceActivity { K9.setChangeContactNameColor(mChangeContactNameColor.isChecked()); K9.setMessageViewFixedWidthFont(mFixedWidth.isChecked()); K9.setMessageViewReturnToList(mReturnToList.isChecked()); + K9.setMessageViewShowNext(mShowNext.isChecked()); K9.setMobileOptimizedLayout(mMobileOptimizedLayout.isChecked()); K9.setQuietTimeEnabled(mQuietTimeEnabled.isChecked()); diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 11c0d97f8..38139bb89 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -296,7 +296,7 @@ public class MessagingController implements Runnable { " Command '" + command.description + "' completed"); for (MessagingListener l : getListeners(command.listener)) { - l.controllerCommandCompleted(mCommands.size() > 0); + l.controllerCommandCompleted(!mCommands.isEmpty()); } } } catch (Exception e) { @@ -417,7 +417,7 @@ public class MessagingController implements Runnable { Folder[] folderArray = localFolders.toArray(EMPTY_FOLDER_ARRAY); - if (refreshRemote || localFolders.size() == 0) { + if (refreshRemote || localFolders.isEmpty()) { doRefreshRemote(account, listener); return; } @@ -1239,7 +1239,7 @@ public class MessagingController implements Runnable { messages.clear(); final ArrayList largeMessages = new ArrayList(); final ArrayList smallMessages = new ArrayList(); - if (unsyncedMessages.size() > 0) { + if (!unsyncedMessages.isEmpty()) { /* * Reverse the order of the messages. Depending on the server this may get us @@ -1495,7 +1495,7 @@ public class MessagingController implements Runnable { } }); - if (chunk.size() > 0) { + if (!chunk.isEmpty()) { writeUnsyncedMessages(chunk, localFolder, account, folder); chunk.clear(); } @@ -1755,7 +1755,7 @@ public class MessagingController implements Runnable { notifyAccount(mApplication, account, message, unreadBeforeStart, newMessages); } - }//for large messsages + }//for large messages if (K9.DEBUG) Log.d(K9.LOG_TAG, "SYNC: Done fetching large messages for folder " + folder); @@ -2241,7 +2241,7 @@ public class MessagingController implements Runnable { } } - if (messages.size() == 0) { + if (messages.isEmpty()) { return; } remoteFolder.setFlags(messages.toArray(EMPTY_MESSAGE_ARRAY), new Flag[] { flag }, newState); @@ -3290,9 +3290,11 @@ public class MessagingController implements Runnable { localSrcFolder.copyMessages(messages, localDestFolder); } else { localSrcFolder.moveMessages(messages, localDestFolder); - for (String origUid : origUidMap.keySet()) { + for (Map.Entry entry : origUidMap.entrySet()) { + String origUid = entry.getKey(); + Message message = entry.getValue(); for (MessagingListener l : getListeners()) { - l.messageUidChanged(account, srcFolder, origUid, origUidMap.get(origUid).getUid()); + l.messageUidChanged(account, srcFolder, origUid, message.getUid()); } unsuppressMessage(account, srcFolder, origUid); } @@ -4242,7 +4244,7 @@ public class MessagingController implements Runnable { names.add(folder.getName()); } - if (names.size() > 0) { + if (!names.isEmpty()) { PushReceiver receiver = new MessagingControllerPushReceiver(mApplication, account, this); int maxPushFolders = account.getMaxPushFolders(); diff --git a/src/com/fsck/k9/crypto/Apg.java b/src/com/fsck/k9/crypto/Apg.java index 0b85ff039..de1a2b77e 100644 --- a/src/com/fsck/k9/crypto/Apg.java +++ b/src/com/fsck/k9/crypto/Apg.java @@ -1,6 +1,7 @@ package com.fsck.k9.crypto; -import java.util.Vector; +import java.util.ArrayList; +import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -149,7 +150,7 @@ public class Apg extends CryptoProvider { intent.putExtra(EXTRA_INTENT_VERSION, INTENT_VERSION); long[] initialKeyIds = null; if (!pgpData.hasEncryptionKeys()) { - Vector keyIds = new Vector(); + List keyIds = new ArrayList(); if (pgpData.hasSignatureKey()) { keyIds.add(pgpData.getSignatureKeyId()); } @@ -175,7 +176,7 @@ public class Apg extends CryptoProvider { activity.getResources().getString(R.string.insufficient_apg_permissions), Toast.LENGTH_LONG).show(); } - if (keyIds.size() > 0) { + if (!keyIds.isEmpty()) { initialKeyIds = new long[keyIds.size()]; for (int i = 0, size = keyIds.size(); i < size; ++i) { initialKeyIds[i] = keyIds.get(i); diff --git a/src/com/fsck/k9/helper/AutoSyncHelper.java b/src/com/fsck/k9/helper/AutoSyncHelper.java index 84b728d5d..23e6b5907 100644 --- a/src/com/fsck/k9/helper/AutoSyncHelper.java +++ b/src/com/fsck/k9/helper/AutoSyncHelper.java @@ -12,7 +12,7 @@ public class AutoSyncHelper { * False, if we never tried to load the class for this SDK version. * True, otherwise. * - * Note: if sAutoSync is null and sChecked is true, then an error occured + * Note: if sAutoSync is null and sChecked is true, then an error occurred * while loading the class for the SDK version we're running on. */ private static boolean sChecked = false; diff --git a/src/com/fsck/k9/helper/Contacts.java b/src/com/fsck/k9/helper/Contacts.java index acf97d174..a79f0600a 100644 --- a/src/com/fsck/k9/helper/Contacts.java +++ b/src/com/fsck/k9/helper/Contacts.java @@ -187,8 +187,8 @@ public abstract class Contacts { */ public boolean hasContactPicker() { if (mHasContactPicker == null) { - mHasContactPicker = (mContext.getPackageManager(). - queryIntentActivities(contactPickerIntent(), 0).size() > 0); + mHasContactPicker = !(mContext.getPackageManager(). + queryIntentActivities(contactPickerIntent(), 0).isEmpty()); } return mHasContactPicker; } diff --git a/src/com/fsck/k9/helper/ContactsSdk3_4.java b/src/com/fsck/k9/helper/ContactsSdk3_4.java index c7addc83f..aae25c14b 100644 --- a/src/com/fsck/k9/helper/ContactsSdk3_4.java +++ b/src/com/fsck/k9/helper/ContactsSdk3_4.java @@ -231,12 +231,8 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts { } catch (Exception e) { Log.e(K9.LOG_TAG, "Failed to get email data", e); } finally { - if (cursor != null) { - cursor.close(); - } - if (cursor2 != null) { - cursor2.close(); - } + Utility.closeQuietly(cursor); + Utility.closeQuietly(cursor2); } return email; diff --git a/src/com/fsck/k9/helper/ContactsSdk5.java b/src/com/fsck/k9/helper/ContactsSdk5.java index b77539c88..83b21b567 100644 --- a/src/com/fsck/k9/helper/ContactsSdk5.java +++ b/src/com/fsck/k9/helper/ContactsSdk5.java @@ -201,9 +201,7 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts { } catch (Exception e) { Log.e(K9.LOG_TAG, "Failed to get email data", e); } finally { - if (cursor != null) { - cursor.close(); - } + Utility.closeQuietly(cursor); } return email; diff --git a/src/com/fsck/k9/helper/DomainNameChecker.java b/src/com/fsck/k9/helper/DomainNameChecker.java index b46f16118..3ef74f9e1 100644 --- a/src/com/fsck/k9/helper/DomainNameChecker.java +++ b/src/com/fsck/k9/helper/DomainNameChecker.java @@ -26,6 +26,7 @@ import java.security.cert.CertificateParsingException; import java.util.Collection; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -60,7 +61,7 @@ public class DomainNameChecker { return false; } - thisDomain = thisDomain.toLowerCase(); + thisDomain = thisDomain.toLowerCase(Locale.US); if (!isIpAddress(thisDomain)) { return matchDns(certificate, thisDomain); } else { @@ -223,7 +224,7 @@ public class DomainNameChecker { return false; } - thatDomain = thatDomain.toLowerCase(); + thatDomain = thatDomain.toLowerCase(Locale.US); // (a) domain name strings are equal, ignoring case: X matches X boolean rval = thisDomain.equals(thatDomain); diff --git a/src/com/fsck/k9/helper/HtmlConverter.java b/src/com/fsck/k9/helper/HtmlConverter.java index fefa22d2c..9cf3c38df 100644 --- a/src/com/fsck/k9/helper/HtmlConverter.java +++ b/src/com/fsck/k9/helper/HtmlConverter.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.HashSet; +import java.util.Locale; import java.util.Set; import java.util.regex.Matcher; @@ -52,18 +53,19 @@ public class HtmlConverter { */ private static class HtmlToTextTagHandler implements Html.TagHandler { // List of tags whose content should be ignored. - private static final Set TAGS_WITH_IGNORED_CONTENT = Collections.unmodifiableSet(new HashSet() { - { - add("style"); - add("script"); - add("title"); - add("!"); // comments - } - }); + private static final Set TAGS_WITH_IGNORED_CONTENT; + static { + Set set = new HashSet(); + set.add("style"); + set.add("script"); + set.add("title"); + set.add("!"); // comments + TAGS_WITH_IGNORED_CONTENT = Collections.unmodifiableSet(set); + } @Override public void handleTag(boolean opening, String tag, Editable output, XMLReader xmlReader) { - tag = tag.toLowerCase(); + tag = tag.toLowerCase(Locale.US); if (tag.equals("hr") && opening) { // In the case of an
, replace it with a bunch of underscores. This is roughly // the behaviour of Outlook in Rich Text mode. diff --git a/src/com/fsck/k9/helper/StringUtils.java b/src/com/fsck/k9/helper/StringUtils.java new file mode 100644 index 000000000..fd536aa2c --- /dev/null +++ b/src/com/fsck/k9/helper/StringUtils.java @@ -0,0 +1,9 @@ +package com.fsck.k9.helper; + +public final class StringUtils { + + public static boolean isNullOrEmpty(String string){ + return string == null || string.length() == 0; + } + +} diff --git a/src/com/fsck/k9/helper/Utility.java b/src/com/fsck/k9/helper/Utility.java index f9a555ff1..1c87e31fa 100644 --- a/src/com/fsck/k9/helper/Utility.java +++ b/src/com/fsck/k9/helper/Utility.java @@ -1,6 +1,7 @@ package com.fsck.k9.helper; +import android.database.Cursor; import android.text.Editable; import android.util.Log; import android.widget.EditText; @@ -12,9 +13,6 @@ import com.fsck.k9.mail.filter.Base64; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.Date; import java.util.regex.Matcher; @@ -36,17 +34,6 @@ public class Utility { private static final Pattern TAG_PATTERN = Pattern.compile("\\[[-_a-z0-9]+\\] ", Pattern.CASE_INSENSITIVE); - public static String readInputStream(InputStream in, String encoding) throws IOException { - InputStreamReader reader = new InputStreamReader(in, encoding); - StringBuffer sb = new StringBuffer(); - int count; - char[] buf = new char[512]; - while ((count = reader.read(buf)) != -1) { - sb.append(buf, 0, count); - } - return sb.toString(); - } - public static boolean arrayContains(Object[] a, Object o) { for (Object element : a) { if (element.equals(o)) { @@ -70,6 +57,8 @@ public class Utility { return null; } else if (parts.length == 0) { return ""; + } else if (parts.length == 1) { + return parts[0].toString(); } StringBuilder sb = new StringBuilder(); sb.append(parts[0]); @@ -597,4 +586,16 @@ public class Utility { } return false; } + + /** + * Unconditionally close a Cursor. Equivalent to {@link Cursor#close()}, + * if cursor is non-null. This is typically used in finally blocks. + * + * @param cursor cursor to close + */ + public static void closeQuietly(final Cursor cursor) { + if (cursor != null) { + cursor.close(); + } + } } diff --git a/src/com/fsck/k9/mail/Address.java b/src/com/fsck/k9/mail/Address.java index 1ebc5a046..50dd91a5d 100644 --- a/src/com/fsck/k9/mail/Address.java +++ b/src/com/fsck/k9/mail/Address.java @@ -12,6 +12,7 @@ import android.util.Log; import com.fsck.k9.K9; import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.Utility; +import com.fsck.k9.helper.StringUtils; import org.apache.james.mime4j.codec.EncoderUtil; import org.apache.james.mime4j.dom.address.Mailbox; import org.apache.james.mime4j.dom.address.MailboxList; @@ -60,7 +61,7 @@ public class Address { Rfc822Token token = tokens[0]; mAddress = token.getAddress(); String name = token.getName(); - if ((name != null) && !("".equals(name))) { + if (!StringUtils.isNullOrEmpty(name)) { /* * Don't use the "personal" argument if "address" is of the form: * James Bond @@ -111,11 +112,11 @@ public class Address { */ public static Address[] parseUnencoded(String addressList) { List
addresses = new ArrayList
(); - if ((addressList != null) && !("".equals(addressList))) { + if (!StringUtils.isNullOrEmpty(addressList)) { Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(addressList); for (Rfc822Token token : tokens) { String address = token.getAddress(); - if ((address != null) && !("".equals(address))) { + if (!StringUtils.isNullOrEmpty(address)) { addresses.add(new Address(token.getAddress(), token.getName(), false)); } } @@ -131,10 +132,10 @@ public class Address { * @return An array of 0 or more Addresses. */ public static Address[] parse(String addressList) { - ArrayList
addresses = new ArrayList
(); - if ((addressList == null) && !("".equals(addressList))) { + if (StringUtils.isNullOrEmpty(addressList)) { return EMPTY_ADDRESS_ARRAY; } + List
addresses = new ArrayList
(); try { MailboxList parsedList = AddressBuilder.parseAddressList(addressList).flatten(); for (int i = 0, count = parsedList.size(); i < count; i++) { @@ -149,6 +150,8 @@ public class Address { } } catch (MimeException pe) { Log.e(K9.LOG_TAG, "MimeException in Address.parse()", pe); + //but we do an silent failover : we just use the given string as name with empty address + addresses.add(new Address(null, addressList,false)); } return addresses.toArray(EMPTY_ADDRESS_ARRAY); } @@ -168,7 +171,7 @@ public class Address { @Override public String toString() { - if (mPersonal != null && !mPersonal.equals("")) { + if (!StringUtils.isNullOrEmpty(mPersonal)) { return Utility.quoteAtoms(mPersonal) + " <" + mAddress + ">"; } else { return mAddress; @@ -179,7 +182,7 @@ public class Address { if (addresses == null) { return null; } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < addresses.length; i++) { sb.append(addresses[i].toString()); if (i < addresses.length - 1) { @@ -190,7 +193,7 @@ public class Address { } public String toEncodedString() { - if (mPersonal != null && !mPersonal.equals("")) { + if (!StringUtils.isNullOrEmpty(mPersonal)) { return EncoderUtil.encodeAddressDisplayName(mPersonal) + " <" + mAddress + ">"; } else { return mAddress; @@ -201,7 +204,7 @@ public class Address { if (addresses == null) { return null; } - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < addresses.length; i++) { sb.append(addresses[i].toEncodedString()); if (i < addresses.length - 1) { @@ -256,7 +259,7 @@ public class Address { } } - return ((mPersonal != null) && (mPersonal.length() > 0)) ? mPersonal : mAddress; + return (!StringUtils.isNullOrEmpty(mPersonal)) ? mPersonal : mAddress; } public static CharSequence toFriendly(Address[] addresses) { diff --git a/src/com/fsck/k9/mail/Message.java b/src/com/fsck/k9/mail/Message.java index 2a8ee2c57..1afa5ba91 100644 --- a/src/com/fsck/k9/mail/Message.java +++ b/src/com/fsck/k9/mail/Message.java @@ -217,9 +217,9 @@ public abstract class Message implements Part, Body { eolOut.flush(); return out.getCount(); } catch (IOException e) { - Log.e(K9.LOG_TAG, "Failed to calculate a message size: " + e); + Log.e(K9.LOG_TAG, "Failed to calculate a message size", e); } catch (MessagingException e) { - Log.e(K9.LOG_TAG, "Failed to calculate a message size: " + e); + Log.e(K9.LOG_TAG, "Failed to calculate a message size", e); } return 0; } diff --git a/src/com/fsck/k9/mail/filter/PeekableInputStream.java b/src/com/fsck/k9/mail/filter/PeekableInputStream.java index a6e4868d7..0175bc4de 100644 --- a/src/com/fsck/k9/mail/filter/PeekableInputStream.java +++ b/src/com/fsck/k9/mail/filter/PeekableInputStream.java @@ -41,7 +41,7 @@ public class PeekableInputStream extends InputStream { if (!mPeeked) { return mIn.read(b, offset, length); } else { - b[0] = (byte)mPeekedByte; + b[offset] = (byte)mPeekedByte; mPeeked = false; int r = mIn.read(b, offset + 1, length - 1); if (r == -1) { diff --git a/src/com/fsck/k9/mail/internet/DecoderUtil.java b/src/com/fsck/k9/mail/internet/DecoderUtil.java index 6580199e9..137ba5e7e 100644 --- a/src/com/fsck/k9/mail/internet/DecoderUtil.java +++ b/src/com/fsck/k9/mail/internet/DecoderUtil.java @@ -58,7 +58,7 @@ public class DecoderUtil { /* * Replace _ with =20 */ - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < encodedWord.length(); i++) { char c = encodedWord.charAt(i); if (c == '_') { diff --git a/src/com/fsck/k9/mail/internet/MimeHeader.java b/src/com/fsck/k9/mail/internet/MimeHeader.java index c6b8510c8..f79edd7dc 100644 --- a/src/com/fsck/k9/mail/internet/MimeHeader.java +++ b/src/com/fsck/k9/mail/internet/MimeHeader.java @@ -78,7 +78,7 @@ public class MimeHeader { values.add(field.value); } } - if (values.size() == 0) { + if (values.isEmpty()) { return null; } return values.toArray(EMPTY_STRING_ARRAY); diff --git a/src/com/fsck/k9/mail/internet/MimeMessage.java b/src/com/fsck/k9/mail/internet/MimeMessage.java index d61ed86bc..92f7b5b4e 100644 --- a/src/com/fsck/k9/mail/internet/MimeMessage.java +++ b/src/com/fsck/k9/mail/internet/MimeMessage.java @@ -131,7 +131,7 @@ public class MimeMessage extends Message { @Override public String getContentType() throws MessagingException { String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE); - return (contentType == null) ? "text/plain" : contentType.toLowerCase(); + return (contentType == null) ? "text/plain" : contentType.toLowerCase(Locale.US); } public String getDisposition() throws MessagingException { @@ -422,7 +422,7 @@ public class MimeMessage extends Message { } class MimeMessageBuilder implements ContentHandler { - private Stack stack = new Stack(); + private final LinkedList stack = new LinkedList(); public MimeMessageBuilder() { } @@ -436,13 +436,13 @@ public class MimeMessage extends Message { public void startMessage() { if (stack.isEmpty()) { - stack.push(MimeMessage.this); + stack.addFirst(MimeMessage.this); } else { expect(Part.class); try { MimeMessage m = new MimeMessage(); ((Part)stack.peek()).setBody(m); - stack.push(m); + stack.addFirst(m); } catch (MessagingException me) { throw new Error(me); } @@ -451,7 +451,7 @@ public class MimeMessage extends Message { public void endMessage() { expect(MimeMessage.class); - stack.pop(); + stack.removeFirst(); } public void startHeader() { @@ -491,7 +491,7 @@ public class MimeMessage extends Message { try { MimeMultipart multiPart = new MimeMultipart(e.getContentType()); e.setBody(multiPart); - stack.push(multiPart); + stack.addFirst(multiPart); } catch (MessagingException me) { throw new Error(me); } @@ -508,7 +508,7 @@ public class MimeMessage extends Message { } public void endMultipart() { - stack.pop(); + stack.removeFirst(); } public void startBodyPart() { @@ -517,7 +517,7 @@ public class MimeMessage extends Message { try { MimeBodyPart bodyPart = new MimeBodyPart(); ((MimeMultipart)stack.peek()).addBodyPart(bodyPart); - stack.push(bodyPart); + stack.addFirst(bodyPart); } catch (MessagingException me) { throw new Error(me); } @@ -525,12 +525,12 @@ public class MimeMessage extends Message { public void endBodyPart() { expect(BodyPart.class); - stack.pop(); + stack.removeFirst(); } public void epilogue(InputStream is) throws IOException { expect(MimeMultipart.class); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int b; while ((b = is.read()) != -1) { sb.append((char)b); @@ -540,7 +540,7 @@ public class MimeMessage extends Message { public void preamble(InputStream is) throws IOException { expect(MimeMultipart.class); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int b; while ((b = is.read()) != -1) { sb.append((char)b); diff --git a/src/com/fsck/k9/mail/internet/MimeMultipart.java b/src/com/fsck/k9/mail/internet/MimeMultipart.java index 7ee7be0da..abcd6b510 100644 --- a/src/com/fsck/k9/mail/internet/MimeMultipart.java +++ b/src/com/fsck/k9/mail/internet/MimeMultipart.java @@ -6,6 +6,8 @@ import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.Multipart; import java.io.*; +import java.util.Locale; +import java.util.Random; public class MimeMultipart extends Multipart { protected String mPreamble; @@ -37,12 +39,13 @@ public class MimeMultipart extends Multipart { } public String generateBoundary() { - StringBuffer sb = new StringBuffer(); + Random random = new Random(); + StringBuilder sb = new StringBuilder(); sb.append("----"); for (int i = 0; i < 30; i++) { - sb.append(Integer.toString((int)(Math.random() * 35), 36)); + sb.append(Integer.toString(random.nextInt(36), 36)); } - return sb.toString().toUpperCase(); + return sb.toString().toUpperCase(Locale.US); } public String getPreamble() { @@ -70,7 +73,7 @@ public class MimeMultipart extends Multipart { writer.write(mPreamble + "\r\n"); } - if (mParts.size() == 0) { + if (mParts.isEmpty()) { writer.write("--" + mBoundary + "\r\n"); } diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 1ab056482..2922a8bd7 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; +import java.util.Locale; import java.util.regex.Pattern; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; @@ -940,7 +941,7 @@ public class MimeUtility { return parts[0]; } for (String part : parts) { - if (part.trim().toLowerCase().startsWith(name.toLowerCase())) { + if (part.trim().toLowerCase(Locale.US).startsWith(name.toLowerCase(Locale.US))) { String parameter = part.split("=", 2)[1].trim(); if (parameter.startsWith("\"") && parameter.endsWith("\"")) { return parameter.substring(1, parameter.length() - 1); @@ -980,7 +981,7 @@ public class MimeUtility { } } } - String[] header = part.getHeader("Content-ID"); + String[] header = part.getHeader(MimeHeader.HEADER_CONTENT_ID); if (header != null) { for (String s : header) { if (s.equals(contentId)) { @@ -1184,7 +1185,7 @@ public class MimeUtility { String extension = null; if (filename != null && filename.lastIndexOf('.') != -1) { - extension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(); + extension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(Locale.US); returnedType = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); } // If the MIME type set by the user's mailer is application/octet-stream, try to figure @@ -1263,7 +1264,7 @@ public class MimeUtility { if (charset == null || "0".equals(charset)) charset = "US-ASCII"; // No encoding, so use us-ascii, which is the standard. - charset = charset.toLowerCase(); + charset = charset.toLowerCase(Locale.US); if (charset.equals("cp932")) charset = "shift_jis"; else if (charset.equals("koi8-u")) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index f71951ddf..48c7a7d5f 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -205,7 +205,7 @@ public class ImapResponseParser { ch == '[' || ch == ']' || // docs claim that flags are \ atom but atom isn't supposed to // contain - // * and some falgs contain * + // * and some flags contain * // ch == '%' || ch == '*' || // ch == '%' || // TODO probably should not allow \ and should recognize @@ -281,7 +281,7 @@ public class ImapResponseParser { private String parseQuoted() throws IOException { expect('"'); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int ch; boolean escape = false; while ((ch = mIn.read()) != -1) { @@ -299,7 +299,7 @@ public class ImapResponseParser { } private String readStringUntil(char end) throws IOException { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); int ch; while ((ch = mIn.read()) != -1) { if (ch == end) { @@ -324,7 +324,7 @@ public class ImapResponseParser { * Represents an IMAP list response and is also the base class for the * ImapResponse. */ - public class ImapList extends ArrayList { + public static class ImapList extends ArrayList { private static final long serialVersionUID = -4067248341419617583L; public ImapList getList(int index) { @@ -339,10 +339,6 @@ public class ImapResponseParser { return (String)get(index); } - public InputStream getLiteral(int index) { - return (InputStream)get(index); - } - public int getNumber(int index) { return Integer.parseInt(getString(index)); } @@ -384,10 +380,6 @@ public class ImapResponseParser { return (String)getKeyedValue(key); } - public InputStream getKeyedLiteral(Object key) { - return (InputStream)getKeyedValue(key); - } - public int getKeyedNumber(Object key) { return Integer.parseInt(getKeyedString(key)); } @@ -471,7 +463,7 @@ public class ImapResponseParser { public String getAlertText() { if (size() > 1 && equalsIgnoreCase("[ALERT]", get(1))) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 2, count = size(); i < count; i++) { sb.append(get(i).toString()); sb.append(' '); diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 1ee09fc75..f3dbdf9cf 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -90,6 +90,7 @@ import com.jcraft.jzlib.JZlib; import com.jcraft.jzlib.ZOutputStream; import java.util.zip.Inflater; import java.util.zip.InflaterInputStream; +import org.apache.commons.io.IOUtils; /** *
@@ -370,7 +371,7 @@ public class ImapStore extends Store {
         LinkedList folders = new LinkedList();
 
         List responses =
-            connection.executeSimpleCommand(String.format(commandResponse + " \"\" %s",
+            connection.executeSimpleCommand(String.format("%s \"\" %s", commandResponse,
                                             encodeString(getCombinedPrefix() + "*")));
 
         for (ImapResponse response : responses) {
@@ -638,7 +639,7 @@ public class ImapStore extends Store {
             // 2 OK [READ-WRITE] Select completed.
             try {
                 msgSeqUidMap.clear();
-                String command = String.format((mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE") + " %s",
+                String command = String.format("%s %s", mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE",
                                                encodeString(encodeFolderName(getPrefixedName())));
 
                 List responses = executeSimpleCommand(command);
@@ -655,7 +656,7 @@ public class ImapStore extends Store {
                         if (bracketedObj instanceof ImapList) {
                             ImapList bracketed = (ImapList)bracketedObj;
 
-                            if (bracketed.size() > 0) {
+                            if (!bracketed.isEmpty()) {
                                 Object keyObj = bracketed.get(0);
                                 if (keyObj instanceof String) {
                                     String key = (String)keyObj;
@@ -895,7 +896,7 @@ public class ImapStore extends Store {
                 int count = 0;
                 int start = 1;
 
-                List responses = executeSimpleCommand(String.format("SEARCH %d:* " + criteria, start));
+                List responses = executeSimpleCommand(String.format("SEARCH %d:* %s", start, criteria));
                 for (ImapResponse response : responses) {
                     if (ImapResponseParser.equalsIgnoreCase(response.get(0), "SEARCH")) {
                         count += response.size() - 1;
@@ -972,7 +973,7 @@ public class ImapStore extends Store {
 
             ImapSearcher searcher = new ImapSearcher() {
                 public List search() throws IOException, MessagingException {
-                    return executeSimpleCommand(String.format("UID SEARCH %d:%d%s" + (includeDeleted ? "" : " NOT DELETED"), start, end, dateSearchString));
+                    return executeSimpleCommand(String.format("UID SEARCH %d:%d%s%s", start, end, dateSearchString, includeDeleted ? "" : " NOT DELETED"));
                 }
             };
             return search(searcher, listener);
@@ -982,7 +983,7 @@ public class ImapStore extends Store {
         throws MessagingException {
             ImapSearcher searcher = new ImapSearcher() {
                 public List search() throws IOException, MessagingException {
-                    return executeSimpleCommand(String.format("UID SEARCH %s" + (includeDeleted ? "" : " NOT DELETED"), Utility.combine(mesgSeqs.toArray(), ',')));
+                    return executeSimpleCommand(String.format("UID SEARCH %s%s", Utility.combine(mesgSeqs.toArray(), ','), includeDeleted ? "" : " NOT DELETED"));
                 }
             };
             return search(searcher, listener);
@@ -992,7 +993,7 @@ public class ImapStore extends Store {
         throws MessagingException {
             ImapSearcher searcher = new ImapSearcher() {
                 public List search() throws IOException, MessagingException {
-                    return executeSimpleCommand(String.format("UID SEARCH UID %s" + (includeDeleted ? "" : " NOT DELETED"), Utility.combine(mesgUids.toArray(), ',')));
+                    return executeSimpleCommand(String.format("UID SEARCH UID %s%s", Utility.combine(mesgUids.toArray(), ','), includeDeleted ? "" : " NOT DELETED"));
                 }
             };
             return search(searcher, listener);
@@ -1409,7 +1410,7 @@ public class ImapStore extends Store {
 //                {
 //                    ImapList bracketed = (ImapList)bracketedObj;
 //
-//                    if (bracketed.size() > 0)
+//                    if (!bracketed.isEmpty())
 //                    {
 //                        Object keyObj = bracketed.get(0);
 //                        if (keyObj instanceof String)
@@ -1417,7 +1418,7 @@ public class ImapStore extends Store {
 //                            String key = (String)keyObj;
 //                            if ("ALERT".equalsIgnoreCase(key))
 //                            {
-//                                StringBuffer sb = new StringBuffer();
+//                                StringBuilder sb = new StringBuilder();
 //                                for (int i = 2, count = response.size(); i < count; i++) {
 //                                    sb.append(response.get(i).toString());
 //                                    sb.append(' ');
@@ -1461,7 +1462,7 @@ public class ImapStore extends Store {
                          * what type it is and bail out.
                          */
                         String subType = bs.getString(i);
-                        mp.setSubType(subType.toLowerCase());
+                        mp.setSubType(subType.toLowerCase(Locale.US));
                         break;
                     }
                 }
@@ -1490,7 +1491,7 @@ public class ImapStore extends Store {
 
                 String type = bs.getString(0);
                 String subType = bs.getString(1);
-                String mimeType = (type + "/" + subType).toLowerCase();
+                String mimeType = (type + "/" + subType).toLowerCase(Locale.US);
 
                 ImapList bodyParams = null;
                 if (bs.get(2) instanceof ImapList) {
@@ -1514,7 +1515,8 @@ public class ImapStore extends Store {
                 /*
                  * Set the content type with as much information as we know right now.
                  */
-                String contentType = String.format("%s", mimeType);
+                StringBuilder contentType = new StringBuilder();
+                contentType.append(mimeType);
 
                 if (bodyParams != null) {
                     /*
@@ -1522,13 +1524,13 @@ public class ImapStore extends Store {
                      * of them.
                      */
                     for (int i = 0, count = bodyParams.size(); i < count; i += 2) {
-                        contentType += String.format(";\n %s=\"%s\"",
-                                                     bodyParams.getString(i),
-                                                     bodyParams.getString(i + 1));
+                        contentType.append(String.format(";\n %s=\"%s\"",
+                                           bodyParams.getString(i),
+                                           bodyParams.getString(i + 1)));
                     }
                 }
 
-                part.setHeader(MimeHeader.HEADER_CONTENT_TYPE, contentType);
+                part.setHeader(MimeHeader.HEADER_CONTENT_TYPE, contentType.toString());
 
                 // Extension items
                 ImapList bodyDisposition = null;
@@ -1542,11 +1544,11 @@ public class ImapStore extends Store {
                     bodyDisposition = bs.getList(8);
                 }
 
-                String contentDisposition = "";
+                StringBuilder contentDisposition = new StringBuilder();
 
-                if (bodyDisposition != null && bodyDisposition.size() > 0) {
+                if (bodyDisposition != null && !bodyDisposition.isEmpty()) {
                     if (!"NIL".equalsIgnoreCase(bodyDisposition.getString(0))) {
-                        contentDisposition = bodyDisposition.getString(0).toLowerCase();
+                        contentDisposition.append(bodyDisposition.getString(0).toLowerCase(Locale.US));
                     }
 
                     if ((bodyDisposition.size() > 1)
@@ -1557,22 +1559,22 @@ public class ImapStore extends Store {
                          * about the attachment out.
                          */
                         for (int i = 0, count = bodyDispositionParams.size(); i < count; i += 2) {
-                            contentDisposition += String.format(";\n %s=\"%s\"",
-                                                                bodyDispositionParams.getString(i).toLowerCase(),
-                                                                bodyDispositionParams.getString(i + 1));
+                            contentDisposition.append(String.format(";\n %s=\"%s\"",
+                                                      bodyDispositionParams.getString(i).toLowerCase(Locale.US),
+                                                      bodyDispositionParams.getString(i + 1)));
                         }
                     }
                 }
 
-                if (MimeUtility.getHeaderParameter(contentDisposition, "size") == null) {
-                    contentDisposition += String.format(";\n size=%d", size);
+                if (MimeUtility.getHeaderParameter(contentDisposition.toString(), "size") == null) {
+                    contentDisposition.append(String.format(";\n size=%d", size));
                 }
 
                 /*
                  * Set the content disposition containing at least the size. Attachment
                  * handling code will use this down the road.
                  */
-                part.setHeader(MimeHeader.HEADER_CONTENT_DISPOSITION, contentDisposition);
+                part.setHeader(MimeHeader.HEADER_CONTENT_DISPOSITION, contentDisposition.toString());
 
 
                 /*
@@ -1741,23 +1743,11 @@ public class ImapStore extends Store {
             for (int i = 0, count = messages.length; i < count; i++) {
                 uids[i] = messages[i].getUid();
             }
-            ArrayList flagNames = new ArrayList();
-            for (Flag flag : flags) {
-                if (flag == Flag.SEEN) {
-                    flagNames.add("\\Seen");
-                } else if (flag == Flag.DELETED) {
-                    flagNames.add("\\Deleted");
-                } else if (flag == Flag.ANSWERED) {
-                    flagNames.add("\\Answered");
-                } else if (flag == Flag.FLAGGED) {
-                    flagNames.add("\\Flagged");
-                }
-            }
             try {
                 executeSimpleCommand(String.format("UID STORE %s %sFLAGS.SILENT (%s)",
                                                    Utility.combine(uids, ','),
                                                    value ? "+" : "-",
-                                                   Utility.combine(flagNames.toArray(new String[flagNames.size()]), ' ')));
+                                                   combineFlags(flags)));
             } catch (IOException ioe) {
                 throw ioExceptionHandler(mConnection, ioe);
             }
@@ -1828,7 +1818,7 @@ public class ImapStore extends Store {
         private List receiveCapabilities(List responses) {
             for (ImapResponse response : responses) {
                 ImapList capabilityList = null;
-                if (response.size() > 0 && ImapResponseParser.equalsIgnoreCase(response.get(0), "OK")) {
+                if (!response.isEmpty() && ImapResponseParser.equalsIgnoreCase(response.get(0), "OK")) {
                     for (Object thisPart : response) {
                         if (thisPart instanceof ImapList) {
                             ImapList thisList = (ImapList)thisPart;
@@ -1843,7 +1833,7 @@ public class ImapStore extends Store {
                 }
 
                 if (capabilityList != null) {
-                    if (capabilityList.size() > 0 && ImapResponseParser.equalsIgnoreCase(capabilityList.get(0), CAPABILITY_CAPABILITY)) {
+                    if (!capabilityList.isEmpty() && ImapResponseParser.equalsIgnoreCase(capabilityList.get(0), CAPABILITY_CAPABILITY)) {
                         if (K9.DEBUG) {
                             Log.d(K9.LOG_TAG, "Saving " + capabilityList.size() + " capabilities for " + getLogId());
                         }
@@ -1853,7 +1843,7 @@ public class ImapStore extends Store {
 //                                {
 //                                    Log.v(K9.LOG_TAG, "Saving capability '" + capability + "' for " + getLogId());
 //                                }
-                                capabilities.add(((String)capability).toUpperCase());
+                                capabilities.add(((String)capability).toUpperCase(Locale.US));
                             }
                         }
 
@@ -2163,7 +2153,7 @@ public class ImapStore extends Store {
         }
 
         protected boolean hasCapability(String capability) {
-            return capabilities.contains(capability.toUpperCase());
+            return capabilities.contains(capability.toUpperCase(Locale.US));
         }
 
         public boolean isOpen() {
@@ -2178,21 +2168,9 @@ public class ImapStore extends Store {
 //
 //                }
 //            }
-            try {
-                mIn.close();
-            } catch (Exception e) {
-
-            }
-            try {
-                mOut.close();
-            } catch (Exception e) {
-
-            }
-            try {
-                mSocket.close();
-            } catch (Exception e) {
-
-            }
+            IOUtils.closeQuietly(mIn);
+            IOUtils.closeQuietly(mOut);
+            IOUtils.closeQuietly(mSocket);
             mIn = null;
             mOut = null;
             mSocket = null;
@@ -2506,13 +2484,13 @@ public class ImapStore extends Store {
                                     ImapMessage message = new ImapMessage("" + uid, ImapFolderPusher.this);
                                     messages.add(message);
                                 }
-                                if (messages.size() > 0) {
+                                if (!messages.isEmpty()) {
                                     pushMessages(messages, true);
                                 }
 
                             } else {
                                 List untaggedResponses = null;
-                                while (storedUntaggedResponses.size() > 0) {
+                                while (!storedUntaggedResponses.isEmpty()) {
                                     if (K9.DEBUG)
                                         Log.i(K9.LOG_TAG, "Processing " + storedUntaggedResponses.size() + " untagged responses from previous commands for " + getLogId());
                                     untaggedResponses = new ArrayList(storedUntaggedResponses);
@@ -2619,10 +2597,10 @@ public class ImapStore extends Store {
             if (K9.DEBUG)
                 Log.d(K9.LOG_TAG, "UIDs for messages needing flag sync are " + flagSyncMsgSeqs + "  for " + getLogId());
 
-            if (flagSyncMsgSeqs.size() > 0) {
+            if (!flagSyncMsgSeqs.isEmpty()) {
                 syncMessages(flagSyncMsgSeqs);
             }
-            if (removeMsgUids.size() > 0) {
+            if (!removeMsgUids.isEmpty()) {
                 removeMessages(removeMsgUids);
             }
         }
@@ -2660,7 +2638,7 @@ public class ImapStore extends Store {
                         ImapMessage message = new ImapMessage("" + uid, ImapFolderPusher.this);
                         messages.add(message);
                     }
-                    if (messages.size() > 0) {
+                    if (!messages.isEmpty()) {
                         pushMessages(messages, true);
                     }
                 }
@@ -2994,7 +2972,7 @@ public class ImapStore extends Store {
                 message.parse(literal);
 
                 // Return placeholder object
-                return new Integer(1);
+                return Integer.valueOf(1);
             }
             return null;
         }
diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java
index 4d35ef3c6..a402ea9f7 100644
--- a/src/com/fsck/k9/mail/store/LocalStore.java
+++ b/src/com/fsck/k9/mail/store/LocalStore.java
@@ -5,6 +5,7 @@ import java.io.*;
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -78,18 +79,21 @@ public class LocalStore extends Store implements Serializable {
 
     private static final Flag[] PERMANENT_FLAGS = { Flag.DELETED, Flag.X_DESTROYED, Flag.SEEN, Flag.FLAGGED };
 
-    private static Set HEADERS_TO_SAVE = new HashSet();
+    private static final Set HEADERS_TO_SAVE;
     static {
-        HEADERS_TO_SAVE.add(K9.IDENTITY_HEADER);
-        HEADERS_TO_SAVE.add("To");
-        HEADERS_TO_SAVE.add("Cc");
-        HEADERS_TO_SAVE.add("From");
-        HEADERS_TO_SAVE.add("In-Reply-To");
-        HEADERS_TO_SAVE.add("References");
-        HEADERS_TO_SAVE.add("Content-ID");
-        HEADERS_TO_SAVE.add("Content-Disposition");
-        HEADERS_TO_SAVE.add("User-Agent");
+        Set set = new HashSet();
+        set.add(K9.IDENTITY_HEADER);
+        set.add("To");
+        set.add("Cc");
+        set.add("From");
+        set.add("In-Reply-To");
+        set.add("References");
+        set.add(MimeHeader.HEADER_CONTENT_ID);
+        set.add(MimeHeader.HEADER_CONTENT_DISPOSITION);
+        set.add("User-Agent");
+        HEADERS_TO_SAVE = Collections.unmodifiableSet(set);
     }
+
     /*
      * a String containing the columns getMessages expects to work with
      * in the correct order.
@@ -295,19 +299,17 @@ public class LocalStore extends Store implements Serializable {
                                     String name = cursor.getString(1);
                                     update41Metadata(db, prefs, id, name);
                                 } catch (Exception e) {
-                                    Log.e(K9.LOG_TAG, " error trying to ugpgrade a folder class: " + e);
+                                    Log.e(K9.LOG_TAG, " error trying to ugpgrade a folder class", e);
                                 }
                             }
                         }
 
 
                         catch (SQLiteException e) {
-                            Log.e(K9.LOG_TAG, "Exception while upgrading database to v41. folder classes may have vanished " + e);
+                            Log.e(K9.LOG_TAG, "Exception while upgrading database to v41. folder classes may have vanished", e);
 
                         } finally {
-                            if (cursor != null) {
-                                cursor.close();
-                            }
+                            Utility.closeQuietly(cursor);
                         }
                     }
                     if (db.getVersion() == 41) {
@@ -416,7 +418,7 @@ public class LocalStore extends Store implements Serializable {
                 inTopGroup = prefs.getBoolean(uUid + "." + name + ".inTopGroup", inTopGroup);
                 integrate = prefs.getBoolean(uUid + "." + name + ".integrate", integrate);
             } catch (Exception e) {
-                Log.e(K9.LOG_TAG, " Throwing away an error while trying to upgrade folder metadata: " + e);
+                Log.e(K9.LOG_TAG, " Throwing away an error while trying to upgrade folder metadata", e);
             }
 
             if (displayClass == Folder.FolderClass.NONE) {
@@ -520,9 +522,7 @@ public class LocalStore extends Store implements Serializable {
                     cursor.moveToFirst();
                     return cursor.getInt(0);   // message count
                 } finally {
-                    if (cursor != null) {
-                        cursor.close();
-                    }
+                    Utility.closeQuietly(cursor);
                 }
             }
         });
@@ -596,9 +596,7 @@ public class LocalStore extends Store implements Serializable {
                     stats.flaggedMessageCount = cursor.getInt(1);
                     return null;
                 } finally {
-                    if (cursor != null) {
-                        cursor.close();
-                    }
+                    Utility.closeQuietly(cursor);
                 }
             }
         });
@@ -615,9 +613,7 @@ public class LocalStore extends Store implements Serializable {
                     cursor.moveToFirst();
                     return cursor.getInt(0);        // folder count
                 } finally {
-                    if (cursor != null) {
-                        cursor.close();
-                    }
+                    Utility.closeQuietly(cursor);
                 }
             }
         });
@@ -650,9 +646,7 @@ public class LocalStore extends Store implements Serializable {
                     } catch (MessagingException e) {
                         throw new WrappedException(e);
                     } finally {
-                        if (cursor != null) {
-                            cursor.close();
-                        }
+                        Utility.closeQuietly(cursor);
                     }
                 }
             });
@@ -719,9 +713,7 @@ public class LocalStore extends Store implements Serializable {
                                     }
                                 }
                             } finally {
-                                if (cursor != null) {
-                                    cursor.close();
-                                }
+                                Utility.closeQuietly(cursor);
                             }
                         }
                         if (!force) {
@@ -789,9 +781,7 @@ public class LocalStore extends Store implements Serializable {
                     }
                     return commands;
                 } finally {
-                    if (cursor != null) {
-                        cursor.close();
-                    }
+                    Utility.closeQuietly(cursor);
                 }
             }
         });
@@ -844,7 +834,7 @@ public class LocalStore extends Store implements Serializable {
 
         @Override
         public String toString() {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append(command);
             sb.append(": ");
             for (String argument : arguments) {
@@ -888,7 +878,7 @@ public class LocalStore extends Store implements Serializable {
 
             whereClause.append(" )");
         }
-        if (folders != null && folders.size() > 0) {
+        if (folders != null && !folders.isEmpty()) {
             whereClause.append(" AND folder_id in (");
             boolean anyAdded = false;
             for (LocalFolder folder : folders) {
@@ -999,11 +989,9 @@ public class LocalStore extends Store implements Serializable {
                         i++;
                     }
                 } catch (Exception e) {
-                    Log.d(K9.LOG_TAG, "Got an exception " + e);
+                    Log.d(K9.LOG_TAG, "Got an exception", e);
                 } finally {
-                    if (cursor != null) {
-                        cursor.close();
-                    }
+                    Utility.closeQuietly(cursor);
                 }
                 return i;
             }
@@ -1045,9 +1033,7 @@ public class LocalStore extends Store implements Serializable {
                     attachmentInfo.type = type;
                     return attachmentInfo;
                 } finally {
-                    if (cursor != null) {
-                        cursor.close();
-                    }
+                    Utility.closeQuietly(cursor);
                 }
             }
         });
@@ -1181,9 +1167,7 @@ public class LocalStore extends Store implements Serializable {
                         } catch (MessagingException e) {
                             throw new WrappedException(e);
                         } finally {
-                            if (cursor != null) {
-                                cursor.close();
-                            }
+                            Utility.closeQuietly(cursor);
                         }
                         return null;
                     }
@@ -1247,9 +1231,7 @@ public class LocalStore extends Store implements Serializable {
                             return false;
                         }
                     } finally {
-                        if (cursor != null) {
-                            cursor.close();
-                        }
+                        Utility.closeQuietly(cursor);
                     }
                 }
             });
@@ -1305,9 +1287,7 @@ public class LocalStore extends Store implements Serializable {
                             cursor.moveToFirst();
                             return cursor.getInt(0);   //messagecount
                         } finally {
-                            if (cursor != null) {
-                                cursor.close();
-                            }
+                            Utility.closeQuietly(cursor);
                         }
                     }
                 });
@@ -1597,10 +1577,10 @@ public class LocalStore extends Store implements Serializable {
                                         String htmlContent = cursor.getString(0);
                                         String textContent = cursor.getString(1);
                                         String mimeType = cursor.getString(2);
-                                        if (mimeType != null && mimeType.toLowerCase().startsWith("multipart/")) {
+                                        if (mimeType != null && mimeType.toLowerCase(Locale.US).startsWith("multipart/")) {
                                             // If this is a multipart message, preserve both text
                                             // and html parts, as well as the subtype.
-                                            mp.setSubType(mimeType.toLowerCase().replaceFirst("^multipart/", ""));
+                                            mp.setSubType(mimeType.toLowerCase(Locale.US).replaceFirst("^multipart/", ""));
                                             if (textContent != null) {
                                                 LocalTextBody body = new LocalTextBody(textContent, htmlContent);
                                                 MimeBodyPart bp = new MimeBodyPart(body, "text/plain");
@@ -1658,9 +1638,7 @@ public class LocalStore extends Store implements Serializable {
                                     } catch (Exception e) {
                                         Log.e(K9.LOG_TAG, "Exception fetching message:", e);
                                     } finally {
-                                        if (cursor != null) {
-                                            cursor.close();
-                                        }
+                                        Utility.closeQuietly(cursor);
                                     }
 
                                     try {
@@ -1725,9 +1703,7 @@ public class LocalStore extends Store implements Serializable {
                                             mp.addBodyPart(bp);
                                         }
                                     } finally {
-                                        if (cursor != null) {
-                                            cursor.close();
-                                        }
+                                        Utility.closeQuietly(cursor);
                                     }
 
                                     if (mp.getCount() == 0) {
@@ -1782,13 +1758,13 @@ public class LocalStore extends Store implements Serializable {
                 @Override
                 public Void doDbWork(final SQLiteDatabase db) throws WrappedException, UnavailableStorageException {
                     Cursor cursor = null;
-                    if (messages.size() == 0) {
+                    if (messages.isEmpty()) {
                         return null;
                     }
                     try {
                         Map popMessages = new HashMap();
                         List ids = new ArrayList();
-                        StringBuffer questions = new StringBuffer();
+                        StringBuilder questions = new StringBuilder();
 
                         for (int i = 0; i < messages.size(); i++) {
                             if (i != 0) {
@@ -1815,9 +1791,7 @@ public class LocalStore extends Store implements Serializable {
                             popMessages.get(id).addHeader(name, value);
                         }
                     } finally {
-                        if (cursor != null) {
-                            cursor.close();
-                        }
+                        Utility.closeQuietly(cursor);
                     }
                     return null;
                 }
@@ -1848,9 +1822,7 @@ public class LocalStore extends Store implements Serializable {
                                 }
                                 message.populateFromGetMessageCursor(cursor);
                             } finally {
-                                if (cursor != null) {
-                                    cursor.close();
-                                }
+                                Utility.closeQuietly(cursor);
                             }
                             return message;
                         } catch (MessagingException e) {
@@ -2097,15 +2069,15 @@ public class LocalStore extends Store implements Serializable {
                                 ArrayList attachments = new ArrayList();
                                 MimeUtility.collectParts(message, viewables, attachments);
 
-                                StringBuffer sbHtml = new StringBuffer();
-                                StringBuffer sbText = new StringBuffer();
+                                StringBuilder sbHtml = new StringBuilder();
+                                StringBuilder sbText = new StringBuilder();
                                 for (Part viewable : viewables) {
                                     try {
                                         String text = MimeUtility.getTextFromPart(viewable);
 
                                         /*
                                          * Small hack to make sure the string "null" doesn't end up
-                                         * in one of the StringBuffers.
+                                         * in one of the StringBuilders.
                                          */
                                         if (text == null) {
                                             text = "";
@@ -2140,7 +2112,7 @@ public class LocalStore extends Store implements Serializable {
                                     cv.put("sender_list", Address.pack(message.getFrom()));
                                     cv.put("date", message.getSentDate() == null
                                            ? System.currentTimeMillis() : message.getSentDate().getTime());
-                                    cv.put("flags", Utility.combine(message.getFlags(), ',').toUpperCase());
+                                    cv.put("flags", Utility.combine(message.getFlags(), ',').toUpperCase(Locale.US));
                                     cv.put("deleted", message.isSet(Flag.DELETED) ? 1 : 0);
                                     cv.put("folder_id", mFolderId);
                                     cv.put("to_list", Address.pack(message.getRecipients(RecipientType.TO)));
@@ -2210,8 +2182,8 @@ public class LocalStore extends Store implements Serializable {
 
                             MimeUtility.collectParts(message, viewables, attachments);
 
-                            StringBuffer sbHtml = new StringBuffer();
-                            StringBuffer sbText = new StringBuffer();
+                            StringBuilder sbHtml = new StringBuilder();
+                            StringBuilder sbText = new StringBuilder();
                             for (int i = 0, count = viewables.size(); i < count; i++) {
                                 Part viewable = viewables.get(i);
                                 try {
@@ -2219,7 +2191,7 @@ public class LocalStore extends Store implements Serializable {
 
                                     /*
                                      * Small hack to make sure the string "null" doesn't end up
-                                     * in one of the StringBuffers.
+                                     * in one of the StringBuilders.
                                      */
                                     if (text == null) {
                                         text = "";
@@ -2259,7 +2231,7 @@ public class LocalStore extends Store implements Serializable {
                                                message.getSentDate() == null ? System
                                                .currentTimeMillis() : message.getSentDate()
                                                .getTime(),
-                                               Utility.combine(message.getFlags(), ',').toUpperCase(),
+                                               Utility.combine(message.getFlags(), ',').toUpperCase(Locale.US),
                                                mFolderId,
                                                Address.pack(message
                                                             .getRecipients(RecipientType.TO)),
@@ -2333,7 +2305,7 @@ public class LocalStore extends Store implements Serializable {
 
                         db.execSQL("UPDATE messages " + "SET flags = ? " + " WHERE id = ?",
                                    new Object[]
-                                   { Utility.combine(appendedFlags.toArray(), ',').toUpperCase(), id });
+                                   { Utility.combine(appendedFlags.toArray(), ',').toUpperCase(Locale.US), id });
                     }
                     return null;
                 }
@@ -2402,7 +2374,9 @@ public class LocalStore extends Store implements Serializable {
                                 if (disposition != null) {
                                     String s = MimeUtility.getHeaderParameter(disposition, "size");
                                     if (s != null) {
-                                        size = Integer.parseInt(s);
+                                        try {
+                                            size = Integer.parseInt(s);
+                                        } catch (NumberFormatException e) { /* Ignore */ }
                                     }
                                 }
                             }
@@ -2485,9 +2459,7 @@ public class LocalStore extends Store implements Serializable {
                                         }
                                     }
                                 } finally {
-                                    if (cursor != null) {
-                                        cursor.close();
-                                    }
+                                    Utility.closeQuietly(cursor);
                                 }
                             }
 
@@ -2691,9 +2663,7 @@ public class LocalStore extends Store implements Serializable {
                             }
                         }
                     } finally {
-                        if (attachmentsCursor != null) {
-                            attachmentsCursor.close();
-                        }
+                        Utility.closeQuietly(attachmentsCursor);
                     }
                     return null;
                 }
@@ -2719,9 +2689,7 @@ public class LocalStore extends Store implements Serializable {
                         } catch (MessagingException e) {
                             throw new WrappedException(e);
                         } finally {
-                            if (messagesCursor != null) {
-                                messagesCursor.close();
-                            }
+                            Utility.closeQuietly(messagesCursor);
                         }
                         return null;
                     }
@@ -2834,9 +2802,7 @@ public class LocalStore extends Store implements Serializable {
                     } catch (Exception e) {
                         Log.e(K9.LOG_TAG, "Unable to updateLastUid: ", e);
                     } finally {
-                        if (cursor != null) {
-                            cursor.close();
-                        }
+                        Utility.closeQuietly(cursor);
                     }
                     return null;
                 }
@@ -2861,9 +2827,7 @@ public class LocalStore extends Store implements Serializable {
                     } catch (Exception e) {
                         Log.e(K9.LOG_TAG, "Unable to fetch oldest message date: ", e);
                     } finally {
-                        if (cursor != null) {
-                            cursor.close();
-                        }
+                        Utility.closeQuietly(cursor);
                     }
                     return null;
                 }
@@ -3183,7 +3147,7 @@ public class LocalStore extends Store implements Serializable {
                          * Set the flags on the message.
                          */
                         db.execSQL("UPDATE messages " + "SET flags = ? " + " WHERE id = ?", new Object[]
-                                   { Utility.combine(getFlags(), ',').toUpperCase(), mId });
+                                   { Utility.combine(getFlags(), ',').toUpperCase(Locale.US), mId });
                         return null;
                     }
                 });
diff --git a/src/com/fsck/k9/mail/store/LockableDatabase.java b/src/com/fsck/k9/mail/store/LockableDatabase.java
index 4662dc708..e39d56211 100644
--- a/src/com/fsck/k9/mail/store/LockableDatabase.java
+++ b/src/com/fsck/k9/mail/store/LockableDatabase.java
@@ -399,7 +399,7 @@ public class LockableDatabase {
         databaseFile = storageManager.getDatabase(uUid, providerId);
         databaseParentDir = databaseFile.getParentFile();
         if (databaseParentDir.isFile()) {
-            // should be safe to inconditionally delete clashing file: user is not supposed to mess with our directory
+            // should be safe to unconditionally delete clashing file: user is not supposed to mess with our directory
             databaseParentDir.delete();
         }
         if (!databaseParentDir.exists()) {
diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java
index e0ffa4bd9..0ce234fc0 100644
--- a/src/com/fsck/k9/mail/store/Pop3Store.java
+++ b/src/com/fsck/k9/mail/store/Pop3Store.java
@@ -506,7 +506,7 @@ public class Pop3Store extends Store {
                     unindexedUids.add(uid);
                 }
             }
-            if (unindexedUids.size() == 0) {
+            if (unindexedUids.isEmpty()) {
                 return;
             }
             /*
@@ -740,8 +740,8 @@ public class Pop3Store extends Store {
             }
 
             if (response == null) {
-                response = executeSimpleCommand(String.format(RETR_COMMAND + " %d",
-                                                mUidToMsgNumMap.get(message.getUid())));
+                executeSimpleCommand(String.format(RETR_COMMAND + " %d",
+                                     mUidToMsgNumMap.get(message.getUid())));
             }
 
             try {
@@ -825,7 +825,7 @@ public class Pop3Store extends Store {
         }
 
         private String readLine() throws IOException {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             int d = mIn.read();
             if (d == -1) {
                 throw new IOException("End of stream reached while trying to read line.");
@@ -981,7 +981,7 @@ public class Pop3Store extends Store {
             //   }
 //         catch (MessagingException me)
 //         {
-//          Log.w(K9.LOG_TAG, "Could not delete non-existant message", me);
+//          Log.w(K9.LOG_TAG, "Could not delete non-existent message", me);
 //         }
         }
     }
diff --git a/src/com/fsck/k9/mail/store/TrustManagerFactory.java b/src/com/fsck/k9/mail/store/TrustManagerFactory.java
index b6ead8d9d..f6a907080 100644
--- a/src/com/fsck/k9/mail/store/TrustManagerFactory.java
+++ b/src/com/fsck/k9/mail/store/TrustManagerFactory.java
@@ -6,6 +6,7 @@ import android.content.Context;
 import android.util.Log;
 import com.fsck.k9.K9;
 import com.fsck.k9.helper.DomainNameChecker;
+import org.apache.commons.io.IOUtils;
 
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
@@ -76,6 +77,8 @@ public final class TrustManagerFactory {
 
         public void checkServerTrusted(X509Certificate[] chain, String authType)
         throws CertificateException {
+            // FIXME: Using a static field to store the certificate chain is a bad idea. Instead
+            // create a CertificateException subclass and store the chain there.
             TrustManagerFactory.setLastCertChain(chain);
             try {
                 defaultTrustManager.checkServerTrusted(chain, authType);
@@ -103,12 +106,12 @@ public final class TrustManagerFactory {
     }
 
     static {
+        java.io.InputStream fis = null;
         try {
             javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance("X509");
             Application app = K9.app;
             keyStoreFile = new File(app.getDir("KeyStore", Context.MODE_PRIVATE) + File.separator + "KeyStore.bks");
             keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
-            java.io.FileInputStream fis;
             try {
                 fis = new java.io.FileInputStream(keyStoreFile);
             } catch (FileNotFoundException e1) {
@@ -116,9 +119,6 @@ public final class TrustManagerFactory {
             }
             try {
                 keyStore.load(fis, "".toCharArray());
-                //if (fis != null) {
-                // fis.close();
-                //}
             } catch (IOException e) {
                 Log.e(LOG_TAG, "KeyStore IOException while initializing TrustManagerFactory ", e);
                 keyStore = null;
@@ -152,6 +152,8 @@ public final class TrustManagerFactory {
             Log.e(LOG_TAG, "Unable to get X509 Trust Manager ", e);
         } catch (KeyStoreException e) {
             Log.e(LOG_TAG, "Key Store exception while initializing TrustManagerFactory ", e);
+        } finally {
+            IOUtils.closeQuietly(fis);
         }
         unsecureTrustManager = new SimpleX509TrustManager();
     }
@@ -193,17 +195,18 @@ public final class TrustManagerFactory {
                     }
                 }
             }
-            java.io.FileOutputStream keyStoreStream;
+            java.io.OutputStream keyStoreStream = null;
             try {
                 keyStoreStream = new java.io.FileOutputStream(keyStoreFile);
                 keyStore.store(keyStoreStream, "".toCharArray());
-                keyStoreStream.close();
             } catch (FileNotFoundException e) {
                 throw new CertificateException("Unable to write KeyStore: " + e.getMessage());
             } catch (CertificateException e) {
                 throw new CertificateException("Unable to write KeyStore: " + e.getMessage());
             } catch (IOException e) {
                 throw new CertificateException("Unable to write KeyStore: " + e.getMessage());
+            } finally {
+                IOUtils.closeQuietly(keyStoreStream);
             }
 
         } catch (NoSuchAlgorithmException e) {
diff --git a/src/com/fsck/k9/mail/store/WebDavStore.java b/src/com/fsck/k9/mail/store/WebDavStore.java
index 67c909e8d..8acc2ed02 100644
--- a/src/com/fsck/k9/mail/store/WebDavStore.java
+++ b/src/com/fsck/k9/mail/store/WebDavStore.java
@@ -11,6 +11,7 @@ import com.fsck.k9.mail.Folder.OpenMode;
 import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
 import com.fsck.k9.mail.internet.MimeMessage;
 import com.fsck.k9.mail.transport.TrustedSocketFactory;
+import org.apache.commons.io.IOUtils;
 import org.apache.http.*;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
@@ -45,13 +46,7 @@ import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Stack;
+import java.util.*;
 import java.util.zip.GZIPInputStream;
 
 /**
@@ -398,7 +393,7 @@ public class WebDavStore extends Store {
     }
 
     private String getSpecialFoldersList() {
-        StringBuffer buffer = new StringBuffer(200);
+        StringBuilder buffer = new StringBuilder(200);
         buffer.append("");
         buffer.append("");
         buffer.append("");
@@ -421,7 +416,7 @@ public class WebDavStore extends Store {
      * WebDAV XML Request body retrieval functions
      */
     private String getFolderListXml() {
-        StringBuffer buffer = new StringBuffer(200);
+        StringBuilder buffer = new StringBuilder(200);
         buffer.append("");
         buffer.append("\r\n");
         buffer.append("SELECT \"DAV:uid\", \"DAV:ishidden\"\r\n");
@@ -432,7 +427,7 @@ public class WebDavStore extends Store {
     }
 
     private String getMessageCountXml(String messageState) {
-        StringBuffer buffer = new StringBuffer(200);
+        StringBuilder buffer = new StringBuilder(200);
         buffer.append("");
         buffer.append("\r\n");
         buffer.append("SELECT \"DAV:visiblecount\"\r\n");
@@ -445,7 +440,7 @@ public class WebDavStore extends Store {
     }
 
     private String getMessageEnvelopeXml(String[] uids) {
-        StringBuffer buffer = new StringBuffer(200);
+        StringBuilder buffer = new StringBuilder(200);
         buffer.append("");
         buffer.append("\r\n");
         buffer.append("SELECT \"DAV:uid\", \"DAV:getcontentlength\",");
@@ -475,7 +470,7 @@ public class WebDavStore extends Store {
     }
 
     private String getMessagesXml() {
-        StringBuffer buffer = new StringBuffer(200);
+        StringBuilder buffer = new StringBuilder(200);
         buffer.append("");
         buffer.append("\r\n");
         buffer.append("SELECT \"DAV:uid\"\r\n");
@@ -486,7 +481,7 @@ public class WebDavStore extends Store {
     }
 
     private String getMessageUrlsXml(String[] uids) {
-        StringBuffer buffer = new StringBuffer(600);
+        StringBuilder buffer = new StringBuilder(600);
         buffer.append("");
         buffer.append("\r\n");
         buffer.append("SELECT \"urn:schemas:httpmail:read\", \"DAV:uid\"\r\n");
@@ -510,7 +505,7 @@ public class WebDavStore extends Store {
             throw new MessagingException("Attempt to get flags on 0 length array for uids");
         }
 
-        StringBuffer buffer = new StringBuffer(200);
+        StringBuilder buffer = new StringBuilder(200);
         buffer.append("");
         buffer.append("\r\n");
         buffer.append("SELECT \"urn:schemas:httpmail:read\", \"DAV:uid\"\r\n");
@@ -529,7 +524,7 @@ public class WebDavStore extends Store {
     }
 
     private String getMarkMessagesReadXml(String[] urls, boolean read) {
-        StringBuffer buffer = new StringBuffer(600);
+        StringBuilder buffer = new StringBuilder(600);
         buffer.append("\r\n");
         buffer.append("\r\n");
         buffer.append("\r\n");
@@ -553,7 +548,7 @@ public class WebDavStore extends Store {
     private String getMoveOrCopyMessagesReadXml(String[] urls, boolean isMove) {
 
         String action = (isMove ? "move" : "copy");
-        StringBuffer buffer = new StringBuffer(600);
+        StringBuilder buffer = new StringBuilder(600);
         buffer.append("\r\n");
         buffer.append("\r\n");
         buffer.append("\r\n");
@@ -944,8 +939,8 @@ public class WebDavStore extends Store {
             }
 
             if (headers != null) {
-                for (String headerName : headers.keySet()) {
-                    httpmethod.setHeader(headerName, headers.get(headerName));
+                for (Map.Entry entry : headers.entrySet()) {
+                    httpmethod.setHeader(entry.getKey(), entry.getValue());
                 }
             }
 
@@ -1209,7 +1204,6 @@ public class WebDavStore extends Store {
         private int getMessageCount(boolean read) throws MessagingException {
             String isRead;
             int messageCount = 0;
-            DataSet dataset = new DataSet();
             HashMap headers = new HashMap();
             String messageBody;
 
@@ -1221,7 +1215,7 @@ public class WebDavStore extends Store {
 
             messageBody = getMessageCountXml(isRead);
             headers.put("Brief", "t");
-            dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
+            DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
             if (dataset != null) {
                 messageCount = dataset.getMessageCount();
             }
@@ -1298,7 +1292,6 @@ public class WebDavStore extends Store {
         throws MessagingException {
             ArrayList messages = new ArrayList();
             String[] uids;
-            DataSet dataset = new DataSet();
             HashMap headers = new HashMap();
             int uidsLength = -1;
 
@@ -1322,7 +1315,7 @@ public class WebDavStore extends Store {
 
             headers.put("Brief", "t");
             headers.put("Range", "rows=" + start + "-" + end);
-            dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
+            DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
 
             uids = dataset.getUids();
             HashMap uidToUrl = dataset.getUidToUrl();
@@ -1377,17 +1370,15 @@ public class WebDavStore extends Store {
         }
 
         private HashMap getMessageUrls(String[] uids) throws MessagingException {
-            HashMap uidToUrl = new HashMap();
             HashMap headers = new HashMap();
-            DataSet dataset = new DataSet();
             String messageBody;
 
             /** Retrieve and parse the XML entity for our messages */
             messageBody = getMessageUrlsXml(uids);
             headers.put("Brief", "t");
 
-            dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
-            uidToUrl = dataset.getUidToUrl();
+            DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
+            HashMap uidToUrl = dataset.getUidToUrl();
 
             return uidToUrl;
         }
@@ -1488,29 +1479,35 @@ public class WebDavStore extends Store {
 
                     if (entity != null) {
                         InputStream istream = null;
-                        StringBuffer buffer = new StringBuffer();
+                        StringBuilder buffer = new StringBuilder();
                         String tempText = "";
                         String resultText = "";
-                        BufferedReader reader;
+                        BufferedReader reader = null;
                         int currentLines = 0;
 
-                        istream = WebDavHttpClient.getUngzippedContent(entity);
+                        try {
+                            istream = WebDavHttpClient.getUngzippedContent(entity);
 
-                        if (lines != -1) {
-                            reader = new BufferedReader(new InputStreamReader(istream), 8192);
+                            if (lines != -1) {
+                                reader = new BufferedReader(new InputStreamReader(istream), 8192);
 
-                            while ((tempText = reader.readLine()) != null &&
-                                    (currentLines < lines)) {
-                                buffer.append(tempText).append("\r\n");
-                                currentLines++;
+                                while ((tempText = reader.readLine()) != null &&
+                                        (currentLines < lines)) {
+                                    buffer.append(tempText).append("\r\n");
+                                    currentLines++;
+                                }
+
+                                istream.close();
+                                resultText = buffer.toString();
+                                istream = new ByteArrayInputStream(resultText.getBytes("UTF-8"));
                             }
 
-                            istream.close();
-                            resultText = buffer.toString();
-                            istream = new ByteArrayInputStream(resultText.getBytes("UTF-8"));
-                        }
+                            wdMessage.parse(istream);
 
-                        wdMessage.parse(istream);
+                        } finally {
+                            IOUtils.closeQuietly(reader);
+                            IOUtils.closeQuietly(istream);
+                        }
                     }
 
                 } catch (IllegalArgumentException iae) {
@@ -1537,9 +1534,7 @@ public class WebDavStore extends Store {
          * we do a series of medium calls instead of one large massive call or a large number of smaller calls.
          */
         private void fetchFlags(Message[] startMessages, MessageRetrievalListener listener) throws MessagingException {
-            HashMap uidToReadStatus = new HashMap();
             HashMap headers = new HashMap();
-            DataSet dataset = new DataSet();
             String messageBody = "";
             Message[] messages = new Message[20];
             String[] uids;
@@ -1572,13 +1567,13 @@ public class WebDavStore extends Store {
 
             messageBody = getMessageFlagsXml(uids);
             headers.put("Brief", "t");
-            dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
+            DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
 
             if (dataset == null) {
                 throw new MessagingException("Data Set from request was null");
             }
 
-            uidToReadStatus = dataset.getUidToRead();
+            HashMap uidToReadStatus = dataset.getUidToRead();
 
             for (int i = 0, count = messages.length; i < count; i++) {
                 if (!(messages[i] instanceof WebDavMessage)) {
@@ -1590,7 +1585,7 @@ public class WebDavStore extends Store {
                     listener.messageStarted(wdMessage.getUid(), i, count);
                 }
 
-                try { 
+                try {
                     wdMessage.setFlagInternal(Flag.SEEN, uidToReadStatus.get(wdMessage.getUid()));
                 } catch (NullPointerException e) {
                     Log.v(K9.LOG_TAG,"Under some weird circumstances, setting the read status when syncing from webdav threw an NPE. Skipping.");
@@ -1609,9 +1604,7 @@ public class WebDavStore extends Store {
          */
         private void fetchEnvelope(Message[] startMessages, MessageRetrievalListener listener)
         throws MessagingException {
-            HashMap envelopes = new HashMap();
             HashMap headers = new HashMap();
-            DataSet dataset = new DataSet();
             String messageBody = "";
             String[] uids;
             Message[] messages = new Message[10];
@@ -1644,9 +1637,9 @@ public class WebDavStore extends Store {
 
             messageBody = getMessageEnvelopeXml(uids);
             headers.put("Brief", "t");
-            dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
+            DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers);
 
-            envelopes = dataset.getMessageEnvelopes();
+            Map envelopes = dataset.getMessageEnvelopes();
 
             int count = messages.length;
             for (int i = messages.length - 1; i >= 0; i--) {
@@ -1852,7 +1845,7 @@ public class WebDavStore extends Store {
         public void setUrl(String url) {
             // TODO: This is a not as ugly hack (ie, it will actually work)
             // XXX: prevent URLs from getting to us that are broken
-            if (!(url.toLowerCase().contains("http"))) {
+            if (!(url.toLowerCase(Locale.US).contains("http"))) {
                 if (!(url.startsWith("/"))) {
                     url = "/" + url;
                 }
@@ -1948,7 +1941,7 @@ public class WebDavStore extends Store {
      */
     public class WebDavHandler extends DefaultHandler {
         private DataSet mDataSet = new DataSet();
-        private Stack mOpenTags = new Stack();
+        private final LinkedList mOpenTags = new LinkedList();
 
         public DataSet getDataSet() {
             return this.mDataSet;
@@ -1967,12 +1960,12 @@ public class WebDavStore extends Store {
         @Override
         public void startElement(String namespaceURI, String localName,
                                  String qName, Attributes atts) throws SAXException {
-            mOpenTags.push(localName);
+            mOpenTags.addFirst(localName);
         }
 
         @Override
         public void endElement(String namespaceURI, String localName, String qName) {
-            mOpenTags.pop();
+            mOpenTags.removeFirst();
 
             /** Reset the hash temp variables */
             if (localName.equals("response")) {
@@ -1996,21 +1989,22 @@ public class WebDavStore extends Store {
         /**
          * Holds the mappings from the name returned from Exchange to the MIME format header name
          */
-        private final HashMap mHeaderMappings = new HashMap() {
-            {
-                put("mime-version", "MIME-Version");
-                put("content-type", "Content-Type");
-                put("subject", "Subject");
-                put("date", "Date");
-                put("thread-topic", "Thread-Topic");
-                put("thread-index", "Thread-Index");
-                put("from", "From");
-                put("to", "To");
-                put("in-reply-to", "In-Reply-To");
-                put("cc", "Cc");
-                put("getcontentlength", "Content-Length");
-            }
-        };
+        private static final Map HEADER_MAPPINGS;
+        static {
+            Map map = new HashMap();
+            map.put("mime-version", "MIME-Version");
+            map.put("content-type", "Content-Type");
+            map.put("subject", "Subject");
+            map.put("date", "Date");
+            map.put("thread-topic", "Thread-Topic");
+            map.put("thread-index", "Thread-Index");
+            map.put("from", "From");
+            map.put("to", "To");
+            map.put("in-reply-to", "In-Reply-To");
+            map.put("cc", "Cc");
+            map.put("getcontentlength", "Content-Length");
+            HEADER_MAPPINGS = Collections.unmodifiableMap(map);
+        }
 
         private boolean mReadStatus = false;
         private String mUid = "";
@@ -2018,11 +2012,11 @@ public class WebDavStore extends Store {
         private ArrayList mHeaders = new ArrayList();
 
         public void addHeader(String field, String value) {
-            String headerName = mHeaderMappings.get(field);
+            String headerName = HEADER_MAPPINGS.get(field);
 
             if (headerName != null) {
-                this.mMessageHeaders.put(mHeaderMappings.get(field), value);
-                this.mHeaders.add(mHeaderMappings.get(field));
+                this.mMessageHeaders.put(HEADER_MAPPINGS.get(field), value);
+                this.mHeaders.add(HEADER_MAPPINGS.get(field));
             }
         }
 
@@ -2135,7 +2129,7 @@ public class WebDavStore extends Store {
                 } else {
                     // We don't actually want to have null values in our hashmap,
                     // as it causes the calling code to crash with an NPE as it
-                    // does a lookup in the maap.
+                    // does a lookup in the map.
                     uidToRead.put(uid, false);
                 }
             }
@@ -2207,10 +2201,11 @@ public class WebDavStore extends Store {
                 HashMap data = mData.get(uid);
 
                 if (data != null) {
-                    for (String header : data.keySet()) {
+                    for (Map.Entry entry : data.entrySet()) {
+                        String header = entry.getKey();
                         if (header.equals("read")) {
-                            String read = data.get(header);
-                            Boolean readStatus = !read.equals("0");
+                            String read = entry.getValue();
+                            boolean readStatus = !read.equals("0");
 
                             envelope.setReadStatus(readStatus);
                         } else if (header.equals("date")) {
@@ -2219,7 +2214,7 @@ public class WebDavStore extends Store {
                              * yyyy-MM-dd'T'HH:mm:ss.SSS
                              */
-                            String date = data.get(header);
+                            String date = entry.getValue();
                             date = date.substring(0, date.length() - 1);
 
                             DateFormat dfInput = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
@@ -2234,7 +2229,7 @@ public class WebDavStore extends Store {
                             }
                             envelope.addHeader(header, tempDate);
                         } else {
-                            envelope.addHeader(header, data.get(header));
+                            envelope.addHeader(header, entry.getValue());
                         }
                     }
                 }
diff --git a/src/com/fsck/k9/mail/transport/SmtpTransport.java b/src/com/fsck/k9/mail/transport/SmtpTransport.java
index f82ba6849..e7546190a 100644
--- a/src/com/fsck/k9/mail/transport/SmtpTransport.java
+++ b/src/com/fsck/k9/mail/transport/SmtpTransport.java
@@ -254,7 +254,7 @@ public class SmtpTransport extends Transport {
                         mLargestAcceptableMessage = Integer.parseInt(result.substring(result.lastIndexOf(' ') + 1));
                     } catch (Exception e) {
                         if (K9.DEBUG && K9.DEBUG_PROTOCOL_SMTP) {
-                            Log.d(K9.LOG_TAG, "Tried to parse " + result + " and get an int out of the last word: " + e);
+                            Log.d(K9.LOG_TAG, "Tried to parse " + result + " and get an int out of the last word", e);
                         }
                     }
                 }
@@ -429,7 +429,7 @@ public class SmtpTransport extends Transport {
     }
 
     private String readLine() throws IOException {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         int d;
         while ((d = mIn.read()) != -1) {
             if (((char)d) == '\r') {
diff --git a/src/com/fsck/k9/preferences/Storage.java b/src/com/fsck/k9/preferences/Storage.java
index fd05d812b..34c978754 100644
--- a/src/com/fsck/k9/preferences/Storage.java
+++ b/src/com/fsck/k9/preferences/Storage.java
@@ -185,9 +185,7 @@ public class Storage implements SharedPreferences {
                 storage.put(key, value);
             }
         } finally {
-            if (cursor != null) {
-                cursor.close();
-            }
+            Utility.closeQuietly(cursor);
             if (mDb != null) {
                 mDb.close();
             }
@@ -384,9 +382,7 @@ public class Storage implements SharedPreferences {
                 }
             }
         } finally {
-            if (cursor != null) {
-                cursor.close();
-            }
+            Utility.closeQuietly(cursor);
         }
 
         return value;
diff --git a/src/com/fsck/k9/provider/MessageProvider.java b/src/com/fsck/k9/provider/MessageProvider.java
index b4f478206..f2c1ec693 100644
--- a/src/com/fsck/k9/provider/MessageProvider.java
+++ b/src/com/fsck/k9/provider/MessageProvider.java
@@ -893,7 +893,7 @@ public class MessageProvider extends ContentProvider {
             Log.v(K9.LOG_TAG, "MessageProvider/delete: " + uri);
         }
 
-        // Nota : can only delete a message
+        // Note: can only delete a message
 
         List segments = null;
         int accountId = -1;
diff --git a/src/com/fsck/k9/service/CoreService.java b/src/com/fsck/k9/service/CoreService.java
index 090e9b578..bb7acee57 100644
--- a/src/com/fsck/k9/service/CoreService.java
+++ b/src/com/fsck/k9/service/CoreService.java
@@ -18,116 +18,167 @@ import com.fsck.k9.helper.power.TracingPowerManager;
 import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock;
 
 /**
- * Note: All documentation in this file market  is documentation written by Christian Knecht by reverse engineering.
- *       This documentation is without warranty and may not be accurate nor reflect the author's original intent.
- *      
- * 
- * CoreService is the base class for all K9 Services.
- * 
- * An Android service is a way to model a part of an application that needs to accomplish certain tasks without the
- * UI part of the application being necessarily active (of course an application could also be a pure service, without
- * any UI; this is not the case of K9). By declaring a service and starting it, the OS knows that the application has
- * work to do and should avoid killing the process.
- * 
- * A service's main purpose is to do some task (usually in the background) which requires one of more threads. The
- * thread that starts the service is the same as the UI thread of the process. It should thus not be used to run
- * the tasks.
- * 
- * CoreService is providing the execution plumbing for background tasks including the required thread and task queuing
- * for all K9 services to use.
- * 
- * A service is supposed to run only as long as it has some work to do whether that work is active processing or some
- * just some monitoring, like listening on a network port for incoming connections or listing on an open network
- * connection for incoming data (push mechanism).
- * 
- * To make sure the service is running only when required, is must be shutdown after tasks are done. As the
- * execution of tasks is abstracted away in this class, it also proper shutdown handling if approriate. If
- * the Service requires this is should call enableAutoShutdown(true) in it's onCreate() method. 
+ * {@code CoreService} is the base class for all K-9 Services.
  *
- * While a service is running it's tasks, it is usually not a good idea to let the device go to sleep more.
- * WakeLocks are used to avoid this. CoreService provides a central registry (singleton) that can be used
- * application-wide to store WakeLocks.
- * 
- * In short, CoreService provides the following features to K9 Services:
- *  - task execution and queuing
- *  - Service life cycle management (insures the service is stopped when not needed anymore); disabled by default
- *  - WakeLock registry and management
- *  
- *       
+ * 

+ * An Android service is a way to model a part of an application that needs to accomplish certain + * tasks without the UI part of the application being necessarily active (of course an application + * could also be a pure service, without any UI; this is not the case of K-9). By declaring a + * service and starting it, the OS knows that the application has work to do and should avoid + * killing the process. + *

+ * A service's main purpose is to do some task (usually in the background) which requires one or + * more threads. The thread that starts the service is the same as the UI thread of the process. It + * should thus not be used to run the tasks. + *

+ * CoreService is providing the execution plumbing for background tasks including the required + * thread and task queuing for all K9 services to use. + *

+ * A service is supposed to run only as long as it has some work to do whether that work is active + * processing or some just some monitoring, like listening on a network port for incoming connections + * or listing on an open network connection for incoming data (push mechanism). + *

+ * To make sure the service is running only when required, is must be shutdown after tasks are + * done. As the execution of tasks is abstracted away in this class, it also handles proper + * shutdown. If a Service doesn't want this, it needs to call {@code enableAutoShutdown(true)} in + * its {@link Service#onCreate()} method. + *

+ * While a service is running its tasks, it is usually not a good idea to let the device go to + * sleep mode. Wake locks are used to avoid this. CoreService provides a central registry + * (singleton) that can be used application-wide to store wake locks. + *

+ * In short, CoreService provides the following features to K-9 Services: + *

    + *
  • task execution and queuing
  • + *
  • Service life cycle management (ensures the service is stopped when not needed anymore); + * enabled by default
  • + *
  • wake lock registry and management
  • + *
*/ public abstract class CoreService extends Service { - public static String WAKE_LOCK_ID = "com.fsck.k9.service.CoreService.wakeLockId"; // CK:Intent attribute ID - private static ConcurrentHashMap wakeLocks = new ConcurrentHashMap(); // CK:WakeLocks registry - private static AtomicInteger wakeLockSeq = new AtomicInteger(0); // CK:WakeLock registry - private ExecutorService threadPool = null; // CK:Threadpool with a single thread; used to execute and queue background actions inside the service - private final String className = getClass().getName(); - private volatile boolean mShutdown = false; // CK:A:Seems to be used only when the service is "officially" shutdown to make sure that an exception raise because of the shutdown gets ignored. + public static String WAKE_LOCK_ID = "com.fsck.k9.service.CoreService.wakeLockId"; + + private static ConcurrentHashMap sWakeLocks = + new ConcurrentHashMap(); + private static AtomicInteger sWakeLockSeq = new AtomicInteger(0); /** - * Controls the auto-shutdown mechanism of the service. The default service life-cycle model is that the service should run - * only as long as a task is running. If a service should behave differently, disable auto-shutdown. + * Threadpool that is used to execute and queue background actions inside the service. + */ + private ExecutorService mThreadPool = null; + + /** + * String of the class name used in debug messages. + */ + private final String className = getClass().getName(); + + /** + * {@code true} if the {@code Service}'s {@link #onDestroy()} method was called. {@code false} + * otherwise. + * + *

+ * Note: + * This is used to ignore (expected) {@link RejectedExecutionException}s thrown by + * {@link ExecutorService#execute(Runnable)} after the service (and with that, the thread pool) + * was shut down. + *

+ */ + private volatile boolean mShutdown = false; + + /** + * Controls the auto shutdown mechanism of the service. + * + *

+ * The default service life-cycle model is that the service should run only as long as a task + * is running. If a service should behave differently, disable auto shutdown using + * {@link #setAutoShutdown(boolean)}. + *

*/ private boolean mAutoShutdown = true; - + /** - * This variable is part of the auto-shutdown feature and determines whether the service has to be shutdown at the - * end of the onStart() method or not. + * This variable is part of the auto shutdown feature and determines whether the service has to + * be shutdown at the end of the {@link #onStart(Intent, int)} method or not. */ - protected boolean mImmediateShutdown = true; // - - @Override - public void onCreate() { - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "CoreService: " + className + ".onCreate()"); - threadPool = Executors.newFixedThreadPool(1); // Must be single threaded - super.onCreate(); + protected boolean mImmediateShutdown = true; - } /** - * Adds an existing WakeLock identified by it's WakeLock-ID to the specified Intent. - * @param i + * Adds an existing wake lock identified by its registry ID to the specified intent. + * + * @param context + * A {@link Context} instance. Never {@code null}. + * @param intent + * The {@link Intent} to add the wake lock registy ID as extra to. Never {@code null}. * @param wakeLockId + * The wake lock registry ID of an existing wake lock or {@code null}. + * @param createIfNotExists + * If {@code wakeLockId} is {@code null} and this parameter is {@code true} a new wake + * lock is created, registered, and added to {@code intent}. */ - protected static void addWakeLockId(Context context, Intent i, Integer wakeLockId, boolean createIfNotExists) { + protected static void addWakeLockId(Context context, Intent intent, Integer wakeLockId, + boolean createIfNotExists) { + if (wakeLockId != null) { - i.putExtra(BootReceiver.WAKE_LOCK_ID, wakeLockId); + intent.putExtra(BootReceiver.WAKE_LOCK_ID, wakeLockId); return; } - if (createIfNotExists) - addWakeLock(context,i); + + if (createIfNotExists) { + addWakeLock(context,intent); + } } /** - * Adds a new WakeLock to the intent. - * This will add the WakeLock to the central WakeLock registry managed by this class. - * @param context Required to be able to create a new wake-lock. - * @param i Intent to which to add the WakeLock (CK:Q:still unclear why we need to link Intents and WakeLocks) + * Adds a new wake lock to the specified intent. + * + *

+ * This will add the wake lock to the central wake lock registry managed by this class. + *

+ * + * @param context + * A {@link Context} instance. Never {@code null}. + * @param intent + * The {@link Intent} to add the wake lock registy ID as extra to. Never {@code null}. */ - protected static void addWakeLock(Context context, Intent i) { - TracingWakeLock wakeLock = acquireWakeLock(context,"CoreService addWakeLock",K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT); // CK:Q: What this timeout? 30secs seems a bizarre choice. It it's a safeguard it should be longer, if it's to cover the real time required by some operation, it seems too short (though I say this before knowing really what the service is supposed to do) + protected static void addWakeLock(Context context, Intent intent) { + TracingWakeLock wakeLock = acquireWakeLock(context, "CoreService addWakeLock", + K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT); Integer tmpWakeLockId = registerWakeLock(wakeLock); - i.putExtra(WAKE_LOCK_ID, tmpWakeLockId); + intent.putExtra(WAKE_LOCK_ID, tmpWakeLockId); } /** - * Register WakeLock and returns its registry-entry-ID + * Registers a wake lock with the wake lock registry. + * * @param wakeLock - * @return - * AUTHOR chrisk + * The {@link TracingWakeLock} instance that should be registered with the wake lock + * registry. Never {@code null}. + * + * @return The ID that identifies this wake lock in the registry. */ protected static Integer registerWakeLock(TracingWakeLock wakeLock) { - Integer tmpWakeLockId = wakeLockSeq.getAndIncrement(); - wakeLocks.put(tmpWakeLockId, wakeLock); + // Get a new wake lock ID + Integer tmpWakeLockId = sWakeLockSeq.getAndIncrement(); + + // Store the wake lock in the registry + sWakeLocks.put(tmpWakeLockId, wakeLock); + return tmpWakeLockId; } /** - * Acquires a WakeLock in a K9 standard way + * Acquires a wake lock. + * * @param context - * @return - * AUTHOR chrisk + * A {@link Context} instance. Never {@code null}. + * @param tag + * The tag to supply to {@link TracingPowerManager}. + * @param timeout + * The wake lock timeout. + * + * @return A new {@link TracingWakeLock} instance. */ protected static TracingWakeLock acquireWakeLock(Context context, String tag, long timeout) { TracingPowerManager pm = TracingPowerManager.getPowerManager(context); @@ -138,29 +189,64 @@ public abstract class CoreService extends Service { } @Override - public void onStart(Intent intent, int startId) { + public void onCreate() { + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "CoreService: " + className + ".onCreate()"); + } + + mThreadPool = Executors.newFixedThreadPool(1); // Must be single threaded + super.onCreate(); + } + + @Override + public final void onStart(Intent intent, int startId) { // deprecated method but still used for backwards compatibility with Android version <2.0 - - // CK:DocAdded: Manage wake-locks, especially, release any wake-locks held so far and define a new "local" wake lock. - // Also, because we create a new wakelock, we re-initialize the wakelock timeout and give - // the service-start code a protection of up to MAIL_SERVICE_WAKE_LOCK_TIMEOUT (currently 30s). - TracingWakeLock wakeLock = acquireWakeLock(this,"CoreService onStart",K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT); - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "CoreService: " + className + ".onStart(" + intent + ", " + startId); + /* + * When a process is killed due to low memory, it's later restarted and services that were + * started with START_STICKY are started with the intent being null. + * + * For now we just ignore these restart events. This should be fine because all necessary + * services are started from K9.onCreate() when the Application object is initialized. + * + * See issue 3750 + */ + if (intent == null) { + stopSelf(startId); + return; + } + // Acquire new wake lock + TracingWakeLock wakeLock = acquireWakeLock(this, "CoreService onStart", + K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT); + + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "CoreService: " + className + ".onStart(" + intent + ", " + startId + ")"); + } + + // If we were started by BootReceiver, release the wake lock acquired there. int wakeLockId = intent.getIntExtra(BootReceiver.WAKE_LOCK_ID, -1); if (wakeLockId != -1) { BootReceiver.releaseWakeLock(this, wakeLockId); } - Integer coreWakeLockId = intent.getIntExtra(WAKE_LOCK_ID, -1); - if (coreWakeLockId != null && coreWakeLockId != -1) { - if (K9.DEBUG) + + // If we were passed an ID from our own wake lock registry, retrieve that wake lock and + // release it. + int coreWakeLockId = intent.getIntExtra(WAKE_LOCK_ID, -1); + if (coreWakeLockId != -1) { + if (K9.DEBUG) { Log.d(K9.LOG_TAG, "Got core wake lock id " + coreWakeLockId); - TracingWakeLock coreWakeLock = wakeLocks.remove(coreWakeLockId); + } + + // Remove wake lock from the registry + TracingWakeLock coreWakeLock = sWakeLocks.remove(coreWakeLockId); + + // Release wake lock if (coreWakeLock != null) { - if (K9.DEBUG) - Log.d(K9.LOG_TAG, "Found core wake lock with id " + coreWakeLockId + ", releasing"); + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "Found core wake lock with id " + coreWakeLockId + + ", releasing"); + } coreWakeLock.release(); } } @@ -171,117 +257,179 @@ public abstract class CoreService extends Service { super.onStart(intent, startId); startService(intent, startId); } finally { - try{wakeLock.release();} catch (Exception e) {/* ignore */} - try{if (mAutoShutdown && mImmediateShutdown && startId != -1) stopSelf(startId);} catch (Exception e) {/* ignore */} + try { + // Release the wake lock acquired at the start of this method + wakeLock.release(); + } catch (Exception e) { /* ignore */ } + + try { + // If there is no outstanding work to be done in a background thread we can stop + // this service. + if (mAutoShutdown && mImmediateShutdown && startId != -1) { + stopSelf(startId); + } + } catch (Exception e) { /* ignore */ } } } /** - * + * Execute a task in the background thread. + * * @param context + * A {@link Context} instance. Never {@code null}. * @param runner + * The code to be executed in the background thread. * @param wakeLockTime + * The timeout for the wake lock that will be acquired by this method. * @param startId - * @return returns whether service-shutdown will actually happen after the task has been executed (or has already been done). + * The {@code startId} value received in {@link #onStart(Intent, int)} or {@code null} + * if you don't want the service to be shut down after {@code runner} has been executed + * (e.g. because you need to run another background task).
+ * If this parameter is {@code null} you need to call {@code setAutoShutdown(false)} + * otherwise the auto shutdown code will stop the service. */ - public boolean execute(Context context, final Runnable runner, int wakeLockTime, final Integer startId) { + public void execute(Context context, final Runnable runner, int wakeLockTime, + final Integer startId) { boolean serviceShutdownScheduled = false; - final TracingWakeLock wakeLock = acquireWakeLock(context,"CoreService execute",wakeLockTime); final boolean autoShutdown = mAutoShutdown; + // Acquire a new wakelock + final TracingWakeLock wakeLock = acquireWakeLock(context, "CoreService execute", + wakeLockTime); + + // Wrap the supplied runner with code to release the wake lock and stop the service if + // appropriate. Runnable myRunner = new Runnable() { public void run() { try { + // Get the sync status boolean oldIsSyncDisabled = MailService.isSyncDisabled(); - if (K9.DEBUG) - Log.d(K9.LOG_TAG, "CoreService (" + className + ") running Runnable " + runner.hashCode() + " with startId " + startId); + + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "CoreService (" + className + ") running Runnable " + + runner.hashCode() + " with startId " + startId); + } + + // Run the supplied code runner.run(); + + // If the sync status changed while runner was executing, notify + // MessagingController if (MailService.isSyncDisabled() != oldIsSyncDisabled) { MessagingController.getInstance(getApplication()).systemStatusChanged(); } } finally { - try { // Making absolutely sure the service stopping command will be executed - if (K9.DEBUG) - Log.d(K9.LOG_TAG, "CoreService (" + className + ") completed Runnable " + runner.hashCode() + " with startId " + startId); + // Making absolutely sure stopSelf() will be called + try { + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "CoreService (" + className + ") completed " + + "Runnable " + runner.hashCode() + " with startId " + startId); + } wakeLock.release(); } finally { if (autoShutdown && startId != null) { - stopSelf(startId); // <-- this is what is meant with "serviceShutdownScheduled"; execution of this line assures proper shutdown of the service once finished + stopSelf(startId); } } } } - }; - if (threadPool == null) { - Log.e(K9.LOG_TAG, "CoreService.execute (" + className + ") called with no threadPool available; running Runnable " + runner.hashCode() + " in calling thread", new Throwable()); + + // TODO: remove this. we never set mThreadPool to null + if (mThreadPool == null) { + Log.e(K9.LOG_TAG, "CoreService.execute (" + className + ") called with no thread " + + "pool available; running Runnable " + runner.hashCode() + + " in calling thread"); + synchronized (this) { myRunner.run(); - serviceShutdownScheduled = startId != null; // In this case it's not actually scheduled, it's already done, but that should never happen anyway + serviceShutdownScheduled = startId != null; } } else { - if (K9.DEBUG) - Log.d(K9.LOG_TAG, "CoreService (" + className + ") queueing Runnable " + runner.hashCode() + " with startId " + startId); + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "CoreService (" + className + ") queueing Runnable " + + runner.hashCode() + " with startId " + startId); + } + try { - threadPool.execute(myRunner); + mThreadPool.execute(myRunner); serviceShutdownScheduled = startId != null; } catch (RejectedExecutionException e) { + // Ignore RejectedExecutionException after we shut down the thread pool in + // onDestroy(). Still, this should not happen! if (!mShutdown) { throw e; } - Log.i(K9.LOG_TAG, "CoreService: " + className + " is shutting down, ignoring rejected execution exception: " + e.getMessage()); + + Log.i(K9.LOG_TAG, "CoreService: " + className + " is shutting down, ignoring " + + "rejected execution exception: " + e.getMessage()); } } - mImmediateShutdown = !serviceShutdownScheduled; - return serviceShutdownScheduled; + + mImmediateShutdown = !serviceShutdownScheduled; } /** - * CK:Added - * To implement by sub-class instead of overriding onStart. - * This allows CoreService to do start and end operations around the sub-class's start code. - * Especially, CoreService will protect the start-code with a wake-lock to guarantee the service to have the required resources to do it's work. - * CK:Q: Is this really useful (the wakelock part)? The real work is happening in the worker-thread anyway. Maybe it is because this makes sure that whatever needs to be started by the service, it can be without being interrupted by the phone going to sleep. + * Subclasses need to implement this instead of overriding {@link #onStart(Intent, int)}. + * + *

+ * This allows {@link CoreService} to manage the service lifecycle, incl. wake lock management. + *

+ * @param intent + * The Intent supplied to {@link Context#startService(Intent)}. * @param startId + * A unique integer representing this specific request to start. Use with + * {@link #stopSelfResult(int)}. */ public abstract void startService(Intent intent, int startId); - @Override - public IBinder onBind(@SuppressWarnings("unused") Intent intent) { - // TODO Auto-generated method stub - return null; - } - @Override public void onLowMemory() { Log.w(K9.LOG_TAG, "CoreService: " + className + ".onLowMemory() - Running low on memory"); } + /** + * Clean up when the service is stopped. + */ @Override public void onDestroy() { - if (K9.DEBUG) + if (K9.DEBUG) { Log.i(K9.LOG_TAG, "CoreService: " + className + ".onDestroy()"); + } + + // Shut down thread pool mShutdown = true; - threadPool.shutdown(); + mThreadPool.shutdown(); + super.onDestroy(); - // MessagingController.getInstance(getApplication()).removeListener(mListener); } /** - * @return True if auto-shutdown is enabled + * Return whether or not auto shutdown is enabled. + * + * @return {@code true} iff auto shutdown is enabled. */ protected boolean isAutoShutdown() { return mAutoShutdown; } /** - * Enable of disable auto-shutdown (enabled by default). - * See {@#mAutoShutdown} for more information. + * Enable or disable auto shutdown (enabled by default). + * * @param autoShutdown + * {@code true} to enable auto shutdown. {@code false} to disable. + * + * @see #mAutoShutdown */ protected void setAutoShutdown(boolean autoShutdown) { mAutoShutdown = autoShutdown; } + + @Override + public IBinder onBind(Intent intent) { + // Unused + return null; + } } diff --git a/src/com/fsck/k9/service/MailService.java b/src/com/fsck/k9/service/MailService.java index e8e3fc1a2..55a668ef1 100644 --- a/src/com/fsck/k9/service/MailService.java +++ b/src/com/fsck/k9/service/MailService.java @@ -86,102 +86,92 @@ public class MailService extends CoreService { @Override public void startService(Intent intent, int startId) { long startTime = System.currentTimeMillis(); - try { - boolean oldIsSyncDisabled = isSyncDisabled(); - ConnectivityManager connectivityManager = (ConnectivityManager)getApplication().getSystemService(Context.CONNECTIVITY_SERVICE); - boolean doBackground = true; - boolean hasConnectivity = false; + boolean oldIsSyncDisabled = isSyncDisabled(); + ConnectivityManager connectivityManager = (ConnectivityManager)getApplication().getSystemService(Context.CONNECTIVITY_SERVICE); + boolean doBackground = true; + boolean hasConnectivity = false; - if (connectivityManager != null) { - NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo(); - if (netInfo != null) { - State state = netInfo.getState(); - hasConnectivity = state == State.CONNECTED; - } - boolean backgroundData = connectivityManager.getBackgroundDataSetting(); - boolean autoSync = true; - if (AutoSyncHelper.isAvailable()) { - autoSync = AutoSyncHelper.getMasterSyncAutomatically(); - - Log.i(K9.LOG_TAG, "AutoSync help is available, autoSync = " + autoSync); - } - - K9.BACKGROUND_OPS bOps = K9.getBackgroundOps(); - - switch (bOps) { - case NEVER: - doBackground = false; - break; - case ALWAYS: - doBackground = true; - break; - case WHEN_CHECKED: - doBackground = backgroundData; - break; - case WHEN_CHECKED_AUTO_SYNC: - doBackground = backgroundData & autoSync; - break; - } + if (connectivityManager != null) { + NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo(); + if (netInfo != null) { + State state = netInfo.getState(); + hasConnectivity = state == State.CONNECTED; + } + boolean backgroundData = connectivityManager.getBackgroundDataSetting(); + boolean autoSync = true; + if (AutoSyncHelper.isAvailable()) { + autoSync = AutoSyncHelper.getMasterSyncAutomatically(); + Log.i(K9.LOG_TAG, "AutoSync help is available, autoSync = " + autoSync); } - syncBlocked = !(doBackground && hasConnectivity); + K9.BACKGROUND_OPS bOps = K9.getBackgroundOps(); - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "MailService.onStart(" + intent + ", " + startId - + "), hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground); + switch (bOps) { + case NEVER: + doBackground = false; + break; + case ALWAYS: + doBackground = true; + break; + case WHEN_CHECKED: + doBackground = backgroundData; + break; + case WHEN_CHECKED_AUTO_SYNC: + doBackground = backgroundData & autoSync; + break; + } - // MessagingController.getInstance(getApplication()).addListener(mListener); - if (ACTION_CHECK_MAIL.equals(intent.getAction())) { - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "***** MailService *****: checking mail"); - if (hasConnectivity && doBackground) { - PollService.startService(this); - } - reschedulePoll(hasConnectivity, doBackground, startId, false); - } else if (ACTION_CANCEL.equals(intent.getAction())) { - if (K9.DEBUG) - Log.v(K9.LOG_TAG, "***** MailService *****: cancel"); - cancel(); - } else if (ACTION_RESET.equals(intent.getAction())) { - if (K9.DEBUG) - Log.v(K9.LOG_TAG, "***** MailService *****: reschedule"); - rescheduleAll(hasConnectivity, doBackground, startId); - } else if (ACTION_RESTART_PUSHERS.equals(intent.getAction())) { - if (K9.DEBUG) - Log.v(K9.LOG_TAG, "***** MailService *****: restarting pushers"); - reschedulePushers(hasConnectivity, doBackground, startId); - } else if (ACTION_RESCHEDULE_POLL.equals(intent.getAction())) { - if (K9.DEBUG) - Log.v(K9.LOG_TAG, "***** MailService *****: rescheduling poll"); - reschedulePoll(hasConnectivity, doBackground, startId, true); - } else if (ACTION_REFRESH_PUSHERS.equals(intent.getAction())) { - if (hasConnectivity && doBackground) { - refreshPushers(null); - schedulePushers(startId); - } - } else if (CONNECTIVITY_CHANGE.equals(intent.getAction())) { - rescheduleAll(hasConnectivity, doBackground, startId); - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "Got connectivity action with hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground); - } else if (CANCEL_CONNECTIVITY_NOTICE.equals(intent.getAction())) { - } - if (isSyncDisabled() != oldIsSyncDisabled) { - MessagingController.getInstance(getApplication()).systemStatusChanged(); - } - } finally { - /* nothing to do */ } + + syncBlocked = !(doBackground && hasConnectivity); + + if (K9.DEBUG) + Log.i(K9.LOG_TAG, "MailService.onStart(" + intent + ", " + startId + + "), hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground); + + // MessagingController.getInstance(getApplication()).addListener(mListener); + if (ACTION_CHECK_MAIL.equals(intent.getAction())) { + if (K9.DEBUG) + Log.i(K9.LOG_TAG, "***** MailService *****: checking mail"); + if (hasConnectivity && doBackground) { + PollService.startService(this); + } + reschedulePollInBackground(hasConnectivity, doBackground, startId, false); + } else if (ACTION_CANCEL.equals(intent.getAction())) { + if (K9.DEBUG) + Log.v(K9.LOG_TAG, "***** MailService *****: cancel"); + cancel(); + } else if (ACTION_RESET.equals(intent.getAction())) { + if (K9.DEBUG) + Log.v(K9.LOG_TAG, "***** MailService *****: reschedule"); + rescheduleAllInBackground(hasConnectivity, doBackground, startId); + } else if (ACTION_RESTART_PUSHERS.equals(intent.getAction())) { + if (K9.DEBUG) + Log.v(K9.LOG_TAG, "***** MailService *****: restarting pushers"); + reschedulePushersInBackground(hasConnectivity, doBackground, startId); + } else if (ACTION_RESCHEDULE_POLL.equals(intent.getAction())) { + if (K9.DEBUG) + Log.v(K9.LOG_TAG, "***** MailService *****: rescheduling poll"); + reschedulePollInBackground(hasConnectivity, doBackground, startId, true); + } else if (ACTION_REFRESH_PUSHERS.equals(intent.getAction())) { + refreshPushersInBackground(hasConnectivity, doBackground, startId); + } else if (CONNECTIVITY_CHANGE.equals(intent.getAction())) { + rescheduleAllInBackground(hasConnectivity, doBackground, startId); + if (K9.DEBUG) + Log.i(K9.LOG_TAG, "Got connectivity action with hasConnectivity = " + hasConnectivity + ", doBackground = " + doBackground); + } else if (CANCEL_CONNECTIVITY_NOTICE.equals(intent.getAction())) { + /* do nothing */ + } + + if (isSyncDisabled() != oldIsSyncDisabled) { + MessagingController.getInstance(getApplication()).systemStatusChanged(); + } + if (K9.DEBUG) Log.i(K9.LOG_TAG, "MailService.onStart took " + (System.currentTimeMillis() - startTime) + "ms"); } - private void rescheduleAll(final boolean hasConnectivity, final boolean doBackground, final Integer startId) { - reschedulePoll(hasConnectivity, doBackground, null, true); - reschedulePushers(hasConnectivity, doBackground, startId); - } - - @Override public void onDestroy() { if (K9.DEBUG) @@ -211,74 +201,131 @@ public class MailService extends CoreService { editor.commit(); } - private void reschedulePoll(final boolean hasConnectivity, final boolean doBackground, Integer startId, final boolean considerLastCheckEnd) { + private void rescheduleAllInBackground(final boolean hasConnectivity, + final boolean doBackground, Integer startId) { + + execute(getApplication(), new Runnable() { + @Override + public void run() { + reschedulePoll(hasConnectivity, doBackground, true); + reschedulePushers(hasConnectivity, doBackground); + } + }, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); + } + + private void reschedulePollInBackground(final boolean hasConnectivity, + final boolean doBackground, Integer startId, final boolean considerLastCheckEnd) { + + execute(getApplication(), new Runnable() { + public void run() { + reschedulePoll(hasConnectivity, doBackground, considerLastCheckEnd); + } + }, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); + } + + private void reschedulePushersInBackground(final boolean hasConnectivity, + final boolean doBackground, Integer startId) { + + execute(getApplication(), new Runnable() { + public void run() { + reschedulePushers(hasConnectivity, doBackground); + } + }, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); + } + + private void refreshPushersInBackground(boolean hasConnectivity, boolean doBackground, + Integer startId) { + if (hasConnectivity && doBackground) { execute(getApplication(), new Runnable() { public void run() { - int shortestInterval = -1; - - Preferences prefs = Preferences.getPreferences(MailService.this); - SharedPreferences sPrefs = prefs.getPreferences(); - int previousInterval = sPrefs.getInt(PREVIOUS_INTERVAL, -1); - long lastCheckEnd = sPrefs.getLong(LAST_CHECK_END, -1); - - if (lastCheckEnd > System.currentTimeMillis()) { - Log.i(K9.LOG_TAG, "The database claims that the last time mail was checked was in the future. ("+lastCheckEnd+"). To try to get things back to normal, the last check time has been reset to "+System.currentTimeMillis()); - lastCheckEnd = System.currentTimeMillis(); - } - - - for (Account account : prefs.getAccounts()) { - if (account.getAutomaticCheckIntervalMinutes() != -1 - && account.getFolderSyncMode() != FolderMode.NONE - && (account.getAutomaticCheckIntervalMinutes() < shortestInterval || shortestInterval == -1)) { - shortestInterval = account.getAutomaticCheckIntervalMinutes(); - } - } - SharedPreferences.Editor editor = sPrefs.edit(); - editor.putInt(PREVIOUS_INTERVAL, shortestInterval); - editor.commit(); - - if (shortestInterval == -1) { - nextCheck = -1; - pollingRequested = false; - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "No next check scheduled for package " + getApplication().getPackageName()); - cancel(); - } else { - long delay = (shortestInterval * (60 * 1000)); - long base = (previousInterval == -1 || lastCheckEnd == -1 || !considerLastCheckEnd ? System.currentTimeMillis() : lastCheckEnd); - long nextTime = base + delay; - if (K9.DEBUG) - Log.i(K9.LOG_TAG, - "previousInterval = " + previousInterval - + ", shortestInterval = " + shortestInterval - + ", lastCheckEnd = " + new Date(lastCheckEnd) - + ", considerLastCheckEnd = " + considerLastCheckEnd); - nextCheck = nextTime; - pollingRequested = true; - try { - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "Next check for package " + getApplication().getPackageName() + " scheduled for " + new Date(nextTime)); - } catch (Exception e) { - // I once got a NullPointerException deep in new Date(); - Log.e(K9.LOG_TAG, "Exception while logging", e); - } - - Intent i = new Intent(); - i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService"); - i.setAction(ACTION_CHECK_MAIL); - BootReceiver.scheduleIntent(MailService.this, nextTime, i); - - } + refreshPushers(); + schedulePushers(); } + }, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); + } + } + + private void reschedulePoll(final boolean hasConnectivity, final boolean doBackground, + boolean considerLastCheckEnd) { + + if (!(hasConnectivity && doBackground)) { + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "No connectivity, canceling check for " + + getApplication().getPackageName()); } - , K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); - } else { + nextCheck = -1; - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "No connectivity, canceling check for " + getApplication().getPackageName()); cancel(); + + return; + } + + Preferences prefs = Preferences.getPreferences(MailService.this); + SharedPreferences sPrefs = prefs.getPreferences(); + int previousInterval = sPrefs.getInt(PREVIOUS_INTERVAL, -1); + long lastCheckEnd = sPrefs.getLong(LAST_CHECK_END, -1); + + if (lastCheckEnd > System.currentTimeMillis()) { + Log.i(K9.LOG_TAG, "The database claims that the last time mail was checked was in " + + "the future (" + lastCheckEnd + "). To try to get things back to normal, " + + "the last check time has been reset to: " + System.currentTimeMillis()); + lastCheckEnd = System.currentTimeMillis(); + } + + int shortestInterval = -1; + for (Account account : prefs.getAccounts()) { + if (account.getAutomaticCheckIntervalMinutes() != -1 && + account.getFolderSyncMode() != FolderMode.NONE && + (account.getAutomaticCheckIntervalMinutes() < shortestInterval || + shortestInterval == -1)) { + shortestInterval = account.getAutomaticCheckIntervalMinutes(); + } + } + SharedPreferences.Editor editor = sPrefs.edit(); + editor.putInt(PREVIOUS_INTERVAL, shortestInterval); + editor.commit(); + + if (shortestInterval == -1) { + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "No next check scheduled for package " + + getApplication().getPackageName()); + } + + nextCheck = -1; + pollingRequested = false; + cancel(); + } else { + long delay = (shortestInterval * (60 * 1000)); + long base = (previousInterval == -1 || lastCheckEnd == -1 || + !considerLastCheckEnd ? System.currentTimeMillis() : lastCheckEnd); + long nextTime = base + delay; + + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "previousInterval = " + previousInterval + + ", shortestInterval = " + shortestInterval + + ", lastCheckEnd = " + new Date(lastCheckEnd) + + ", considerLastCheckEnd = " + considerLastCheckEnd); + } + + nextCheck = nextTime; + pollingRequested = true; + + try { + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "Next check for package " + + getApplication().getPackageName() + " scheduled for " + + new Date(nextTime)); + } + } catch (Exception e) { + // I once got a NullPointerException deep in new Date(); + Log.e(K9.LOG_TAG, "Exception while logging", e); + } + + Intent i = new Intent(); + i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService"); + i.setAction(ACTION_CHECK_MAIL); + BootReceiver.scheduleIntent(MailService.this, nextTime, i); } } @@ -286,131 +333,112 @@ public class MailService extends CoreService { return syncBlocked || (!pollingRequested && !pushingRequested); } - private void stopPushers(final Integer startId) { - execute(getApplication(), new Runnable() { - public void run() { - MessagingController.getInstance(getApplication()).stopAllPushing(); - PushService.stopService(MailService.this); - } - } - , K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); + private void stopPushers() { + MessagingController.getInstance(getApplication()).stopAllPushing(); + PushService.stopService(MailService.this); } - private void reschedulePushers(final boolean hasConnectivity, final boolean doBackground, final Integer startId) { - execute(getApplication(), new Runnable() { - public void run() { - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "Rescheduling pushers"); - stopPushers(null); - if (hasConnectivity && doBackground) { - setupPushers(null); - schedulePushers(startId); + private void reschedulePushers(boolean hasConnectivity, boolean doBackground) { + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "Rescheduling pushers"); + } + + stopPushers(); + + if (!(hasConnectivity && doBackground)) { + if (K9.DEBUG) { + Log.i(K9.LOG_TAG, "Not scheduling pushers: connectivity? " + hasConnectivity + + " -- doBackground? " + doBackground); + } + return; + } + + setupPushers(); + schedulePushers(); + } + + + private void setupPushers() { + boolean pushing = false; + for (Account account : Preferences.getPreferences(MailService.this).getAccounts()) { + if (K9.DEBUG) + Log.i(K9.LOG_TAG, "Setting up pushers for account " + account.getDescription()); + if (account.isAvailable(getApplicationContext())) { + pushing |= MessagingController.getInstance(getApplication()).setupPushing(account); + } else { + //TODO: setupPushing of unavailable accounts when they become available (sd-card inserted) + } + } + if (pushing) { + PushService.startService(MailService.this); + } + pushingRequested = pushing; + } + + private void refreshPushers() { + try { + long nowTime = System.currentTimeMillis(); + if (K9.DEBUG) + Log.i(K9.LOG_TAG, "Refreshing pushers"); + Collection pushers = MessagingController.getInstance(getApplication()).getPushers(); + for (Pusher pusher : pushers) { + long lastRefresh = pusher.getLastRefresh(); + int refreshInterval = pusher.getRefreshInterval(); + long sinceLast = nowTime - lastRefresh; + if (sinceLast + 10000 > refreshInterval) { // Add 10 seconds to keep pushers in sync, avoid drift + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "PUSHREFRESH: refreshing lastRefresh = " + lastRefresh + ", interval = " + refreshInterval + + ", nowTime = " + nowTime + ", sinceLast = " + sinceLast); + } + pusher.refresh(); + pusher.setLastRefresh(nowTime); } else { if (K9.DEBUG) { - Log.i(K9.LOG_TAG, "Not scheduling pushers: connectivity? " + hasConnectivity + " -- doBackground? " + doBackground); + Log.d(K9.LOG_TAG, "PUSHREFRESH: NOT refreshing lastRefresh = " + lastRefresh + ", interval = " + refreshInterval + + ", nowTime = " + nowTime + ", sinceLast = " + sinceLast); } } - } + // Whenever we refresh our pushers, send any unsent messages + if (K9.DEBUG) { + Log.d(K9.LOG_TAG, "PUSHREFRESH: trying to send mail in all folders!"); + } + + MessagingController.getInstance(getApplication()).sendPendingMessages(null); + + } catch (Exception e) { + Log.e(K9.LOG_TAG, "Exception while refreshing pushers", e); } - , K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, null); } - private void setupPushers(final Integer startId) { - execute(getApplication(), new Runnable() { - public void run() { - boolean pushing = false; - for (Account account : Preferences.getPreferences(MailService.this).getAccounts()) { - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "Setting up pushers for account " + account.getDescription()); - if (account.isAvailable(getApplicationContext())) { - pushing |= MessagingController.getInstance(getApplication()).setupPushing(account); - } else { - //TODO: setupPushing of unavailable accounts when they become available (sd-card inserted) - } - } - if (pushing) { - PushService.startService(MailService.this); - } - pushingRequested = pushing; + private void schedulePushers() { + int minInterval = -1; + + Collection pushers = MessagingController.getInstance(getApplication()).getPushers(); + for (Pusher pusher : pushers) { + int interval = pusher.getRefreshInterval(); + if (interval > 0 && (interval < minInterval || minInterval == -1)) { + minInterval = interval; } } - , K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); - } - - private void refreshPushers(final Integer startId) { - execute(getApplication(), new Runnable() { - public void run() { - try { - long nowTime = System.currentTimeMillis(); - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "Refreshing pushers"); - Collection pushers = MessagingController.getInstance(getApplication()).getPushers(); - for (Pusher pusher : pushers) { - long lastRefresh = pusher.getLastRefresh(); - int refreshInterval = pusher.getRefreshInterval(); - long sinceLast = nowTime - lastRefresh; - if (sinceLast + 10000 > refreshInterval) { // Add 10 seconds to keep pushers in sync, avoid drift - if (K9.DEBUG) { - Log.d(K9.LOG_TAG, "PUSHREFRESH: refreshing lastRefresh = " + lastRefresh + ", interval = " + refreshInterval - + ", nowTime = " + nowTime + ", sinceLast = " + sinceLast); - } - pusher.refresh(); - pusher.setLastRefresh(nowTime); - } else { - if (K9.DEBUG) { - Log.d(K9.LOG_TAG, "PUSHREFRESH: NOT refreshing lastRefresh = " + lastRefresh + ", interval = " + refreshInterval - + ", nowTime = " + nowTime + ", sinceLast = " + sinceLast); - } - } - } - // Whenever we refresh our pushers, send any unsent messages - if (K9.DEBUG) { - Log.d(K9.LOG_TAG, "PUSHREFRESH: trying to send mail in all folders!"); - } - - MessagingController.getInstance(getApplication()).sendPendingMessages(null); - - } catch (Exception e) { - Log.e(K9.LOG_TAG, "Exception while refreshing pushers", e); - } - } + if (K9.DEBUG) { + Log.v(K9.LOG_TAG, "Pusher refresh interval = " + minInterval); } - , K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); - } - - private void schedulePushers(final Integer startId) { - execute(getApplication(), new Runnable() { - public void run() { - int minInterval = -1; - - Collection pushers = MessagingController.getInstance(getApplication()).getPushers(); - for (Pusher pusher : pushers) { - int interval = pusher.getRefreshInterval(); - if (interval > 0 && (interval < minInterval || minInterval == -1)) { - minInterval = interval; - } - } - if (K9.DEBUG) { - Log.v(K9.LOG_TAG, "Pusher refresh interval = " + minInterval); - } - if (minInterval > 0) { - long nextTime = System.currentTimeMillis() + minInterval; - if (K9.DEBUG) - Log.d(K9.LOG_TAG, "Next pusher refresh scheduled for " + new Date(nextTime)); - Intent i = new Intent(); - i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService"); - i.setAction(ACTION_REFRESH_PUSHERS); - BootReceiver.scheduleIntent(MailService.this, nextTime, i); - } - } + if (minInterval > 0) { + long nextTime = System.currentTimeMillis() + minInterval; + if (K9.DEBUG) + Log.d(K9.LOG_TAG, "Next pusher refresh scheduled for " + new Date(nextTime)); + Intent i = new Intent(); + i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService"); + i.setAction(ACTION_REFRESH_PUSHERS); + BootReceiver.scheduleIntent(MailService.this, nextTime, i); } - , K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId); } @Override - public IBinder onBind(@SuppressWarnings("unused") Intent intent) { + public IBinder onBind(Intent intent) { + // Unused return null; } diff --git a/src/com/fsck/k9/service/PollService.java b/src/com/fsck/k9/service/PollService.java index b8d1b60e4..e7e471c30 100644 --- a/src/com/fsck/k9/service/PollService.java +++ b/src/com/fsck/k9/service/PollService.java @@ -35,6 +35,12 @@ public class PollService extends CoreService { context.startService(i); } + @Override + public void onCreate() { + super.onCreate(); + setAutoShutdown(false); + } + @Override public void startService(Intent intent, int startId) { if (START_SERVICE.equals(intent.getAction())) { diff --git a/src/com/fsck/k9/service/PushService.java b/src/com/fsck/k9/service/PushService.java index e773b042b..6be36629a 100644 --- a/src/com/fsck/k9/service/PushService.java +++ b/src/com/fsck/k9/service/PushService.java @@ -39,6 +39,13 @@ public class PushService extends CoreService { } + @Override + public void onCreate() { + super.onCreate(); + setAutoShutdown(false); + } + + @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub diff --git a/src/com/fsck/k9/view/MessageWebView.java b/src/com/fsck/k9/view/MessageWebView.java index d5a45a247..9871e503e 100644 --- a/src/com/fsck/k9/view/MessageWebView.java +++ b/src/com/fsck/k9/view/MessageWebView.java @@ -95,7 +95,7 @@ public class MessageWebView extends WebView { webSettings.setTextSize(K9.getFontSizes().getMessageViewContent()); - // Disable network images by default. This is overriden by preferences. + // Disable network images by default. This is overridden by preferences. blockNetworkData(true); } diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index 5b84fc57f..85afd51f3 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -24,6 +24,7 @@ import com.fsck.k9.crypto.PgpData; import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.*; +import com.fsck.k9.mail.internet.MimeHeader; import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.store.LocalStore; @@ -38,7 +39,7 @@ public class SingleMessageView extends LinearLayout { private MessageWebView mMessageContentView; private AccessibleWebView mAccessibleMessageContentView; private MessageHeader mHeaderContainer; - private LinearLayout mAttachments; + private LinearLayout mAttachments; private View mShowPicturesSection; private boolean mShowPictures; private Button mDownloadRemainder; @@ -197,9 +198,12 @@ public class SingleMessageView extends LinearLayout { // button wasn't already pressed, see if the user's preferences has us // showing them anyway. if (Utility.hasExternalImages(text) && !showPictures()) { + Address[] from = message.getFrom(); if ((account.getShowPictures() == Account.ShowPictures.ALWAYS) || ((account.getShowPictures() == Account.ShowPictures.ONLY_FROM_CONTACTS) && - mContacts.isInContacts(message.getFrom()[0].getAddress()))) { + // Make sure we have at least one from address + (from != null && from.length > 0) && + mContacts.isInContacts(from[0].getAddress()))) { setLoadPictures(true); } else { showShowPicturesSection(true); @@ -246,9 +250,8 @@ public class SingleMessageView extends LinearLayout { } } - public void renderAttachments(Part part, int depth, - - Message message, Account account, MessagingController controller, MessagingListener listener) throws MessagingException { + public void renderAttachments(Part part, int depth, Message message, Account account, + MessagingController controller, MessagingListener listener) throws MessagingException { if (part.getBody() instanceof Multipart) { Multipart mp = (Multipart) part.getBody(); @@ -261,7 +264,7 @@ public class SingleMessageView extends LinearLayout { // not attachments. Don't show attachment download buttons for them. if (contentDisposition != null && MimeUtility.getHeaderParameter(contentDisposition, null).matches("^(?i:inline)") - && part.getHeader("Content-ID") != null) { + && part.getHeader(MimeHeader.HEADER_CONTENT_ID) != null) { return; } AttachmentView view = (AttachmentView)mInflater.inflate(R.layout.message_view_attachment, null); @@ -272,11 +275,11 @@ public class SingleMessageView extends LinearLayout { } } - public void addAttachment(View attachmentView) { mAttachments.addView(attachmentView); mAttachments.setVisibility(View.VISIBLE); } + public void zoom(KeyEvent event) { if (mScreenReaderEnabled) { mAccessibleMessageContentView.zoomIn(); @@ -288,11 +291,11 @@ public class SingleMessageView extends LinearLayout { } } } + public void beginSelectingText() { mMessageContentView.emulateShiftHeld(); } - public void resetView() { setLoadPictures(false); mMessageContentView.scrollTo(0, 0); @@ -309,5 +312,4 @@ public class SingleMessageView extends LinearLayout { AttachmentView.AttachmentFileDownloadCallback attachmentCallback) { this.attachmentCallback = attachmentCallback; } - } diff --git a/tests/build.properties b/tests/ant.properties similarity index 100% rename from tests/build.properties rename to tests/ant.properties diff --git a/tests/build.xml b/tests/build.xml index 52538703e..7dd7a7b59 100644 --- a/tests/build.xml +++ b/tests/build.xml @@ -1,15 +1,14 @@ - + - - + + - - + - - + - - - - - - + + - @@ -53,32 +54,32 @@ - [This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}] + /* This is typically used for code obfuscation. + Compiled code location: ${out.classes.absolute.dir} + If this is not done in place, override ${out.dex.input.absolute.dir} */ --> - - - + + diff --git a/tests/proguard.cfg b/tests/proguard.cfg index 12dd0392c..b1cdf17b5 100644 --- a/tests/proguard.cfg +++ b/tests/proguard.cfg @@ -18,14 +18,18 @@ native ; } --keepclasseswithmembernames class * { +-keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); } --keepclasseswithmembernames class * { +-keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet, int); } +-keepclassmembers class * extends android.app.Activity { + public void *(android.view.View); +} + -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); diff --git a/tests/default.properties b/tests/project.properties similarity index 80% rename from tests/default.properties rename to tests/project.properties index 66db0d159..f049142c1 100644 --- a/tests/default.properties +++ b/tests/project.properties @@ -4,7 +4,7 @@ # This file must be checked in Version Control Systems. # # To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your +# "ant.properties", and override values to adapt the script to your # project structure. # Project target. diff --git a/tests/src/com/fsck/k9/helper/Address.java b/tests/src/com/fsck/k9/helper/Address.java new file mode 100644 index 000000000..250cad347 --- /dev/null +++ b/tests/src/com/fsck/k9/helper/Address.java @@ -0,0 +1,37 @@ +package com.fsck.k9.helper; +import junit.framework.TestCase; + +public class Address extends TestCase { + /** + * test the possibility to parse "From:" fields with no email. + * for example: From: News for Vector Limited - Google Finance + * http://code.google.com/p/k9mail/issues/detail?id=3814 + */ + public void testParseWithMissingEmail() { + com.fsck.k9.mail.Address[] addresses = com.fsck.k9.mail.Address.parse("NAME ONLY"); + assertEquals(1, addresses.length); + assertEquals(null, addresses[0].getAddress()); + assertEquals("NAME ONLY", addresses[0].getPersonal()); + } + + /** + * test name + valid email + */ + public void testPraseWithValidEmail() { + com.fsck.k9.mail.Address[] addresses = com.fsck.k9.mail.Address.parse("Max Mustermann "); + assertEquals(1, addresses.length); + assertEquals("maxmuster@mann.com", addresses[0].getAddress()); + assertEquals("Max Mustermann", addresses[0].getPersonal()); + } + /** + * test with multi email addresses + */ + public void testPraseWithValidEmailMulti() { + com.fsck.k9.mail.Address[] addresses = com.fsck.k9.mail.Address.parse("lorem@ipsum.us,mark@twain.com"); + assertEquals(2, addresses.length); + assertEquals("lorem@ipsum.us", addresses[0].getAddress()); + assertEquals(null, addresses[0].getPersonal()); + assertEquals("mark@twain.com", addresses[1].getAddress()); + assertEquals(null, addresses[1].getPersonal()); + } +}