Don't show apps/categories after disabling repo.

This was setup to work correctly, but for two problems:

 * The `cursor.close()` in `CategoriesViewBinder` stops the cursor from
   being requeried when required.

 * The `AppProvider` was not notifying correctly after deleting apps
   belonging to a repo.

Fixes #1028.
This commit is contained in:
Peter Serwylo 2017-06-29 17:32:51 +10:00
parent 61ab88f8ea
commit b658c0b44e
2 changed files with 7 additions and 3 deletions

View File

@ -807,7 +807,13 @@ public class AppProvider extends FDroidProvider {
db().execSQL(query, new String[] {String.valueOf(repoId)});
AppQuerySelection selection = new AppQuerySelection(where, whereArgs).add(queryRepo(repoId));
return db().delete(getTableName(), selection.getSelection(), selection.getArgs());
int result = db().delete(getTableName(), selection.getSelection(), selection.getArgs());
getContext().getContentResolver().notifyChange(ApkProvider.getContentUri(), null);
getContext().getContentResolver().notifyChange(AppProvider.getContentUri(), null);
getContext().getContentResolver().notifyChange(CategoryProvider.getContentUri(), null);
return result;
}
@Override

View File

@ -121,8 +121,6 @@ class CategoriesViewBinder implements LoaderManager.LoaderCallbacks<Cursor> {
emptyState.setVisibility(View.GONE);
categoriesList.setVisibility(View.VISIBLE);
}
cursor.close();
}
@Override