| 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<>(); |