MCPcopy Create free account
hub / github.com/M66B/FairEmail / dataUpdates

Method dataUpdates

app/src/main/java/eu/faircode/email/DB.java:744–764  ·  view source on GitHub ↗
(SupportSQLiteDatabase db, Context context)

Source from the content-addressed store, hash-verified

742 }
743
744 private static void dataUpdates(SupportSQLiteDatabase db, Context context) {
745 try {
746 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
747 int dataVersion = prefs.getInt("data_version", 0);
748 int newVersion = 1;
749 if (dataVersion < 1) {
750 db.execSQL("UPDATE identity" +
751 " SET use_ip = 0" +
752 " WHERE use_ip = 1 AND " +
753 "(host = 'mail.optonline.net'" +
754 " OR host = 'mail.optimum.net'" +
755 " OR host = 'smtp.suddenlink.net')");
756 }
757 if (dataVersion < newVersion) {
758 Log.i("Updating from data version " + dataVersion + " to " + newVersion);
759 prefs.edit().putInt("data_version", newVersion).apply();
760 }
761 } catch (Throwable ex) {
762 Log.e(ex);
763 }
764 }
765
766 private static void logMigration(int startVersion, int endVersion) {
767 Map<String, String> crumb = new HashMap<>();

Callers 1

onOpenMethod · 0.95

Calls 5

iMethod · 0.95
eMethod · 0.95
getIntMethod · 0.45
execSQLMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected