From af77bbd1bce2a2014af7dbd4f3de21750cc29466 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Fri, 14 Mar 2014 12:47:41 -0400 Subject: [PATCH 1/8] Eliminate obsolete background data sync option It only applied to pre-ICS devices. ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED is no longer broadcast. ConnectivityManager.getBackgroundDataSetting() always returns true. --- res/values-ca/strings.xml | 2 -- res/values-cs/strings.xml | 2 -- res/values-da/strings.xml | 2 -- res/values-de/strings.xml | 2 -- res/values-el/strings.xml | 2 -- res/values-es/strings.xml | 2 -- res/values-eu/strings.xml | 2 -- res/values-fi/strings.xml | 2 -- res/values-fr/strings.xml | 2 -- res/values-gl/strings.xml | 2 -- res/values-hu/strings.xml | 2 -- res/values-it/strings.xml | 2 -- res/values-iw/strings.xml | 2 -- res/values-ja/strings.xml | 2 -- res/values-ko/strings.xml | 2 -- res/values-lt/strings.xml | 2 -- res/values-nl/strings.xml | 2 -- res/values-pl/strings.xml | 2 -- res/values-pt-rBR/strings.xml | 2 -- res/values-ru/strings.xml | 2 -- res/values-sk/strings.xml | 2 -- res/values-sv/strings.xml | 2 -- res/values-tr/strings.xml | 2 -- res/values-uk/strings.xml | 2 -- res/values-zh-rCN/strings.xml | 2 -- res/values-zh-rTW/strings.xml | 2 -- res/values/arrays.xml | 5 +--- res/values/strings.xml | 2 -- src/com/fsck/k9/K9.java | 12 ++++---- src/com/fsck/k9/activity/setup/Prefs.java | 30 +------------------ .../fsck/k9/preferences/GlobalSettings.java | 2 +- .../k9/remotecontrol/K9RemoteControl.java | 3 +- src/com/fsck/k9/service/BootReceiver.java | 6 ---- src/com/fsck/k9/service/MailService.java | 11 +------ .../fsck/k9/service/RemoteControlService.java | 3 +- 35 files changed, 13 insertions(+), 113 deletions(-) diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index b381e35a8..5a6e5b2d1 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -650,8 +650,6 @@ Si us plau, envia\'ns els errors, contribueix a millorar-lo a Sincronització 2n pla Mai Sempre - Quan s\'està comprovant \'Dades en segon pla\' - Quan s\'està comprovant \'Dades en segon pla\' i \'Sincronització Automàtica\' Quan la Sincronització Automàtica està activada Selecciona-ho tot Carpetes màximes a comprovar diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index f9fb3a9cb..042f25256 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -650,8 +650,6 @@ Posílejte prosím chybová hlášení, přispívejte novými funkcemi a ptejte Synchronizace na pozadí Nikdy Vždy - Je-li \'Data na pozadí\' zaškrtnuto - Jsou-li \'Data na pozadí\' a \'Aut. synchronizace\' zaškrtnuty Jsou-li \'Aut. synchronizace\' zaškrtnuty Vybrat vše Max. počet složek řízených PUSH diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 6ede4a08a..3976662eb 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -644,8 +644,6 @@ Vær venlig at sende fejlrapporter, anmodning om nye funktioner, og spørgsmål Baggrundssynkronisering Aldrig Altid - Når \"Baggrundsdata\" er aktiveret - Når \"Baggrundsdata\" & \"Auto-sync\" er aktiveret Når \"Auto-sync\" er valgt Vælg alle Max antal mapper som skal kontrolleres ved push diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 416695a6e..25cd1f239 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -657,8 +657,6 @@ Um Fehler zu melden, neue Funktionen vorzuschlagen oder Fragen zu stellen, besuc Hintergrund-Synchronisierung Nie Immer - Wenn \'Hintergrunddaten\' aktiviert ist - Wenn \'Hintergrunddaten\' & \'Automatische Synchronisation\' aktiviert sind Wenn \'Automatische Synchronisation\' aktiviert ist Alle auswählen Maximale Push-Ordner-Anzahl diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index 6ac9cba4e..a63cdcf7e 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -649,8 +649,6 @@ Συγχρονισμός στο παρασκήνιο Ποτέ Πάντοτε - Όταν ελέγχονται \'Δεδομένα παρασκηνίου\' - Όταν ελέγχονται \'Δεδομένα παρασκηνίου\' & \'Αυτόματο συγχρονισμός\' Όταν έχει επιλεγεί \'Auto-sync\' Επιλογή όλων Μέγιστο φακέλων για σπρώξιμο diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index b4d54c72d..ecf36f6e0 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -659,8 +659,6 @@ Por favor, envía los errores detectados, contribuye con nuevas funcionalidades Sincronizar en segundo plano Nunca Siempre - Cuando \'Sincronización en segundo plano\' esté activo - Cuando \'Sincronización en segundo plano\' y \'Sincronización automática\' estén activos Cuando \'sincronización automática\' esté activo Seleccionar todos Max. carpetas Push diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml index fbbb69a73..e98561b20 100644 --- a/res/values-eu/strings.xml +++ b/res/values-eu/strings.xml @@ -650,8 +650,6 @@ Arazoen berri emateko, ezaugarri berriak gehitzeko eta galderak egiteko Atzeko planoko sinkronizazioa Inoiz ez Beti - \'Background data\' gaituta dagoenean - \'Background data\' eta \'Auto-sinkronizazioa\' gaituta daudenean \'Auto-sinkronizazioa\' gaituta dagoenean Guztia hautatu Push erabiliz egiaztatuko diren karpeta kopuru maximoa diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index a9ca5df74..00dea5bef 100755 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -659,8 +659,6 @@ Virheraportit, osallistuminen projektiin ja kysymykset: Mene osoitteeseen Synkronointi taustalla Ei koskaan Aina - Kun Taustadata on valittu - Kun \'Taustadata\' ja \'Automaattinen synkronointi\' on valittu Kun Automaattinen synkronointi on valittu Valitse kaikki Push-tilassa tarkistettavien kansioiden enimmäismäärä diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 9d360b4a2..716c20872 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -658,8 +658,6 @@ jusqu\'à %d de plus Synchronisation en arrière-plan Jamais Toujours - Lorsque «\u00A0Données en arrière-plan\u00A0» est activé - Lorsque «\u00A0Données en arrière-plan\u00A0» et «\u00A0Synchronisation auto\u00A0» sont activés Lorsque «\u00A0Synchronisation auto\u00A0» est activée Sélectionner tout Maximum de dossiers avec le pousser à vérifier diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 4ab4b8c91..2b7831b23 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -582,8 +582,6 @@ Por favor, envía os erros detectados, contribúe con novas funcionalidas e preg Sincronizar en segundo plano Nunca Sempre - Cando \'Sincronización en segundo plano\' esté activo - Cando \'Sincronización en segundo plano\' e \'Sincronización automática\' estén activos Seleccionar todos Max. subscripcións 10 carpetas diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 861eb4629..a8c36d436 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -638,8 +638,6 @@ Hibajelentéseivel hozzájárul az újabb verziók tökéletesítéséhez, kérd Háttérszinkronizálás Soha Mindig - Ha a \'Háttéradatok\' bekapcsolva - Ha a \'Háttéradatok\' és \'Auto-szink\' bekapcsolva Amikor az \'Automatikus szinkronizáció\' be van kapcsolva Mindent kijelöl Ellenőrizhető mappák száma diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index f8fd28742..88768fa6a 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -659,8 +659,6 @@ Invia le tue segnalazioni, suggerisci nuove funzionalità e chiedi informazioni Sincronizzazione in background Mai Sempre - Quando \'Dati in background\' è selezionato - Quando \'Dati in background\' e \'Sincronizzazione automatica\' sono selezionati Quando \'Sincronizzazione automatica\' è selezionato Seleziona tutto Max cartelle Push diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml index 01941c594..8381a0ebe 100644 --- a/res/values-iw/strings.xml +++ b/res/values-iw/strings.xml @@ -549,8 +549,6 @@ סנכרון ברקע אף פעם תמיד - "מתי ש\'נתונים ברקע\' מסומן " - "מתי ש\'נתונים ברקע\' ו\'סינכרון אוטומטי\' מסומנים " בחר הכל מקסימום תיקיות כדי לבדוק עם דחיפה 10 תיקיות diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 63904211e..1e7fa6a06 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -659,8 +659,6 @@ K-9 は大多数のメールクライアントと同様に、ほとんどのフ バックグラウンド同期 使用しない 常時利用 - バックグランドデータがチェックされた時 - バックグランドデータと自動同期がチェックされた時 自動同期がチェックされた時 全選択 プッシュ受信の最大フォルダ数 diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 6eddc0d46..c49dc23b1 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -648,8 +648,6 @@ K-9 메일은 대부분의 무료 hotmail 계정을 지원하지 않으며, 다 백그라운드 동기화 하지 않음 항상 - \'백그라운드 데이터\'가 선택된 경우 - \'백그라운드 데이터\'와 \'자동 동기화\'가 선택된 경우 \'자동 동기화\' 가 선택된 경우 모두 선택 푸시할 때 점검할 최대 폴더 수 diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml index c76360002..5dd3417cf 100644 --- a/res/values-lt/strings.xml +++ b/res/values-lt/strings.xml @@ -651,8 +651,6 @@ Praneškite apie klaidas, pridėkite naujų galimybių ir užduokite klausimus m Sinchronizuoti fone Niekada Visada - Kai pažymėta „Fono duomenys“ - Kai pažymėta „Fono duomenys“ ir „Automatinis sinchronizavimas“ Kai pažymėtas „automatinis sinchronizavimas“ Pasirinkti viską Kiek daugiausia aplankų tikrinti siunčiant diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index cb4442a05..ac31c51b6 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -649,8 +649,6 @@ Graag foutrapporten, bijdrage nieuwe functies en vragen stellen op Achtergrond sync Nooit Altijd - Wanneer \'Achtergrond data\' is aangevinkt - Wanneer \'Achtergrond data\' & \'Auto-sync\' zijn aangevinkt Als \'Auto-sync\' geselecteerd is Selecteer alle Max mappen om te controleren met push diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index b92ea6075..b979413f1 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -649,8 +649,6 @@ Wszelkie zgłoszenia usterek, zapytania oraz nowe pomysły prosimy przesyłać z Synchronizacja w tle Nigdy Zawsze - Gdy systemowa opcja \'Dane w tle\' jest włączone - Gdy systemowe opcje \'Dane w tle\' oraz \'Autosynchronizacja\' są włączone Gdy \'Autosynchronizacja\' jest włączona Zaznacz wszystko Sprawdzanie przez Push diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 8eed57cfd..ee4dfbb8d 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -645,8 +645,6 @@ Por favor, nos envie relatórios de bugs, contribua para novas melhorias e faça Sincronização em segundo plano Nunca Sempre - Quando \'Dados em segundo plano\' estiverem ativados - Quando \'Dados de segundo plano\' e \'Auto-sinc\' estiverem ativados Quando \'Auto-sinc\' estiver ativada Selecionar todos Máximo de pastas para verificar com push diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 14a0e9c18..2bb1787a9 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -658,8 +658,6 @@ K-9 Mail — почтовый клиент для Android. Фоновая синхронизация Никогда Всегда - Фоновые данные вкл. - Фоновые данные и Автосинхронизация вкл. Автосинхронизация вкл. Выбрать все Лимит push-проверки diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml index e1150e1db..ce704c532 100644 --- a/res/values-sk/strings.xml +++ b/res/values-sk/strings.xml @@ -658,8 +658,6 @@ Prosím, nahlasujte prípadné chyby, prispievajte novými funkciami a pýtajte Synchronizácia na pozadí Nikdy Vždy - Keď je možnosť \'Dáta na pozadí\" zaškrtnutá - Keď sú možnosti \'Dáta na pozadí\' & \'Automatická synchronizácia\' zaškrtnuté Keď je možnosť \'Automatická synchronizácia\' zaškrtnutá Vybrať všetko Maximálny počet priečinkov na kontrolu pomocou push diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 958eda2c4..8a2eeaabe 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -650,8 +650,6 @@ Vänligen skicka felrapporter, hjälp till med nya funktioner och ställ frågor Bakgrundssynkronisering Aldrig Alltid - När \'Bakgrundsdata\' är aktiverad - När \'Bakgrundsdata\' & \'Auto-sync\' är aktiverade Endast när \'Auto-sync\' är aktiverad Markera alla Max antal mappar att kontrollera med push diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 8c308d2dd..6ae38e9a1 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -601,8 +601,6 @@ Lütfen hata raporlarınızı, istediğiniz yeni özellikleri ve sorularınızı Arkaplan senkronizasyonu Asla Daima - \'Arkaplan verisi\' işaretli olduğu zaman - \'Arkaplan verisi\' & \'Oto. Senk.\' işaretli olduğu zaman Hepsini Seç Push ile en fazla kontrol edilecek klasör sayısı 10 klasör diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index 788e9a7cc..d547635e9 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -647,8 +647,6 @@ K-9 Mail це поштовий клієнт з відкритим вихідни Фонова синхронізація Ніколи Завжди - Коли \'Фонові дані\' включено - Коли \'Фонові дані\' та \'Автосинхронізація\' включено Коли \"Автосинхронізація\" увімкнена Вибрати усе Найбільша кількість папок для перевірки з push diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 5ce460cbd..7abf66e30 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -648,8 +648,6 @@ K-9改进的功能包括: 后台同步 从不 总是 - 当“后台数据”被选中 - 当“后台数据”&“自动同步”被选中 当“自动同步”已选定 选择全部 推送时最多检查文件夹数量 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 67d0e4bff..8106628d7 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -620,8 +620,6 @@ 背景同步 不要 預設 - 當「背景資料」被勾選 - 當「背景資料」&「自動同步」被勾選 當「自動同步」被勾選 選擇全部 推送時檢查信件匣上限數量 diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 45e0314e1..953e9cb83 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -522,16 +522,13 @@ global - - @string/background_ops_enabled - @string/background_ops_auto_sync + @string/background_ops_auto_sync_only @string/background_ops_always @string/background_ops_never - WHEN_CHECKED WHEN_CHECKED_AUTO_SYNC ALWAYS NEVER diff --git a/res/values/strings.xml b/res/values/strings.xml index 22d7b8c0c..bc991098b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -800,8 +800,6 @@ Please submit bug reports, contribute new features and ask questions at Background sync Never Always - When \'Background data\' is checked - When \'Background data\' & \'Auto-sync\' are checked When \'Auto-sync\' is checked Select all diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java index 0c320bafd..897ddeca2 100644 --- a/src/com/fsck/k9/K9.java +++ b/src/com/fsck/k9/K9.java @@ -102,7 +102,7 @@ public class K9 extends Application { private static boolean sInitialized = false; public enum BACKGROUND_OPS { - WHEN_CHECKED, ALWAYS, NEVER, WHEN_CHECKED_AUTO_SYNC + ALWAYS, NEVER, WHEN_CHECKED_AUTO_SYNC } private static String language = ""; @@ -113,7 +113,7 @@ public class K9 extends Application { private static final FontSizes fontSizes = new FontSizes(); - private static BACKGROUND_OPS backgroundOps = BACKGROUND_OPS.WHEN_CHECKED; + private static BACKGROUND_OPS backgroundOps = BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC; /** * Some log messages can be sent to a file, so that the logs * can be read using unprivileged access (eg. Terminal Emulator) @@ -509,7 +509,7 @@ public class K9 extends Application { public static void save(SharedPreferences.Editor editor) { editor.putBoolean("enableDebugLogging", K9.DEBUG); editor.putBoolean("enableSensitiveLogging", K9.DEBUG_SENSITIVE); - editor.putString("backgroundOperations", K9.backgroundOps.toString()); + editor.putString("backgroundOperations", K9.backgroundOps.name()); editor.putBoolean("animations", mAnimations); editor.putBoolean("gesturesEnabled", mGesturesEnabled); editor.putBoolean("useVolumeKeysForNavigation", mUseVolumeKeysForNavigation); @@ -795,9 +795,11 @@ public class K9 extends Application { fontSizes.load(sprefs); try { - setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString("backgroundOperations", "WHEN_CHECKED"))); + setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString( + "backgroundOperations", + BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC.name()))); } catch (Exception e) { - setBackgroundOps(BACKGROUND_OPS.WHEN_CHECKED); + setBackgroundOps(BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC); } sColorizeMissingContactPictures = sprefs.getBoolean("colorizeMissingContactPictures", true); diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index b427a2031..3691569aa 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -12,7 +12,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.ListPreference; @@ -352,34 +351,7 @@ public class Prefs extends K9PreferenceActivity { mNotificationQuickDelete = null; } - mBackgroundOps = setupListPreference(PREFERENCE_BACKGROUND_OPS, K9.getBackgroundOps().toString()); - // In ICS+ there is no 'background data' setting that apps can chose to ignore anymore. So - // we hide that option for "Background Sync". - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - CharSequence[] oldEntries = mBackgroundOps.getEntries(); - CharSequence[] newEntries = new CharSequence[3]; - // Use "When 'Auto-sync' is checked" instead of "When 'Background data' & 'Auto-sync' - // are checked" as description. - newEntries[0] = getString(R.string.background_ops_auto_sync_only); - newEntries[1] = oldEntries[2]; - newEntries[2] = oldEntries[3]; - - CharSequence[] oldValues = mBackgroundOps.getEntryValues(); - CharSequence[] newValues = new CharSequence[3]; - newValues[0] = oldValues[1]; - newValues[1] = oldValues[2]; - newValues[2] = oldValues[3]; - - mBackgroundOps.setEntries(newEntries); - mBackgroundOps.setEntryValues(newValues); - - // Since ConnectivityManager.getBackgroundDataSetting() always returns 'true' on ICS+ - // we map WHEN_CHECKED to ALWAYS. - if (K9.getBackgroundOps() == K9.BACKGROUND_OPS.WHEN_CHECKED) { - mBackgroundOps.setValue(K9.BACKGROUND_OPS.ALWAYS.toString()); - mBackgroundOps.setSummary(mBackgroundOps.getEntry()); - } - } + mBackgroundOps = setupListPreference(PREFERENCE_BACKGROUND_OPS, K9.getBackgroundOps().name()); mUseGalleryBugWorkaround = (CheckBoxPreference)findPreference(PREFERENCE_GALLERY_BUG_WORKAROUND); mUseGalleryBugWorkaround.setChecked(K9.useGalleryBugWorkaround()); diff --git a/src/com/fsck/k9/preferences/GlobalSettings.java b/src/com/fsck/k9/preferences/GlobalSettings.java index 4f1d089c0..47a552846 100644 --- a/src/com/fsck/k9/preferences/GlobalSettings.java +++ b/src/com/fsck/k9/preferences/GlobalSettings.java @@ -44,7 +44,7 @@ public class GlobalSettings { )); s.put("backgroundOperations", Settings.versions( new V(1, new EnumSetting( - K9.BACKGROUND_OPS.class, K9.BACKGROUND_OPS.WHEN_CHECKED)) + K9.BACKGROUND_OPS.class, K9.BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC)) )); s.put("changeRegisteredNameColor", Settings.versions( new V(1, new BooleanSetting(false)) diff --git a/src/com/fsck/k9/remotecontrol/K9RemoteControl.java b/src/com/fsck/k9/remotecontrol/K9RemoteControl.java index 21122e3f0..279331988 100644 --- a/src/com/fsck/k9/remotecontrol/K9RemoteControl.java +++ b/src/com/fsck/k9/remotecontrol/K9RemoteControl.java @@ -100,10 +100,9 @@ public class K9RemoteControl { /** * Key for the {@link Intent} Extra to set for controlling K-9's global "Background sync" setting. * Acceptable values are K9_BACKGROUND_OPERATIONS_ALWAYS, K9_BACKGROUND_OPERATIONS_NEVER - * K9_BACKGROUND_OPERATIONS_WHEN_CHECKED + * K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC */ public final static String K9_BACKGROUND_OPERATIONS = "com.fsck.k9.K9RemoteControl.backgroundOperations"; - public final static String K9_BACKGROUND_OPERATIONS_WHEN_CHECKED = "WHEN_CHECKED"; public final static String K9_BACKGROUND_OPERATIONS_ALWAYS = "ALWAYS"; public final static String K9_BACKGROUND_OPERATIONS_NEVER = "NEVER"; public final static String K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC = "WHEN_CHECKED_AUTO_SYNC"; diff --git a/src/com/fsck/k9/service/BootReceiver.java b/src/com/fsck/k9/service/BootReceiver.java index 8f4120655..6ef20f1fe 100644 --- a/src/com/fsck/k9/service/BootReceiver.java +++ b/src/com/fsck/k9/service/BootReceiver.java @@ -46,12 +46,6 @@ public class BootReceiver extends CoreReceiver { MailService.actionReset(context, tmpWakeLockId); tmpWakeLockId = null; } - } else if (ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED.equals(action)) { - K9.BACKGROUND_OPS bOps = K9.getBackgroundOps(); - if (bOps == K9.BACKGROUND_OPS.WHEN_CHECKED || bOps == K9.BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC) { - MailService.actionReset(context, tmpWakeLockId); - tmpWakeLockId = null; - } } else if (FIRE_INTENT.equals(action)) { Intent alarmedIntent = intent.getParcelableExtra(ALARMED_INTENT); String alarmedAction = alarmedIntent.getAction(); diff --git a/src/com/fsck/k9/service/MailService.java b/src/com/fsck/k9/service/MailService.java index bb3a84d3a..6a1fde5b0 100644 --- a/src/com/fsck/k9/service/MailService.java +++ b/src/com/fsck/k9/service/MailService.java @@ -8,7 +8,6 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.net.ConnectivityManager; import android.os.IBinder; import android.util.Log; @@ -86,14 +85,9 @@ public class MailService extends CoreService { public int startService(Intent intent, int startId) { long startTime = System.currentTimeMillis(); boolean oldIsSyncDisabled = isSyncDisabled(); - ConnectivityManager connectivityManager = (ConnectivityManager)getApplication().getSystemService(Context.CONNECTIVITY_SERVICE); boolean doBackground = true; - boolean backgroundData = false; final boolean hasConnectivity = Utility.hasConnectivity(getApplication()); - if (connectivityManager != null) { - backgroundData = connectivityManager.getBackgroundDataSetting(); - } boolean autoSync = ContentResolver.getMasterSyncAutomatically(); K9.BACKGROUND_OPS bOps = K9.getBackgroundOps(); @@ -105,11 +99,8 @@ public class MailService extends CoreService { case ALWAYS: doBackground = true; break; - case WHEN_CHECKED: - doBackground = backgroundData; - break; case WHEN_CHECKED_AUTO_SYNC: - doBackground = backgroundData & autoSync; + doBackground = autoSync; break; } diff --git a/src/com/fsck/k9/service/RemoteControlService.java b/src/com/fsck/k9/service/RemoteControlService.java index 21f204fb3..126c71e28 100644 --- a/src/com/fsck/k9/service/RemoteControlService.java +++ b/src/com/fsck/k9/service/RemoteControlService.java @@ -113,8 +113,7 @@ public class RemoteControlService extends CoreService { String backgroundOps = intent.getStringExtra(K9_BACKGROUND_OPERATIONS); if (K9RemoteControl.K9_BACKGROUND_OPERATIONS_ALWAYS.equals(backgroundOps) || K9RemoteControl.K9_BACKGROUND_OPERATIONS_NEVER.equals(backgroundOps) - || K9RemoteControl.K9_BACKGROUND_OPERATIONS_WHEN_CHECKED.equals(backgroundOps) - || K9RemoteControl.K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC.equals(backgroundOps)) { + || K9RemoteControl.K9_BACKGROUND_OPERATIONS_WHEN_CHECKED_AUTO_SYNC.equals(backgroundOps)) { BACKGROUND_OPS newBackgroundOps = BACKGROUND_OPS.valueOf(backgroundOps); boolean needsReset = K9.setBackgroundOps(newBackgroundOps); needsPushRestart |= needsReset; From 8166f03e87ac1274fbd76e341ddb0abccd21403b Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 16 Aug 2014 19:39:18 -0400 Subject: [PATCH 2/8] Remove obsolete "Show unread count" preference Only applies to pre-Honeycomb devices --- res/values-ca/strings.xml | 2 -- res/values-cs/strings.xml | 2 -- res/values-da/strings.xml | 2 -- res/values-de/strings.xml | 2 -- res/values-el/strings.xml | 2 -- res/values-es/strings.xml | 2 -- res/values-eu/strings.xml | 2 -- res/values-fi/strings.xml | 2 -- res/values-fr/strings.xml | 2 -- res/values-gl/strings.xml | 2 -- res/values-hu/strings.xml | 2 -- res/values-it/strings.xml | 2 -- res/values-iw/strings.xml | 2 -- res/values-ja/strings.xml | 2 -- res/values-ko/strings.xml | 2 -- res/values-lt/strings.xml | 2 -- res/values-nl/strings.xml | 2 -- res/values-pl/strings.xml | 2 -- res/values-pt-rBR/strings.xml | 2 -- res/values-ru/strings.xml | 2 -- res/values-sk/strings.xml | 2 -- res/values-sv/strings.xml | 2 -- res/values-tr/strings.xml | 2 -- res/values-uk/strings.xml | 2 -- res/values-zh-rCN/strings.xml | 2 -- res/values-zh-rTW/strings.xml | 2 -- res/values/strings.xml | 2 -- res/xml/account_settings_preferences.xml | 7 ------ src/com/fsck/k9/Account.java | 13 ---------- .../k9/activity/setup/AccountSettings.java | 25 ------------------- .../k9/controller/MessagingController.java | 10 +------- .../fsck/k9/preferences/AccountSettings.java | 3 --- 32 files changed, 1 insertion(+), 111 deletions(-) diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index 5a6e5b2d1..aae5b07f8 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -417,8 +417,6 @@ Si us plau, envia\'ns els errors, contribueix a millorar-lo a Mostra una notificació per als missatges que enviïs Notificació obre missatges no llegits Cerca de missatges no llegits quan s\'ha obert la notificació. - Mostra correu no llegit - Mostra el nombre de missatges no llegits a la barra de notificació. Marca el missatge obert com a llegit Marca el missatge com a llegit després d\'haver-lo obert. Sempre mostra imatges diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 042f25256..80855a8b0 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -417,8 +417,6 @@ Posílejte prosím chybová hlášení, přispívejte novými funkcemi a ptejte Oznamovat i v případě odeslání pošty s identitou účtu Oznámení otevírá nepřečtené zprávy Vyhledává nepřečtené zprávy, je-li otevřeno oznámení - Zobrazit počet nepřečtených - Zobrazit počet nepřečtených zpráv v řádky upozornení. Označit jako přečtenou po otevření Označit zprávu jako přečtenou po otevření Vždy zobrazovat obrázky diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 3976662eb..c13643c91 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -412,8 +412,6 @@ Vær venlig at sende fejlrapporter, anmodning om nye funktioner, og spørgsmål Vis besked for mails sendt af mig Klik på besked, viser ulæste mails Søger efter ulæste mails når besked vises - Vis antal ulæste mails - Vis antallet af ulæste mails i statusbar. Marker som læst ved åbning Marker som læst når meddelses åbnes for læsning Vis altid billeder diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 25cd1f239..d7c787b38 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -424,8 +424,6 @@ Um Fehler zu melden, neue Funktionen vorzuschlagen oder Fragen zu stellen, besuc Benachrichtigungen für Nachrichten, die eine Ihrer eigenen E-Mail-Adressen als Absender tragen Ungelesene Nachrichten öffnen Beim Öffnen einer Benachrichtigung Liste der ungelesenen Nachrichten anzeigen - Anzahl anzeigen - Anzahl der ungelesenen Nachrichten in der Statuszeile anzeigen Beim Öffnen als gelesen markieren Nachricht als gelesen markieren, sobald sie zum Betrachten geöffnet wird Bilder automatisch anzeigen diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index a63cdcf7e..1c39f154b 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -416,8 +416,6 @@ Προβολή ειδοποίησης για μηνύματα που απέστειλα Η ειδοποίηση ανοίγει μη αναγνωσμένα μηνύματα Αναζητά μη αναγνωσμένα μηνύματα όταν ανοίγεται η ειδοποίηση - Προβολή πλήθους μη αναγνωσμένων - Προβολή πλήθους μη αναγνωσμένων μηνυμάτων στη γραμμή κατάστασης. Σημείωση ως αναγνωσμένου με την ανάγνωση Σημείωση ως αναγνωσμένου με την προβολή Προβολή εικόνων πάντα diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index ecf36f6e0..9275a4561 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -426,8 +426,6 @@ Por favor, envía los errores detectados, contribuye con nuevas funcionalidades Mostrar notificaciones durante el envío de correo Abrir correo no leído Abrir correo no leído desde la notificación - Mostrar número de mensajes no leídos - Mostrar número de mensajes no leídos en barra de notificaciones. Marcar mensaje como leído al abrirlo Marcar mensaje como leído cuando se abre para verlo Mostrar imágenes siempre diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml index e98561b20..962e20c08 100644 --- a/res/values-eu/strings.xml +++ b/res/values-eu/strings.xml @@ -417,8 +417,6 @@ Arazoen berri emateko, ezaugarri berriak gehitzeko eta galderak egiteko Bidaltzen ditudan mezuetarako jakinarazpena ikusi Jakinarazpenak irakurgabeko mezuak irekitzen ditu Jakinarazpena irekitzean irakurri gabeko mezuak bilatu - Irakurgabeko kopurua ikusi - Irakurgabeko mezu kopurua ikusi jakinarazpen barran. Irekitzean irakurrita markatu Mezu bat irekitzerakoan irakurri bezala markatu Irudiak beti ikusi diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index 00dea5bef..3a5e5f230 100755 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -426,8 +426,6 @@ Virheraportit, osallistuminen projektiin ja kysymykset: Mene osoitteeseen Näytä ilmoitus lähettämistäni viesteistä Ilmoitus avaa lukemattomat viestit Etsii lukemattomia viestejä, kun ilmoitus avataan - Näytä lukemattomien viestien määrä - Näytä lukemattomien viestien määrä ilmoituspalkissa. Merkitse viesti luetuksi avattaessa Merkitse viesti luetuksi, kun se avataan katseltavaksi Näytä aina kuvat diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 716c20872..085a03b82 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -425,8 +425,6 @@ jusqu\'à %d de plus Afficher une notification pour les messages que j\'ai envoyés La notification ouvre les messages non lus Recherche des messages non lus lors de l\'accès aux notifications - Afficher le nombre de non lus - Afficher le nombre de messages non lus dans la barre de notification Marquer comme lu à l\'ouverture Marquer un message comme lu à quand il est ouvert pour être visualisé Toujours afficher les images diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 2b7831b23..535c698c9 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -355,8 +355,6 @@ Por favor, envía os erros detectados, contribúe con novas funcionalidas e preg Amosar notificacións durante o envío de correo Abrir correo non lido Abrir correo non lido dende a notificación - Amosar número de mensaxes non lidos - Amosar número de mensaxen non lidos na barra de notificacións. Amosar imaxes Nunca Só dos meuis contactos diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index a8c36d436..336a5cdb7 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -411,8 +411,6 @@ Hibajelentéseivel hozzájárul az újabb verziók tökéletesítéséhez, kérd Mutassa az állapotsoron ha a küldés sikeres volt Értesítés megnyitása Értesítésre kattintva megnyitja az olvasatlan üzeneteket - Olvasatlanok kijelzése - Olvasatlan levelek száma az állapotsoron. Üzenet megjelölése olvasottnak megnyitáskor Olvasottnak jelöli az üzenetet, ha megnézik Képek megjelenítése diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 88768fa6a..000752fa5 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -426,8 +426,6 @@ Invia le tue segnalazioni, suggerisci nuove funzionalità e chiedi informazioni Mostra una notifica per i messaggi che ho inviato Notifica apre i messaggi non letti Ricerca non letti quando Notifiche è aperto - Mostra numero messaggi non letti - Mostra il numero dei messaggi non letti nella barra di notifica. Marca messaggio come letto all\'apertura Marca un messaggio come letto quando viene aperto per la visualizzazione Mostra sempre le immagini diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml index 8381a0ebe..8142b0f06 100644 --- a/res/values-iw/strings.xml +++ b/res/values-iw/strings.xml @@ -350,8 +350,6 @@ הצג התראה להודעות ששלחתי ההתראה פותחת הודעות שלא נקראו חיפוש אחר הודעות שלא נקראו כאשר ההתראה נפתחת - הצג מספר שלא נקראו - הצג את מספר ההודעות שלא נקראו בשורת ההתראות. תמיד הצג תמונות לא מאנשי הקשר diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 1e7fa6a06..3355dcc62 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -426,8 +426,6 @@ K-9 は大多数のメールクライアントと同様に、ほとんどのフ このアカウントからのメールも通知する 未読メール通知の動作 通知を開いた際に未読メールを検索する - 未読件数の表示 - 通知バーに未読メッセージの件数を表示する 開くと同時に既読にする メッセージを参照したときに既読にする 画像を自動で表示 diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index c49dc23b1..9a5840da7 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -415,8 +415,6 @@ K-9 메일은 대부분의 무료 hotmail 계정을 지원하지 않으며, 다 내가 보낸 메시지에 대해 알림 보기 읽지 않은 메일에 대해 알림 알림을 열 때 읽지 않은 메일을 찾습니다 - 읽지 않은 메일 수 세기 - 읽지 않은 메시지의 수를 상태바에 보여 줍니다 열어서 메시지를 읽은 것으로 표시 메시지를 열면 읽은 것으로 표시합니다 항상 그림 보기 diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml index 5dd3417cf..16659e6a2 100644 --- a/res/values-lt/strings.xml +++ b/res/values-lt/strings.xml @@ -418,8 +418,6 @@ Praneškite apie klaidas, pridėkite naujų galimybių ir užduokite klausimus m Rodyti pranešimą mano išsiųstiems laiškams Pranešimas atveria neskaitytus laiškus Atvėrus pranešimą ieško neskaitytų laiškų - Rodyti neskaitytų skaičių - Pranešimų juostoje rodyti neskaitytų laiškų skaičių. Atvėrus pažymėti kaip skaitytą Kai laiškas atveriamas peržiūrai pažymėti jį kaip skaitytą Visada rodyti paveikslėlius diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index ac31c51b6..f92fb9bc0 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -416,8 +416,6 @@ Graag foutrapporten, bijdrage nieuwe functies en vragen stellen op Notificatie ook voor mail verzonden vanaf een identiteit Notificatie opent ongelezen berichten Zoekt voor ongelezen berichten wanneer Notificatie is geopend - Toon aantal ongelezen - Toon het aantal ongelezen berichten in de \'notification bar\'. Markeer als gelezen als geopend Markeer als gelezen wanneer ingezien Laat afbeeldingen automatisch zien diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index b979413f1..64857a5a6 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -416,8 +416,6 @@ Wszelkie zgłoszenia usterek, zapytania oraz nowe pomysły prosimy przesyłać z Powiadamiaj również o wiadomościach, które sam wysłałem Nowe nieprzeczytane Powiadomienie o nieprzeczytanych wiadomościach - Liczba nieprzeczytanych - Pokaż liczbę nieprzeczytanych wiadomości w pasku powiadomień Oznacz jako przeczytane Oznacz wiadomość jako przeczytaną przy otwieraniu Zawsze pokazuj obrazki diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index ee4dfbb8d..b27ffba97 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -415,8 +415,6 @@ Por favor, nos envie relatórios de bugs, contribua para novas melhorias e faça Mostrar avisos para mensagens que eu envio Avisos abrem mensagens não lidas Procurar por mensagens não lidas quando o aviso for aberto - Mostrar contagem de não lidas - Mostrar o número de mensagens não lidas na barra de notificação. Marcar mensagem como lida ao abrir Marcar a mensagem como lida ao abrir e visualizar Sempre mostrar imagens diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 2bb1787a9..1344d032d 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -425,8 +425,6 @@ K-9 Mail — почтовый клиент для Android. Показать уведомление при отправке почты Перейти в непрочитанные Перейти к непрочитанным сообщениям при нажатии на уведомление - Счётчик непрочитанных - Показать количество непрочитанных в панели уведомлений Открытое прочитано Отметить сообщение прочитанным после просмотра Показать изображения diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml index ce704c532..6e2967cdf 100644 --- a/res/values-sk/strings.xml +++ b/res/values-sk/strings.xml @@ -425,8 +425,6 @@ Prosím, nahlasujte prípadné chyby, prispievajte novými funkciami a pýtajte Zobraziť oznámenie pre odoslané správy Oznámenie otvorí neprečítané správy Po otvorení oznámenia zobraziť neprečítané správy - Zobraziť počet neprečítaných - Zobraziť počet neprečítaných správ v notifikačnej lište Po otvorení označiť ako prečítané Označiť správu ako prečítanú po jej otvorení na zobrazenie Vždy zobraziť obrázky diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 8a2eeaabe..aa8c055d1 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -417,8 +417,6 @@ Vänligen skicka felrapporter, hjälp till med nya funktioner och ställ frågor Notifiera även för e-post som jag själv har skickat Notifieringar öppnar oläst e-post Letar efter oläst e-post när notifieringen öppnas - Visa antal olästa - Visar antalet olästa brev i notifieringsytan. Markera som läst vid visning Markera ett meddelande som läst när det visas Visa bilder automatiskt diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 6ae38e9a1..1bb1c5d6c 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -381,8 +381,6 @@ Lütfen hata raporlarınızı, istediğiniz yeni özellikleri ve sorularınızı Gönderdiğim mesajlar için bir bildirim göster Okunmamış mesaj bildirimi açık Bildirim açık olduğunda okunmamış mesajlar için arama yap - Okunmamış sayısını göster - Bildirim çubuğunda okunmamış mesaj numarasını göster. Mesaj açılırken okundu işaretle Mesaj okunmak üzere açıldığında okundu olarak işaretle Daima resimleri göster diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index d547635e9..800299194 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -415,8 +415,6 @@ K-9 Mail це поштовий клієнт з відкритим вихідни Показати сповіщення про надіслані мною повідомлення Сповіщати про відкриття непрочитаних повідомлень Шукати непрочитані повідомлення, коли сповіщення відкрито - Показувати кількість непрочитаних - Показувати кількість непрочитаних повідомлень у рядку сповіщень. Відмічати повідомлення як прочитане під час відкриття Відмічати повідомлення як прочитане під час відкриття для перегляду Завжди показувати зображення diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 7abf66e30..03eae9321 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -415,8 +415,6 @@ K-9改进的功能包括: 发送邮件时显示通知 点击通知后打开未读邮件 点击通知后搜索未读邮件 - 显示未读邮件数量 - 在通知栏显示未读邮件数量 邮件打开时标记为已读 当邮件打开时标记为已读 显示图片 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 8106628d7..9ae9fba09 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -387,8 +387,6 @@ 寄送郵件時顯示通知 點擊通知後打開未讀郵件 點擊通知後搜尋未讀郵件 - 顯示未讀郵件數 - 在通知欄上顯示未讀郵件數 開啟自動標記已讀 開啟檢視郵件內容時自動標記為已讀 顯示圖片 diff --git a/res/values/strings.xml b/res/values/strings.xml index bc991098b..09069abd6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -512,8 +512,6 @@ Please submit bug reports, contribute new features and ask questions at Show a notification for messages I sent Notification opens unread messages Searches for unread messages when Notification is opened - Show unread count - Show the number of unread messages in the notification bar. Mark as read when opened Mark a message as read when it is opened for viewing diff --git a/res/xml/account_settings_preferences.xml b/res/xml/account_settings_preferences.xml index b0f487b1f..cbe23b4cd 100644 --- a/res/xml/account_settings_preferences.xml +++ b/res/xml/account_settings_preferences.xml @@ -421,13 +421,6 @@ android:defaultValue="true" android:summary="@string/account_settings_notification_opens_unread_summary" /> - - compressionMap = new ConcurrentHashMap(); private Searchable searchableFolders; private boolean subscribedFoldersOnly; @@ -291,7 +290,6 @@ public class Account implements BaseAccount { mMaxPushFolders = 10; mChipColor = pickColor(context); goToUnreadMessageSearch = false; - mNotificationShowsUnreadCount = true; subscribedFoldersOnly = false; maximumPolledMessageAge = -1; maximumAutoDownloadMessageSize = 32768; @@ -398,7 +396,6 @@ public class Account implements BaseAccount { mMaxPushFolders = prefs.getInt(mUuid + ".maxPushFolders", 10); goToUnreadMessageSearch = prefs.getBoolean(mUuid + ".goToUnreadMessageSearch", false); - mNotificationShowsUnreadCount = prefs.getBoolean(mUuid + ".notificationUnreadCount", true); subscribedFoldersOnly = prefs.getBoolean(mUuid + ".subscribedFoldersOnly", false); maximumPolledMessageAge = prefs.getInt(mUuid + ".maximumPolledMessageAge", -1); maximumAutoDownloadMessageSize = prefs.getInt(mUuid + ".maximumAutoDownloadMessageSize", 32768); @@ -566,7 +563,6 @@ public class Account implements BaseAccount { editor.remove(mUuid + ".led"); editor.remove(mUuid + ".ledColor"); editor.remove(mUuid + ".goToUnreadMessageSearch"); - editor.remove(mUuid + ".notificationUnreadCount"); editor.remove(mUuid + ".subscribedFoldersOnly"); editor.remove(mUuid + ".maximumPolledMessageAge"); editor.remove(mUuid + ".maximumAutoDownloadMessageSize"); @@ -732,7 +728,6 @@ public class Account implements BaseAccount { editor.putString(mUuid + ".searchableFolders", searchableFolders.name()); editor.putInt(mUuid + ".chipColor", mChipColor); editor.putBoolean(mUuid + ".goToUnreadMessageSearch", goToUnreadMessageSearch); - editor.putBoolean(mUuid + ".notificationUnreadCount", mNotificationShowsUnreadCount); editor.putBoolean(mUuid + ".subscribedFoldersOnly", subscribedFoldersOnly); editor.putInt(mUuid + ".maximumPolledMessageAge", maximumPolledMessageAge); editor.putInt(mUuid + ".maximumAutoDownloadMessageSize", maximumAutoDownloadMessageSize); @@ -1524,14 +1519,6 @@ public class Account implements BaseAccount { this.goToUnreadMessageSearch = goToUnreadMessageSearch; } - public boolean isNotificationShowsUnreadCount() { - return mNotificationShowsUnreadCount; - } - - public void setNotificationShowsUnreadCount(boolean notificationShowsUnreadCount) { - this.mNotificationShowsUnreadCount = notificationShowsUnreadCount; - } - public synchronized boolean subscribedFoldersOnly() { return subscribedFoldersOnly; } diff --git a/src/com/fsck/k9/activity/setup/AccountSettings.java b/src/com/fsck/k9/activity/setup/AccountSettings.java index 7a047114e..95ed5e720 100644 --- a/src/com/fsck/k9/activity/setup/AccountSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSettings.java @@ -15,7 +15,6 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.AsyncTask; -import android.os.Build; import android.os.Bundle; import android.os.Vibrator; import android.preference.CheckBoxPreference; @@ -61,7 +60,6 @@ public class AccountSettings extends K9PreferenceActivity { private static final String PREFERENCE_SCREEN_COMPOSING = "composing"; private static final String PREFERENCE_SCREEN_INCOMING = "incoming_prefs"; private static final String PREFERENCE_SCREEN_PUSH_ADVANCED = "push_advanced"; - private static final String PREFERENCE_SCREEN_NOTIFICATIONS = "notifications"; private static final String PREFERENCE_SCREEN_SEARCH = "search"; private static final String PREFERENCE_DESCRIPTION = "account_description"; @@ -96,7 +94,6 @@ public class AccountSettings extends K9PreferenceActivity { private static final String PREFERENCE_CHIP_COLOR = "chip_color"; private static final String PREFERENCE_LED_COLOR = "led_color"; private static final String PREFERENCE_NOTIFICATION_OPENS_UNREAD = "notification_opens_unread"; - private static final String PREFERENCE_NOTIFICATION_UNREAD_COUNT = "notification_unread_count"; private static final String PREFERENCE_MESSAGE_AGE = "account_message_age"; private static final String PREFERENCE_MESSAGE_SIZE = "account_autodownload_size"; private static final String PREFERENCE_MESSAGE_FORMAT = "message_format"; @@ -162,7 +159,6 @@ public class AccountSettings extends K9PreferenceActivity { private Preference mLedColor; private boolean mIncomingChanged = false; private CheckBoxPreference mNotificationOpensUnread; - private CheckBoxPreference mNotificationUnreadCount; private ListPreference mMessageFormat; private CheckBoxPreference mMessageReadReceipt; private ListPreference mQuoteStyle; @@ -624,24 +620,6 @@ public class AccountSettings extends K9PreferenceActivity { mNotificationOpensUnread = (CheckBoxPreference)findPreference(PREFERENCE_NOTIFICATION_OPENS_UNREAD); mNotificationOpensUnread.setChecked(mAccount.goToUnreadMessageSearch()); - CheckBoxPreference notificationUnreadCount = - (CheckBoxPreference) findPreference(PREFERENCE_NOTIFICATION_UNREAD_COUNT); - - /* - * Honeycomb and newer don't show the notification number as overlay on the notification - * icon in the status bar, so we hide the setting. - * - * See http://code.google.com/p/android/issues/detail?id=21477 - */ - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - PreferenceScreen notificationsPrefs = - (PreferenceScreen) findPreference(PREFERENCE_SCREEN_NOTIFICATIONS); - notificationsPrefs.removePreference(notificationUnreadCount); - } else { - notificationUnreadCount.setChecked(mAccount.isNotificationShowsUnreadCount()); - mNotificationUnreadCount = notificationUnreadCount; - } - new PopulateFolderPrefsTask().execute(); mChipColor = findPreference(PREFERENCE_CHIP_COLOR); @@ -781,9 +759,6 @@ public class AccountSettings extends K9PreferenceActivity { mAccount.getNotificationSetting().setVibrateTimes(Integer.parseInt(mAccountVibrateTimes.getValue())); mAccount.getNotificationSetting().setLed(mAccountLed.isChecked()); mAccount.setGoToUnreadMessageSearch(mNotificationOpensUnread.isChecked()); - if (mNotificationUnreadCount != null) { - mAccount.setNotificationShowsUnreadCount(mNotificationUnreadCount.isChecked()); - } mAccount.setFolderTargetMode(Account.FolderMode.valueOf(mTargetMode.getValue())); mAccount.setDeletePolicy(Integer.parseInt(mDeletePolicy.getValue())); if (mIsExpungeCapable) { diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index bbdc64ac9..1a3548e9f 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -4770,12 +4770,6 @@ public class MessagingController implements Runnable { return summary; } - private static final boolean platformShowsNumberInNotification() { - // Honeycomb and newer don't show the number as overlay on the notification icon. - // However, the number will appear in the detailed notification view. - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB; - } - public static final boolean platformSupportsExtendedNotifications() { // supported in Jellybean // TODO: use constant once target SDK is set to >= 16 @@ -4851,9 +4845,7 @@ public class MessagingController implements Runnable { final int newMessages = data.getNewMessageCount(); final int unreadCount = data.unreadBeforeNotification + newMessages; - if (account.isNotificationShowsUnreadCount() || platformShowsNumberInNotification()) { - builder.setNumber(unreadCount); - } + builder.setNumber(unreadCount); String accountDescr = (account.getDescription() != null) ? account.getDescription() : account.getEmail(); diff --git a/src/com/fsck/k9/preferences/AccountSettings.java b/src/com/fsck/k9/preferences/AccountSettings.java index cbb2fa7c1..e68028079 100644 --- a/src/com/fsck/k9/preferences/AccountSettings.java +++ b/src/com/fsck/k9/preferences/AccountSettings.java @@ -129,9 +129,6 @@ public class AccountSettings { s.put("messageReadReceipt", Settings.versions( new V(1, new BooleanSetting(Account.DEFAULT_MESSAGE_READ_RECEIPT)) )); - s.put("notificationUnreadCount", Settings.versions( - new V(1, new BooleanSetting(true)) - )); s.put("notifyMailCheck", Settings.versions( new V(1, new BooleanSetting(false)) )); From 0fba273357c630067794ebcac0af71bbe4f12c30 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 16 Aug 2014 20:03:22 -0400 Subject: [PATCH 3/8] Remove the obsolete "Condensed layout" preference --- res/values-ca/strings.xml | 2 -- res/values-cs/strings.xml | 2 -- res/values-da/strings.xml | 2 -- res/values-de/strings.xml | 2 -- res/values-el/strings.xml | 2 -- res/values-es/strings.xml | 2 -- res/values-eu/strings.xml | 2 -- res/values-fi/strings.xml | 2 -- res/values-fr/strings.xml | 2 -- res/values-gl/strings.xml | 2 -- res/values-hu/strings.xml | 2 -- res/values-it/strings.xml | 2 -- res/values-iw/strings.xml | 2 -- res/values-ja/strings.xml | 2 -- res/values-ko/strings.xml | 2 -- res/values-lt/strings.xml | 2 -- res/values-nl/strings.xml | 2 -- res/values-pl/strings.xml | 2 -- res/values-pt-rBR/strings.xml | 2 -- res/values-ru/strings.xml | 2 -- res/values-sk/strings.xml | 2 -- res/values-sv/strings.xml | 2 -- res/values-tr/strings.xml | 2 -- res/values-uk/strings.xml | 2 -- res/values-zh-rCN/strings.xml | 2 -- res/values-zh-rTW/strings.xml | 2 -- res/values/strings.xml | 2 -- res/xml/global_preferences.xml | 6 ---- src/com/fsck/k9/K9.java | 11 -------- src/com/fsck/k9/activity/setup/Prefs.java | 13 --------- .../fsck/k9/preferences/GlobalSettings.java | 3 -- src/com/fsck/k9/view/MessageWebView.java | 28 ++----------------- 32 files changed, 2 insertions(+), 113 deletions(-) diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index aae5b07f8..d6f7f24ac 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -642,8 +642,6 @@ Si us plau, envia\'ns els errors, contribueix a millorar-lo a Tema de missatge fix Selecciona el tema de la vista de missatge al mostrar-lo. Utilitza un tema fix per a tots els missatges. - Disposició sola columna - Reformata missatges HTML missatges per a pantalles petites Per defecte del sistema Sincronització 2n pla Mai diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 80855a8b0..57a482a7e 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -642,8 +642,6 @@ Posílejte prosím chybová hlášení, přispívejte novými funkcemi a ptejte Neměnné téma zpráv Lze vybrat téma při prohlížení zprávy Použíj neměnné téma při prohlížení zprávy - Jednosloupcové uspořádání - Přeformátovat HTML zprávy pro menší obrazovky Systémový výchozí Synchronizace na pozadí Nikdy diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index c13643c91..0f786d008 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -636,8 +636,6 @@ Vær venlig at sende fejlrapporter, anmodning om nye funktioner, og spørgsmål Fixed meddelelses theme Benyt meddelelsesvisnings theme når meddelelser læses Benyt et fixed meddelelsesvisnings theme - Enkelkolonne layout - Reformater HTML meddelelser til visning på små skærme System standard Baggrundssynkronisering Aldrig diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index d7c787b38..be1d0b14a 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -649,8 +649,6 @@ Um Fehler zu melden, neue Funktionen vorzuschlagen oder Fragen zu stellen, besuc Festes Nachrichten-Design Nachrichten-Design während des Ansehens der Nachricht auswählen Immer das ausgewählte Nachrichten-Design verwenden - Einfaches Layout - HTML-Nachrichten für kleine Displays optimieren Systemvorgabe Hintergrund-Synchronisierung Nie diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index 1c39f154b..ee2792485 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -641,8 +641,6 @@ Θέμα σταθερού μηνύματος Επιλογή του θέματος προβολής μηνύματος κατά την προβολή του μηνύματος Χρήση θέματος σταθερού μηνύματος - Μονόστηλη διάταξη - Μηνύματα HTML για μικρότερες οθόνες Εξ ορισμού του συστήματος Συγχρονισμός στο παρασκήνιο Ποτέ diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 9275a4561..2a7ee8e57 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -651,8 +651,6 @@ Por favor, envía los errores detectados, contribuye con nuevas funcionalidades Tema de mensaje fijo Seleccionar el tema de vista de mensaje mientras se muestra el mensaje Usar un tema de vista de mensaje fijo - Única Columna - Ajusta mensajes HTML para pantallas pequeñas Configurado en el sistema Sincronizar en segundo plano Nunca diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml index 962e20c08..dd0a4dd23 100644 --- a/res/values-eu/strings.xml +++ b/res/values-eu/strings.xml @@ -642,8 +642,6 @@ Arazoen berri emateko, ezaugarri berriak gehitzeko eta galderak egiteko Mezu finkoaren itxura Mezua ikusten deneran itxura hautatu Mezua ikusteko itxura finkoa erabili - Diseinu trinkoa - Pantaila txikietarako HTML mezuak moldatu Sistemako defektuzkoa Atzeko planoko sinkronizazioa Inoiz ez diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index 3a5e5f230..29e87bccc 100755 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -651,8 +651,6 @@ Virheraportit, osallistuminen projektiin ja kysymykset: Mene osoitteeseen Kiinteä viestiteema Valitse viestinäkymän teema viestiä luettaessa Käytä kiinteää viestinäkymän teemaa - Yhden sarakkeen asettelu - Uudelleenmuotoile HTML-viestit pienemälle näytölle Järjestelmän oletus Synkronointi taustalla Ei koskaan diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 085a03b82..60f90e61c 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -650,8 +650,6 @@ jusqu\'à %d de plus Thème de message fixe Choisir le thème de vue du message en regardant le message Utiliser un thème de vue de message fixe - Mise en page condensée - Reformater les messages HTML pour les petits écrans Langue par défaut du système Synchronisation en arrière-plan Jamais diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 535c698c9..7400b8f13 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -574,8 +574,6 @@ Por favor, envía os erros detectados, contribúe con novas funcionalidas e preg mensaxes Tema Idioma - Columna única - Reformatea mensaxes HTML para pantallas pequenas Configurado no sistema Sincronizar en segundo plano Nunca diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 336a5cdb7..b916dca44 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -630,8 +630,6 @@ Hibajelentéseivel hozzájárul az újabb verziók tökéletesítéséhez, kérd Üzenetmegjelenítés témája Üzenetírás témája Nyelv - Egy oszlopos elrendezés - HTML üzenetek újraformázása a kisebb kijelzőkhöz. Alapértelmezett Háttérszinkronizálás Soha diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 000752fa5..5356720f3 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -651,8 +651,6 @@ Invia le tue segnalazioni, suggerisci nuove funzionalità e chiedi informazioni Tema fisso del messaggio Seleziona il tema della vista dei messaggi durante la visualizzazione del messaggio Usa un tema fisso nella vista dei messaggi - Disposizione a colonna singola - Riformatta i messaggi HTML per schermi più piccoli Impostazioni predefinite di sistema Sincronizzazione in background Mai diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml index 8142b0f06..5089bcf0a 100644 --- a/res/values-iw/strings.xml +++ b/res/values-iw/strings.xml @@ -541,8 +541,6 @@ הודעות ערכת נושא שפה - פריסת עמודה יחידה - אתחל הודעות HTML ותתאים אותם למסכים קטנים. ברירות מחדל מערכת סנכרון ברקע אף פעם diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 3355dcc62..81f185a1d 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -651,8 +651,6 @@ K-9 は大多数のメールクライアントと同様に、ほとんどのフ メッセージ表示画面のテーマを固定する メッセージを表示するテーマを選択する メッセージを表示するテーマを固定する - 凝縮レイアウト - 小さい画面用にHTMLメッセージを再構成 システム設定 バックグラウンド同期 使用しない diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 9a5840da7..dcf66cdac 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -640,8 +640,6 @@ K-9 메일은 대부분의 무료 hotmail 계정을 지원하지 않으며, 다 별도의 메시지 보기 테마 메시지 보기에 별도의 테마를 사용 고정 테마 사용 - 한 칸에 표시 - 작은 화면에서 HTML 메시지를 재구성 시스템 기본값 백그라운드 동기화 하지 않음 diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml index 16659e6a2..78f406586 100644 --- a/res/values-lt/strings.xml +++ b/res/values-lt/strings.xml @@ -643,8 +643,6 @@ Praneškite apie klaidas, pridėkite naujų galimybių ir užduokite klausimus m Numatyta laiško tema Peržiūrint laišką, pasirinkti laiško peržiūros temą Naudoti numatytą laiškų peržiūros temą - Glaudus išdėstymas - Performatuoti HTML laiškus mažesniems ekranams Sistemos numatyta Sinchronizuoti fone Niekada diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index f92fb9bc0..6921411ca 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -641,8 +641,6 @@ Graag foutrapporten, bijdrage nieuwe functies en vragen stellen op Vast berichten thema Kies het thema tijdens het bekijken van het bericht Gebruik een vast thema om het bericht te bekijken - 1-kolom layout - Herschik HTML berichten voor kleinere schermen Volgens systeem Achtergrond sync Nooit diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 64857a5a6..205ead7f1 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -641,8 +641,6 @@ Wszelkie zgłoszenia usterek, zapytania oraz nowe pomysły prosimy przesyłać z Stała kolorystyka widoku wiadomości Wybierz kolorystykę z poziomu widoku wiadomości Użyj kolorystyki wskazanej w konfiguracji - Ułożenie z 1 kolumną - Przeformatuj wiadomości HTML dla mniejszych ekranów Domyślny systemowy Synchronizacja w tle Nigdy diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index b27ffba97..248f17c24 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -637,8 +637,6 @@ Por favor, nos envie relatórios de bugs, contribua para novas melhorias e faça Tema fixo de mensagens Selecionar o tema de visualização ao visualizar a mensagem Usar um tema fixo para visualizar mensagens - Layout de coluna única - Formatar o HTML de mensagens para telas pequenas Padrões de sistema Sincronização em segundo plano Nunca diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 1344d032d..76e36030d 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -650,8 +650,6 @@ K-9 Mail — почтовый клиент для Android. Фиксированный просмотр Разрешить выбор темы при чтении сообщения Отключить выбор темы при чтении сообщения - Компактный вид - Перекомпоновка HTML-сообщений на небольших экранах По умолчанию Фоновая синхронизация Никогда diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml index 6e2967cdf..c3373dce9 100644 --- a/res/values-sk/strings.xml +++ b/res/values-sk/strings.xml @@ -650,8 +650,6 @@ Prosím, nahlasujte prípadné chyby, prispievajte novými funkciami a pýtajte Pevná téma správ Vybrať tému pri prehliadaní správ Použiť pevnú tému pri prehliadaní správ - Úprava usporiadania - Preformátovať HTML správy pre menšie obrazovky Predvolený systémom Synchronizácia na pozadí Nikdy diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index aa8c055d1..68e41c360 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -642,8 +642,6 @@ Vänligen skicka felrapporter, hjälp till med nya funktioner och ställ frågor Fast meddelandetema Välj tema för meddelandevyn medan meddelandet visas Använd ett fast tema för meddelandevyn - En-kolumns-layout - Formatera om HTML-brev för mindre skärmar Systemstandard Bakgrundssynkronisering Aldrig diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 1bb1c5d6c..b67e088c5 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -593,8 +593,6 @@ Lütfen hata raporlarınızı, istediğiniz yeni özellikleri ve sorularınızı Mesajlar Tema Dil - Tek sütun düzeni - Daha küçük ekranlar için HTML mesajları yeniden biçimlendir Sistem Varsayılanları Arkaplan senkronizasyonu Asla diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index 800299194..6ed5c3a56 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -639,8 +639,6 @@ K-9 Mail це поштовий клієнт з відкритим вихідни Мова Встановити тему повідомлення Виберіть перегляд теми повідомлення під час перегляду повідомлення - режим одного стовпця - Форматування HTML повідомлення для маленького екрану Системна по замовчуванню Фонова синхронізація Ніколи diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 03eae9321..da8abb05d 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -640,8 +640,6 @@ K-9改进的功能包括: 固定消息主题 在查看消息时选择消息查看主题 使用固定消息查看主题 - 单列布局 - 为小屏幕重新布局HTML邮件 系统默认值 后台同步 从不 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 9ae9fba09..8fe6f6fc8 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -612,8 +612,6 @@ 固定訊息主題 讀取訊息內容時顯示訊息檢視主題 使用固定訊息檢視主題 - 單列佈局 - 針對小尺寸螢幕重新排列HTML郵件格式 系統預設值 背景同步 不要 diff --git a/res/values/strings.xml b/res/values/strings.xml index 09069abd6..c61c8ece0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -790,8 +790,6 @@ Please submit bug reports, contribute new features and ask questions at Select the message view theme while viewing the message Use a fixed message view theme - Condensed layout - Reformat HTML messages for smaller screens System default diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index c985c35d9..5ceed2db6 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -236,12 +236,6 @@ android:positiveButtonText="@android:string/ok" android:negativeButtonText="@android:string/cancel" /> - - - * Single column layout was broken on Android < 2.2 (see - * issue 5024). - *

- * - *

- * Android versions >= 3.0 have problems with unclickable links when single column layout is - * enabled (see - * issue 34886 - * in Android's bug tracker, and - * issue 3820 - * in K-9 Mail's bug tracker). - */ - public static boolean isSingleColumnLayoutSupported() { - return (Build.VERSION.SDK_INT > 7 && Build.VERSION.SDK_INT < 11); - } - - public MessageWebView(Context context) { super(context); } @@ -101,11 +80,8 @@ public class MessageWebView extends RigidWebView { webSettings.setLoadsImagesAutomatically(true); webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH); - if (isSingleColumnLayoutSupported() && K9.mobileOptimizedLayout()) { - webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); - } else { - webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); - } + // TODO: Review alternatives. NARROW_COLUMNS is deprecated on KITKAT + webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); disableOverscrolling(); From 028f6f905569057875bf950274850f2b043607ce Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 16 Aug 2014 20:17:08 -0400 Subject: [PATCH 4/8] Remove AccessibleWebView Only used on pre-ICS devices --- res/layout/message.xml | 5 - src/com/fsck/k9/view/AccessibleWebView.java | 108 -------------------- src/com/fsck/k9/view/SingleMessageView.java | 87 +++------------- 3 files changed, 12 insertions(+), 188 deletions(-) delete mode 100644 src/com/fsck/k9/view/AccessibleWebView.java diff --git a/res/layout/message.xml b/res/layout/message.xml index 86f42060b..a054bc2bd 100644 --- a/res/layout/message.xml +++ b/res/layout/message.xml @@ -26,11 +26,6 @@ android:layout_height="wrap_content" android:layout_width="fill_parent"/> - - mListeners = null; - - public AccessibleWebView(Context context) { - super(context); - init(context); - } - - public AccessibleWebView(Context context, AttributeSet attributes) { - super(context, attributes); - init(context); - } - - private void init(Context context) { - mContext = context; - mDummyWebView = new WebView(context); - setFocusable(true); - setFocusableInTouchMode(true); - setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - diveIn(); - } - }); - } - - public void loadData(String data, String mimeType, String encoding) { - mHtmlSource = data; - this.setText(Html.fromHtml(mHtmlSource, null, null)); - } - - public WebSettings getSettings() { - return mDummyWebView.getSettings(); - } - - public void setText(String text) { - this.setText(Html.fromHtml(text, null, null)); - - // Let everyone know that loading has finished. - if (mListeners != null) { - for (MessagingListener l : mListeners) { - l.messageViewFinished(); - } - } - } - - public boolean zoomIn() { - if (getTextSize() < 100) { - setTextSize(getTextSize() + 5); - return true; - } - return false; - } - - public boolean zoomOut() { - if (getTextSize() > 5) { - setTextSize(getTextSize() - 5); - return true; - } - return false; - } - - private void diveIn() { - Intent i = new Intent(); - i.setClass(mContext, AccessibleEmailContentActivity.class); - i.putExtra("content", mHtmlSource); - mContext.startActivity(i); - } - - public void setListeners(final Set listeners) { - this.mListeners = listeners; - } -} diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index 44f408e25..58a5821cf 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -6,19 +6,15 @@ import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import java.net.URLDecoder; -import java.util.List; - import android.app.Activity; import android.app.Fragment; import android.content.ActivityNotFoundException; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; -import android.content.pm.ResolveInfo; import android.database.Cursor; import android.net.Uri; import android.os.AsyncTask; -import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; @@ -91,11 +87,9 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, private static final int DISPLAY_NAME_INDEX = 1; - private boolean mScreenReaderEnabled; private MessageCryptoView mCryptoView; private MessageOpenPgpView mOpenPgpView; private MessageWebView mMessageContentView; - private AccessibleWebView mAccessibleMessageContentView; private MessageHeader mHeaderContainer; private LinearLayout mAttachments; private Button mShowHiddenAttachments; @@ -118,7 +112,6 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, public void initialize(Fragment fragment) { Activity activity = fragment.getActivity(); mMessageContentView = (MessageWebView) findViewById(R.id.message_content); - mAccessibleMessageContentView = (AccessibleWebView) findViewById(R.id.accessible_message_content); mMessageContentView.configure(); activity.registerForContextMenu(mMessageContentView); mMessageContentView.setOnCreateContextMenuListener(this); @@ -151,25 +144,15 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, mDownloadRemainder = (Button) findViewById(R.id.download_remainder); mDownloadRemainder.setVisibility(View.GONE); mAttachmentsContainer.setVisibility(View.GONE); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH && - isScreenReaderActive(activity)) { - // Only use the special screen reader mode on pre-ICS devices with active screen reader - mAccessibleMessageContentView.setVisibility(View.VISIBLE); - mMessageContentView.setVisibility(View.GONE); - mScreenReaderEnabled = true; - } else { - mAccessibleMessageContentView.setVisibility(View.GONE); - mMessageContentView.setVisibility(View.VISIBLE); - mScreenReaderEnabled = false; + mMessageContentView.setVisibility(View.VISIBLE); - // the HTC version of WebView tries to force the background of the - // titlebar, which is really unfair. - TypedValue outValue = new TypedValue(); - getContext().getTheme().resolveAttribute(R.attr.messageViewHeaderBackgroundColor, outValue, true); - mHeaderContainer.setBackgroundColor(outValue.data); - // also set background of the whole view (including the attachments view) - setBackgroundColor(outValue.data); - } + // the HTC version of WebView tries to force the background of the + // titlebar, which is really unfair. + TypedValue outValue = new TypedValue(); + getContext().getTheme().resolveAttribute(R.attr.messageViewHeaderBackgroundColor, outValue, true); + mHeaderContainer.setBackgroundColor(outValue.data); + // also set background of the whole view (including the attachments view) + setBackgroundColor(outValue.data); mShowHiddenAttachments.setOnClickListener(this); mShowMessageAction.setOnClickListener(this); @@ -443,43 +426,6 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, } - private boolean isScreenReaderActive(Activity activity) { - final String SCREENREADER_INTENT_ACTION = "android.accessibilityservice.AccessibilityService"; - final String SCREENREADER_INTENT_CATEGORY = "android.accessibilityservice.category.FEEDBACK_SPOKEN"; - // Restrict the set of intents to only accessibility services that have - // the category FEEDBACK_SPOKEN (aka, screen readers). - Intent screenReaderIntent = new Intent(SCREENREADER_INTENT_ACTION); - screenReaderIntent.addCategory(SCREENREADER_INTENT_CATEGORY); - List screenReaders = activity.getPackageManager().queryIntentServices( - screenReaderIntent, 0); - ContentResolver cr = activity.getContentResolver(); - Cursor cursor = null; - int status = 0; - for (ResolveInfo screenReader : screenReaders) { - // All screen readers are expected to implement a content provider - // that responds to - // content://.providers.StatusProvider - cursor = cr.query(Uri.parse("content://" + screenReader.serviceInfo.packageName - + ".providers.StatusProvider"), null, null, null, null); - try { - if (cursor != null && cursor.moveToFirst()) { - // These content providers use a special cursor that only has - // one element, - // an integer that is 1 if the screen reader is running. - status = cursor.getInt(0); - if (status == 1) { - return true; - } - } - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - return false; - } - public boolean showPictures() { return mShowPictures; } @@ -640,12 +586,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, } private void loadBodyFromText(String emailText) { - if (mScreenReaderEnabled) { - mAccessibleMessageContentView.setText(emailText); - } else { - mMessageContentView.setText(emailText); - } - + mMessageContentView.setText(emailText); } public void updateCryptoLayout(CryptoProvider cp, PgpData pgpData, Message message) { @@ -710,14 +651,10 @@ public class SingleMessageView extends LinearLayout implements OnClickListener, } public void zoom(KeyEvent event) { - if (mScreenReaderEnabled) { - mAccessibleMessageContentView.zoomIn(); + if (event.isShiftPressed()) { + mMessageContentView.zoomIn(); } else { - if (event.isShiftPressed()) { - mMessageContentView.zoomIn(); - } else { - mMessageContentView.zoomOut(); - } + mMessageContentView.zoomOut(); } } From 786511ed88dbbd52b6f151a84a7e2f70219a9464 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 16 Aug 2014 20:24:54 -0400 Subject: [PATCH 5/8] Simplify ClipboardManager No longer API dependent. --- src/com/fsck/k9/helper/ClipboardManager.java | 34 ++++++------------- .../fsck/k9/helper/ClipboardManagerApi1.java | 22 ------------ .../fsck/k9/helper/ClipboardManagerApi11.java | 25 -------------- 3 files changed, 11 insertions(+), 70 deletions(-) delete mode 100644 src/com/fsck/k9/helper/ClipboardManagerApi1.java delete mode 100644 src/com/fsck/k9/helper/ClipboardManagerApi11.java diff --git a/src/com/fsck/k9/helper/ClipboardManager.java b/src/com/fsck/k9/helper/ClipboardManager.java index 7751b3b89..c60b6f62a 100644 --- a/src/com/fsck/k9/helper/ClipboardManager.java +++ b/src/com/fsck/k9/helper/ClipboardManager.java @@ -1,38 +1,21 @@ package com.fsck.k9.helper; +import android.content.ClipData; import android.content.Context; -import android.os.Build; /** - * Helper class to access the system clipboard - * - * @see ClipboardManagerApi1 - * @see ClipboardManagerApi11 + * Access the system clipboard using the new {@link ClipboardManager} introduced with API 11 */ -public abstract class ClipboardManager { - /** - * Instance of the API-specific class that interfaces with the clipboard API. - */ +public class ClipboardManager { + private static ClipboardManager sInstance = null; - /** - * Get API-specific instance of the {@code ClipboardManager} class - * - * @param context - * A {@link Context} instance. - * - * @return Appropriate {@link ClipboardManager} instance for this device. - */ public static ClipboardManager getInstance(Context context) { Context appContext = context.getApplicationContext(); if (sInstance == null) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - sInstance = new ClipboardManagerApi1(appContext); - } else { - sInstance = new ClipboardManagerApi11(appContext); - } + sInstance = new ClipboardManager(appContext); } return sInstance; @@ -59,5 +42,10 @@ public abstract class ClipboardManager { * @param text * The actual text to be copied to the clipboard. */ - public abstract void setText(String label, String text); + public void setText(String label, String text) { + android.content.ClipboardManager clipboardManager = + (android.content.ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); + ClipData clip = ClipData.newPlainText(label, text); + clipboardManager.setPrimaryClip(clip); + } } diff --git a/src/com/fsck/k9/helper/ClipboardManagerApi1.java b/src/com/fsck/k9/helper/ClipboardManagerApi1.java deleted file mode 100644 index 80bfe714c..000000000 --- a/src/com/fsck/k9/helper/ClipboardManagerApi1.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fsck.k9.helper; - -import android.content.Context; -import android.text.ClipboardManager; - -/** - * Access the system clipboard using the now deprecated {@link ClipboardManager} - */ -@SuppressWarnings("deprecation") -public class ClipboardManagerApi1 extends com.fsck.k9.helper.ClipboardManager { - - public ClipboardManagerApi1(Context context) { - super(context); - } - - @Override - public void setText(String label, String text) { - ClipboardManager clipboardManager = - (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); - clipboardManager.setText(text); - } -} diff --git a/src/com/fsck/k9/helper/ClipboardManagerApi11.java b/src/com/fsck/k9/helper/ClipboardManagerApi11.java deleted file mode 100644 index 5c142b9b4..000000000 --- a/src/com/fsck/k9/helper/ClipboardManagerApi11.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fsck.k9.helper; - -import android.annotation.TargetApi; -import android.content.ClipData; -import android.content.Context; -import android.content.ClipboardManager; - -/** - * Access the system clipboard using the new {@link ClipboardManager} introduced with API 11 - */ -@TargetApi(11) -public class ClipboardManagerApi11 extends com.fsck.k9.helper.ClipboardManager { - - public ClipboardManagerApi11(Context context) { - super(context); - } - - @Override - public void setText(String label, String text) { - ClipboardManager clipboardManager = - (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText(label, text); - clipboardManager.setPrimaryClip(clip); - } -} From bc60c860b84cde7e71c07fd14967aed37c4a2e38 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 16 Aug 2014 20:33:26 -0400 Subject: [PATCH 6/8] Remove com.fsck.k9.helper.NotificationBuilder Only useful on pre-Honeycomb devices. --- .../k9/controller/MessagingController.java | 11 +++--- .../fsck/k9/helper/NotificationBuilder.java | 38 ------------------- 2 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 src/com/fsck/k9/helper/NotificationBuilder.java diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 1a3548e9f..79e364ec2 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -59,7 +59,6 @@ import com.fsck.k9.activity.setup.AccountSetupIncoming; import com.fsck.k9.activity.setup.AccountSetupOutgoing; import com.fsck.k9.cache.EmailProviderCache; import com.fsck.k9.helper.Contacts; -import com.fsck.k9.helper.NotificationBuilder; import com.fsck.k9.helper.power.TracingPowerManager; import com.fsck.k9.helper.power.TracingPowerManager.TracingWakeLock; import com.fsck.k9.mail.Address; @@ -2650,7 +2649,7 @@ public class MessagingController implements Runnable { final String title = context.getString( R.string.notification_certificate_error_title, account.getDescription()); - final NotificationCompat.Builder builder = new NotificationBuilder(context); + final NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setSmallIcon(R.drawable.ic_notify_new_mail); builder.setWhen(System.currentTimeMillis()); builder.setAutoCancel(true); @@ -3348,7 +3347,7 @@ public class MessagingController implements Runnable { NotificationManager notifMgr = (NotificationManager) mApplication.getSystemService(Context.NOTIFICATION_SERVICE); - NotificationCompat.Builder builder = new NotificationBuilder(mApplication); + NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplication); builder.setSmallIcon(R.drawable.ic_notify_check_mail); builder.setWhen(System.currentTimeMillis()); builder.setOngoing(true); @@ -3399,7 +3398,7 @@ public class MessagingController implements Runnable { NotificationManager notifMgr = (NotificationManager) mApplication.getSystemService(Context.NOTIFICATION_SERVICE); - NotificationCompat.Builder builder = new NotificationBuilder(mApplication); + NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplication); builder.setSmallIcon(R.drawable.ic_notify_new_mail); builder.setWhen(System.currentTimeMillis()); builder.setAutoCancel(true); @@ -3433,7 +3432,7 @@ public class MessagingController implements Runnable { final NotificationManager notifMgr = (NotificationManager) mApplication.getSystemService(Context.NOTIFICATION_SERVICE); - NotificationCompat.Builder builder = new NotificationBuilder(mApplication); + NotificationCompat.Builder builder = new NotificationCompat.Builder(mApplication); builder.setSmallIcon(R.drawable.ic_notify_check_mail); builder.setWhen(System.currentTimeMillis()); builder.setOngoing(true); @@ -4835,7 +4834,7 @@ public class MessagingController implements Runnable { NotificationManager notifMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - NotificationCompat.Builder builder = new NotificationBuilder(context); + NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setSmallIcon(R.drawable.ic_notify_new_mail); builder.setWhen(System.currentTimeMillis()); if (!updateSilently) { diff --git a/src/com/fsck/k9/helper/NotificationBuilder.java b/src/com/fsck/k9/helper/NotificationBuilder.java deleted file mode 100644 index 94b4351c3..000000000 --- a/src/com/fsck/k9/helper/NotificationBuilder.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.fsck.k9.helper; - -import android.app.Notification; -import android.content.Context; -import android.os.Build; -import android.support.v4.app.NotificationCompat; - -/** - * Notification builder that will set {@link Notification#number} on pre-Honeycomb devices. - * - * @see android - Issue 38028 - */ -public class NotificationBuilder extends NotificationCompat.Builder { - protected int mNumber; - - - public NotificationBuilder(Context context) { - super(context); - } - - @Override - public NotificationCompat.Builder setNumber(int number) { - super.setNumber(number); - mNumber = number; - return this; - } - - @Override - public Notification build() { - Notification notification = super.build(); - - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - notification.number = mNumber; - } - - return notification; - } -} From e4d26b8c752f03dc8a40bcb59a0e601835205083 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 16 Aug 2014 18:59:50 -0400 Subject: [PATCH 7/8] Remove code for unsupported API levels An assortment of miscellaneous changes, each usually limited in scope to a single file. --- .../k9/activity/K9PreferenceActivity.java | 12 +--------- src/com/fsck/k9/activity/MessageCompose.java | 23 +----------------- src/com/fsck/k9/activity/MessageList.java | 16 +------------ .../activity/misc/ContactPictureLoader.java | 20 ++-------------- .../fsck/k9/fragment/MessageListFragment.java | 3 ++- src/com/fsck/k9/helper/MergeCursor.java | 2 -- src/com/fsck/k9/helper/Utility.java | 16 ------------- src/com/fsck/k9/provider/EmailProvider.java | 2 -- src/com/fsck/k9/view/MessageWebView.java | 24 +++++-------------- .../fsck/k9/view/NonLockingScrollView.java | 10 +------- 10 files changed, 14 insertions(+), 114 deletions(-) diff --git a/src/com/fsck/k9/activity/K9PreferenceActivity.java b/src/com/fsck/k9/activity/K9PreferenceActivity.java index 5f3387b26..faecd6d28 100644 --- a/src/com/fsck/k9/activity/K9PreferenceActivity.java +++ b/src/com/fsck/k9/activity/K9PreferenceActivity.java @@ -1,6 +1,5 @@ package com.fsck.k9.activity; -import android.os.Build; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; @@ -13,16 +12,7 @@ public class K9PreferenceActivity extends PreferenceActivity { @Override public void onCreate(Bundle icicle) { K9ActivityCommon.setLanguage(this, K9.getK9Language()); - - if (Build.VERSION.SDK_INT >= 6 && Build.VERSION.SDK_INT < 14) { - // There's a display bug in all supported Android versions before 4.0 (SDK 14) which - // causes PreferenceScreens to have a black background. - // http://code.google.com/p/android/issues/detail?id=4611 - setTheme(K9.getK9ThemeResourceId(K9.Theme.DARK)); - } else { - setTheme(K9.getK9ThemeResourceId()); - } - + setTheme(K9.getK9ThemeResourceId()); super.onCreate(icicle); } diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 180bf42df..f27e334fc 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -8,10 +8,8 @@ import java.io.UnsupportedEncodingException; import java.text.DateFormat; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -3697,7 +3695,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, public List getQueryParameters(String key) { final List params = new ArrayList(); - for (String paramName : getQueryParameterNames()) { + for (String paramName : uri.getQueryParameterNames()) { if (paramName.equalsIgnoreCase(key)) { params.addAll(uri.getQueryParameters(paramName)); } @@ -3705,25 +3703,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, return params; } - @TargetApi(11) - private Set getQueryParameterNames() { - if (Build.VERSION.SDK_INT >= 11) { - return uri.getQueryParameterNames(); - } - - return getQueryParameterNamesPreSdk11(); - } - - private Set getQueryParameterNamesPreSdk11() { - if (mParamNames == null) { - String query = uri.getQuery(); - Set paramNames = new HashSet(); - Collections.addAll(paramNames, query.split("(=[^&]*(&|$))|&")); - mParamNames = paramNames; - } - - return mParamNames; - } } private class SendMessageTask extends AsyncTask { diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 2802f459a..3da206094 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -1391,20 +1391,6 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme } } - private void restartActivity() { - // restart the current activity, so that the theme change can be applied - if (Build.VERSION.SDK_INT < 11) { - Intent intent = getIntent(); - intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); - finish(); - overridePendingTransition(0, 0); // disable animations to speed up the switch - startActivity(intent); - overridePendingTransition(0, 0); - } else { - recreate(); - } - } - @Override public void displayMessageSubject(String subject) { if (mDisplayMode == DisplayMode.MESSAGE_VIEW) { @@ -1541,7 +1527,7 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme } }).start(); - restartActivity(); + recreate(); } private void showDefaultTitleView() { diff --git a/src/com/fsck/k9/activity/misc/ContactPictureLoader.java b/src/com/fsck/k9/activity/misc/ContactPictureLoader.java index 842bec4eb..819fc7061 100644 --- a/src/com/fsck/k9/activity/misc/ContactPictureLoader.java +++ b/src/com/fsck/k9/activity/misc/ContactPictureLoader.java @@ -9,7 +9,6 @@ import java.util.concurrent.RejectedExecutionException; import java.util.regex.Matcher; import java.util.regex.Pattern; -import android.annotation.TargetApi; import android.app.ActivityManager; import android.content.ContentResolver; import android.content.Context; @@ -23,7 +22,6 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; -import android.os.Build; import android.support.v4.util.LruCache; import android.widget.QuickContactBadge; import com.fsck.k9.helper.Contacts; @@ -103,15 +101,10 @@ public class ContactPictureLoader { final int cacheSize = 1024 * 1024 * memClass / 16; mBitmapCache = new LruCache(cacheSize) { - @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1) @Override protected int sizeOf(Address key, Bitmap bitmap) { // The cache size will be measured in bytes rather than number of items. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { - return bitmap.getByteCount(); - } - - return bitmap.getRowBytes() * bitmap.getHeight(); + return bitmap.getByteCount(); } }; } @@ -148,7 +141,7 @@ public class ContactPictureLoader { calculateFallbackBitmap(address), task); badge.setImageDrawable(asyncDrawable); try { - task.exec(); + task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } catch (RejectedExecutionException e) { // We flooded the thread pool queue... use a fallback picture badge.setImageBitmap(calculateFallbackBitmap(address)); @@ -275,15 +268,6 @@ public class ContactPictureLoader { mAddress = new Address(address); } - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - public void exec(Void... args) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args); - } else { - execute(args); - } - } - public Address getAddress() { return mAddress; } diff --git a/src/com/fsck/k9/fragment/MessageListFragment.java b/src/com/fsck/k9/fragment/MessageListFragment.java index 1a45c7da9..3648e8fe3 100644 --- a/src/com/fsck/k9/fragment/MessageListFragment.java +++ b/src/com/fsck/k9/fragment/MessageListFragment.java @@ -2,6 +2,7 @@ package com.fsck.k9.fragment; import java.lang.ref.WeakReference; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.EnumMap; @@ -150,7 +151,7 @@ public class MessageListFragment extends Fragment implements OnItemClickListener private static final int FOLDER_NAME_COLUMN = 17; private static final int THREAD_COUNT_COLUMN = 18; - private static final String[] PROJECTION = Utility.copyOf(THREADED_PROJECTION, + private static final String[] PROJECTION = Arrays.copyOf(THREADED_PROJECTION, THREAD_COUNT_COLUMN); diff --git a/src/com/fsck/k9/helper/MergeCursor.java b/src/com/fsck/k9/helper/MergeCursor.java index 7205a5039..a69ebf5bc 100644 --- a/src/com/fsck/k9/helper/MergeCursor.java +++ b/src/com/fsck/k9/helper/MergeCursor.java @@ -19,7 +19,6 @@ package com.fsck.k9.helper; import java.util.Comparator; -import android.annotation.TargetApi; import android.content.ContentResolver; import android.database.CharArrayBuffer; import android.database.ContentObserver; @@ -204,7 +203,6 @@ public class MergeCursor implements Cursor { return mActiveCursor.getString(columnIndex); } - @TargetApi(11) @Override public int getType(int columnIndex) { return mActiveCursor.getType(columnIndex); diff --git a/src/com/fsck/k9/helper/Utility.java b/src/com/fsck/k9/helper/Utility.java index 5844c701f..a5bea3448 100644 --- a/src/com/fsck/k9/helper/Utility.java +++ b/src/com/fsck/k9/helper/Utility.java @@ -1,13 +1,11 @@ package com.fsck.k9.helper; -import android.annotation.SuppressLint; import android.app.Application; import android.content.Context; import android.database.Cursor; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.os.Build; import android.os.Handler; import android.os.Looper; import android.text.Editable; @@ -24,7 +22,6 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.regex.Matcher; @@ -698,19 +695,6 @@ public class Utility { return null; } - @SuppressLint("NewApi") - public static String[] copyOf(String[] original, int newLength) { - if (Build.VERSION.SDK_INT >= 9) { - return Arrays.copyOf(original, newLength); - } - - String[] newArray = new String[newLength]; - int copyLength = (original.length >= newLength) ? newLength : original.length; - System.arraycopy(original, 0, newArray, 0, copyLength); - - return newArray; - } - /** * @return a {@link Handler} tied to the main thread. */ diff --git a/src/com/fsck/k9/provider/EmailProvider.java b/src/com/fsck/k9/provider/EmailProvider.java index 394edad1d..9537ed64a 100644 --- a/src/com/fsck/k9/provider/EmailProvider.java +++ b/src/com/fsck/k9/provider/EmailProvider.java @@ -18,7 +18,6 @@ import com.fsck.k9.mail.store.LockableDatabase.WrappedException; import com.fsck.k9.mail.store.UnavailableStorageException; import com.fsck.k9.search.SqlQueryBuilder; -import android.annotation.TargetApi; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.ContentValues; @@ -797,7 +796,6 @@ public class EmailProvider extends ContentProvider { return super.getString(realColumnIndex); } - @TargetApi(11) @Override public int getType(int columnIndex) { int realColumnIndex = mColumnMapping[columnIndex]; diff --git a/src/com/fsck/k9/view/MessageWebView.java b/src/com/fsck/k9/view/MessageWebView.java index b3757198c..3198d4723 100644 --- a/src/com/fsck/k9/view/MessageWebView.java +++ b/src/com/fsck/k9/view/MessageWebView.java @@ -1,9 +1,7 @@ package com.fsck.k9.view; -import android.annotation.TargetApi; import android.content.Context; import android.content.pm.PackageManager; -import android.os.Build; import android.util.AttributeSet; import android.util.Log; import android.view.KeyEvent; @@ -83,7 +81,7 @@ public class MessageWebView extends RigidWebView { // TODO: Review alternatives. NARROW_COLUMNS is deprecated on KITKAT webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); - disableOverscrolling(); + setOverScrollMode(OVER_SCROLL_NEVER); webSettings.setTextZoom(K9.getFontSizes().getMessageViewContentAsPercent()); @@ -94,23 +92,13 @@ public class MessageWebView extends RigidWebView { /** * Disable on-screen zoom controls on devices that support zooming via pinch-to-zoom. */ - @TargetApi(11) private void disableDisplayZoomControls() { - if (Build.VERSION.SDK_INT >= 11) { - PackageManager pm = getContext().getPackageManager(); - boolean supportsMultiTouch = - pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH) || - pm.hasSystemFeature(PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT); + PackageManager pm = getContext().getPackageManager(); + boolean supportsMultiTouch = + pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH) || + pm.hasSystemFeature(PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT); - getSettings().setDisplayZoomControls(!supportsMultiTouch); - } - } - - @TargetApi(9) - private void disableOverscrolling() { - if (Build.VERSION.SDK_INT >= 9) { - setOverScrollMode(OVER_SCROLL_NEVER); - } + getSettings().setDisplayZoomControls(!supportsMultiTouch); } /** diff --git a/src/com/fsck/k9/view/NonLockingScrollView.java b/src/com/fsck/k9/view/NonLockingScrollView.java index 05788e22d..38e479ef8 100644 --- a/src/com/fsck/k9/view/NonLockingScrollView.java +++ b/src/com/fsck/k9/view/NonLockingScrollView.java @@ -17,7 +17,6 @@ package com.fsck.k9.view; -import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; @@ -124,7 +123,7 @@ public class NonLockingScrollView extends ScrollView { private final Rect sHitFrame = new Rect(); private boolean isEventOverChild(MotionEvent ev, ArrayList children) { - final int actionIndex = getActionIndex(ev); + final int actionIndex = ev.getActionIndex(); final float x = ev.getX(actionIndex) + getScrollX(); final float y = ev.getY(actionIndex) + getScrollY(); @@ -142,13 +141,6 @@ public class NonLockingScrollView extends ScrollView { return false; } - @SuppressLint("InlinedApi") - private static int getActionIndex(MotionEvent ev) { - // Equivalent to MotionEvent.getActionIndex() which is in API 8+ - return ((ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) - >> MotionEvent.ACTION_POINTER_INDEX_SHIFT); - } - private static boolean canViewReceivePointerEvents(View child) { return child.getVisibility() == VISIBLE || (child.getAnimation() != null); } From ac1ed9eef309ddde3eaf138152e0393854a885ba Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 29 Aug 2014 01:45:48 +0200 Subject: [PATCH 8/8] Increment settings version --- src/com/fsck/k9/preferences/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/fsck/k9/preferences/Settings.java b/src/com/fsck/k9/preferences/Settings.java index b4dd8ef41..22ed1cb1f 100644 --- a/src/com/fsck/k9/preferences/Settings.java +++ b/src/com/fsck/k9/preferences/Settings.java @@ -35,7 +35,7 @@ public class Settings { * * @see SettingsExporter */ - public static final int VERSION = 32; + public static final int VERSION = 33; public static Map validate(int version, Map> settings,