{"record":{"id":"4ca48a237e6484e1","repo":"microg/GmsCore","slug":"not-yet-implemented-4ca48a","errorCode":null,"errorMessage":"Not yet implemented","messagePattern":"Not yet implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"play-services-maps/core/vtm/src/main/java/org/microg/gms/maps/vtm/data/SharedTileProvider.java","lineNumber":43,"sourceCode":"import android.net.Uri;\n\n/*\n * TODO: Writing to cache should be protected, tiles should be downloaded by service instead of client app.\n */\npublic class SharedTileProvider extends ContentProvider {\n    private static final String DB_NAME = \"tilecache.db\";\n    public static final String PROVIDER_NAME = \"org.microg.gms.maps.vtm.tile\";\n    public static final Uri PROVIDER_URI = Uri.parse(\"content://\" + PROVIDER_NAME);\n\n    private SQLiteHelper sqLiteHelper;\n\n    public SharedTileProvider() {\n    }\n\n    @Override\n    public int delete(Uri uri, String selection, String[] selectionArgs) {\n        // Implement this to handle requests to delete one or more rows.\n        throw new UnsupportedOperationException(\"Not yet implemented\");\n    }\n\n    @Override\n    public String getType(Uri uri) {\n        return \"vnd.android.cursor.item/org.microg.gms.map.tile\";\n    }\n\n    @Override\n    public Uri insert(Uri uri, ContentValues values) {\n        sqLiteHelper.getWritableDatabase().insert(\"tiles\", null, values);\n        return PROVIDER_URI;\n    }\n\n    @Override\n    public boolean onCreate() {\n        sqLiteHelper = new SQLiteHelper(getContext(), DB_NAME);\n        return true;\n    }","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-maps/core/vtm/src/main/java/org/microg/gms/maps/vtm/data/SharedTileProvider.java#L25-L61","documentation":"SharedTileProvider extends ContentProvider and implements delete() as a stub that always throws UnsupportedOperationException, since tile deletion is not implemented in this provider. Any caller (framework or app) issuing a delete operation on the tile content URI hits the exception.","triggerScenarios":"Calling ContentResolver.delete(...) on the SharedTileProvider authority URI, e.g. attempting to clear cached map tiles through the provider interface.","commonSituations":"Generic cache-cleanup code that deletes rows from all content providers; tooling that introspects providers and performs delete probes.","solutions":["Do not issue delete operations against the tile provider; clear tile caches by deleting underlying cache files/directories instead","Catch UnsupportedOperationException around resolver.delete calls targeting this authority","Contribute/patch SharedTileProvider.delete to remove tiles if deletion is required"],"exampleFix":"// before\nresolver.delete(tileUri, null, null); // throws\n// after\ntry {\n    resolver.delete(tileUri, null, null);\n} catch (UnsupportedOperationException e) {\n    // provider does not support delete; clear file cache instead\n}","handlingStrategy":"try-catch","validationCode":"// avoid issuing deletes against the tile provider authority\ndontCallDeleteOn(tileProviderAuthority);","typeGuard":null,"tryCatchPattern":"try { resolver.delete(tileUri, null, null); } catch (UnsupportedOperationException e) { clearTileFileCacheInstead(); }","preventionTips":["Do not use ContentResolver.delete on tile URIs; delete cache files instead","Read the provider's getType/MIME contract before generic CRUD sweeps","Guard generic cleanup code against providers that only implement query/insert"],"tags":["android","maps","contentprovider","unsupported"],"backgroundTag":"method-not-implemented","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}