(Context context)
| 668 | } |
| 669 | |
| 670 | static Integer getCacheSizeKb(Context context) { |
| 671 | try { |
| 672 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| 673 | int sqlite_cache = prefs.getInt("sqlite_cache", DEFAULT_CACHE_SIZE); |
| 674 | |
| 675 | ActivityManager am = Helper.getSystemService(context, ActivityManager.class); |
| 676 | int class_mb = am.getMemoryClass(); |
| 677 | int cache_size = sqlite_cache * class_mb * 1024 / 100; |
| 678 | |
| 679 | return (cache_size > 2000 ? cache_size : null); |
| 680 | } catch (Throwable ex) { |
| 681 | Log.e(ex); |
| 682 | return null; |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | private static void dropTriggers(@NonNull SupportSQLiteDatabase db) { |
| 687 | db.execSQL("DROP TRIGGER IF EXISTS `attachment_insert`"); |
no test coverage detected