class InstalledAppProvider extends FDroidProvider {

    @Override
    public int delete(@NonNull Uri uri, String where, String[] whereArgs) {

        if (MATCHER.match(uri) != CODE_SINGLE) {
            throw new UnsupportedOperationException("Delete not supported for " + uri + ".");
        }

        String packageName = uri.getLastPathSegment();
        QuerySelection query = new QuerySelection(where, whereArgs);
        query = query.add(queryAppSubQuery(packageName));

        int count = db().delete(getTableName(), query.getSelection(), query.getArgs());

        AppProvider.Helper.calcSuggestedApk(getContext(), packageName);

        return count;
    }

}