wipe "known categories" cache when database transients are reset
closes #1626 closes #1632
This commit is contained in:
		
							parent
							
								
									2a4c9f0fcb
								
							
						
					
					
						commit
						be9b6515cd
					
				@ -983,6 +983,7 @@ public class AppProvider extends FDroidProvider {
 | 
			
		||||
                categoryValues.put(CatJoinTable.Cols.CATEGORY_ID, categoryId);
 | 
			
		||||
                db().insert(getCatJoinTableName(), null, categoryValues);
 | 
			
		||||
            }
 | 
			
		||||
            getContext().getContentResolver().notifyChange(CategoryProvider.getContentUri(), null);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,7 @@ import java.util.Locale;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
public class CategoryProvider extends FDroidProvider {
 | 
			
		||||
    public static final String TAG = "CategoryProvider";
 | 
			
		||||
 | 
			
		||||
    public static final class Helper {
 | 
			
		||||
        private Helper() {
 | 
			
		||||
@ -26,7 +27,7 @@ public class CategoryProvider extends FDroidProvider {
 | 
			
		||||
         * During repo updates, each app needs to know the ID of each category it belongs to.
 | 
			
		||||
         * This results in lots of database lookups, usually at least one for each app, sometimes more.
 | 
			
		||||
         * To improve performance, this caches the association between categories and their database IDs.
 | 
			
		||||
         *
 | 
			
		||||
         * <p>
 | 
			
		||||
         * It can stay around for the entire F-Droid process, even across multiple repo updates, as we
 | 
			
		||||
         * don't actually remove data from the categories table.
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
@ -1318,6 +1318,7 @@ public class DBHelper extends SQLiteOpenHelper {
 | 
			
		||||
        Utils.debugLog(TAG, "Removing all index tables, they will be recreated next time F-Droid updates.");
 | 
			
		||||
 | 
			
		||||
        Preferences.get().resetLastUpdateCheck();
 | 
			
		||||
        CategoryProvider.Helper.clearCategoryIdCache();
 | 
			
		||||
 | 
			
		||||
        db.beginTransaction();
 | 
			
		||||
        try {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user