yuliskov/SmartTube · error · UnsupportedOperationException

Delete is not implemented.

Error message

Delete is not implemented.

What it means

VideoContentProvider is a read-only search-suggestions provider; delete() unconditionally throws UnsupportedOperationException('Delete is not implemented.') because deleting rows from the suggestion cache is not a supported operation — the cache is rebuilt from the media service data.

Source

Thrown at leanbackassistant/src/main/java/com/liskovsoft/leanbackassistant/search/VideoContentProvider.java:241

            mediaItem.getId()
        };
    }

    @Nullable
    @Override
    public String getType(@NonNull Uri uri) {
        return null;
    }

    @Nullable
    @Override
    public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {
        throw new UnsupportedOperationException("Insert is not implemented.");
    }

    @Override
    public int delete(@NonNull Uri uri, @Nullable String s, @Nullable String[] strings) {
        throw new UnsupportedOperationException("Delete is not implemented.");
    }

    @Override
    public int update(
            @NonNull Uri uri,
            @Nullable ContentValues contentValues,
            @Nullable String s,
            @Nullable String[] strings) {
        throw new UnsupportedOperationException("Update is not implemented.");
    }
}

View on GitHub (pinned to 3de8d90593)

Solutions

  1. Remove delete() calls against this provider's URIs from your code or job.
  2. Manage the underlying data through the app's own APIs (channels/playlists), not through the search provider.
  3. If you fork the library and need deletion, implement delete() in the provider against your real store.

Example fix

// before
getContentResolver().delete(searchUri, null, null); // throws

// after — nothing to delete; the provider only serves search suggestions
// via query(). Adjust the owning app's data instead.
Defensive patterns

Strategy: try-catch

Validate before calling

// delete is unsupported by design; skip it for this authority
if (!SEARCH_AUTHORITY.equals(uri.getAuthority())) {
    getContentResolver().delete(uri, null, null);
}

Try / catch

try {
    getContentResolver().delete(searchUri, null, null);
} catch (UnsupportedOperationException e) { // Delete is not implemented
    Log.w(TAG, "Search provider is read-only: " + searchUri);
}

Prevention

When it happens

Trigger: Any getContentResolver().delete(uri, selection, args) call against this provider's authority, including cleanup routines and test teardown code.

Common situations: Sync/cleanup jobs iterating over all providers; tests that delete inserted rows on every provider; tooling that treats providers as databases.

Related errors


AI-assisted analysis of yuliskov/SmartTube@3de8d90593 (2026-08-22). Data as JSON: /api/errors/af8ab44ff0387055. Report an issue: GitHub.