{"record":{"id":"c9f2ed9136913337","repo":"yuliskov/SmartTube","slug":"update-is-not-implemented","errorCode":null,"errorMessage":"Update is not implemented.","messagePattern":"Update is not implemented\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"leanbackassistant/src/main/java/com/liskovsoft/leanbackassistant/search/VideoContentProvider.java","lineNumber":250,"sourceCode":"\n    @Nullable\n    @Override\n    public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {\n        throw new UnsupportedOperationException(\"Insert is not implemented.\");\n    }\n\n    @Override\n    public int delete(@NonNull Uri uri, @Nullable String s, @Nullable String[] strings) {\n        throw new UnsupportedOperationException(\"Delete is not implemented.\");\n    }\n\n    @Override\n    public int update(\n            @NonNull Uri uri,\n            @Nullable ContentValues contentValues,\n            @Nullable String s,\n            @Nullable String[] strings) {\n        throw new UnsupportedOperationException(\"Update is not implemented.\");\n    }\n}\n","sourceCodeStart":232,"sourceCodeEnd":253,"githubUrl":"https://github.com/yuliskov/SmartTube/blob/3de8d90593e0166f012ca18cc3c7ba45bfd68ac4/leanbackassistant/src/main/java/com/liskovsoft/leanbackassistant/search/VideoContentProvider.java#L232-L253","documentation":"VideoContentProvider exposes search suggestions only; update() unconditionally throws UnsupportedOperationException('Update is not implemented.') because the provider has no writable backing store to update.","triggerScenarios":"Any getContentResolver().update(uri, values, where, args) call against this provider's authority — e.g. a sync adapter trying to push state changes.","commonSituations":"Sync frameworks attempting bidirectional sync with every provider; maintenance tooling flipping flags through content URIs; tests exercising update on all providers.","solutions":["Drop the update() call against this provider; it is query-only by design.","Apply state changes through the app's real APIs (media service, playlists, prefs) instead.","In a fork, implement update() against actual storage if you truly need it."],"exampleFix":"// before\ngetContentResolver().update(searchUri, values, null, null); // throws\n\n// after — provider is read-only; push changes through the app's\n// own data APIs instead of the search ContentProvider.","handlingStrategy":"try-catch","validationCode":"// update is unsupported; guard by operation type before dispatch\nif (isWriteOperation(op)) {\n    require(isWritableProvider(uri)); // search provider is not\n}","typeGuard":null,"tryCatchPattern":"try {\n    getContentResolver().update(searchUri, values, null, null);\n} catch (UnsupportedOperationException e) { // Update is not implemented\n    Log.w(TAG, \"Search provider is read-only: \" + searchUri);\n}","preventionTips":["Sync adapters should declare per-provider capabilities; mark the search provider read-only.","Push state changes through the app's own APIs, never through suggestion providers."],"tags":["android","content-provider","read-only","crud"],"backgroundTag":"read-only-content-provider","analyzedSha":"3de8d90593e0166f012ca18cc3c7ba45bfd68ac4","analyzedAt":"2026-08-22T09:19:26.383Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}