{"record":{"id":"28fc016d2588217e","repo":"microg/GmsCore","slug":"unsupported-method-call-s-s","errorCode":null,"errorMessage":"Unsupported method call %s(%s).","messagePattern":"Unsupported method call (.+?)\\((.+?)\\)\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java","lineNumber":101,"sourceCode":"                                    (hasGooglePackagePermission || AuthPrefs.isAuthVisible(getContext()))) {\n                                Log.d(TAG, \"Make account \" + account + \" visible to \" + packageName);\n                                am.setAccountVisibility(account, packageName, VISIBILITY_VISIBLE);\n                            }\n                        }\n                    }\n                }\n                if (accounts == null) {\n                    accounts = new Account[0];\n                }\n\n                result.putParcelableArray(PROVIDER_EXTRA_ACCOUNTS, accounts);\n                return result;\n            } else if (PROVIDER_METHOD_CLEAR_PASSWORD.equals(method) && hasGooglePackagePermission) {\n                Account a = extras.getParcelable(PROVIDER_EXTRA_CLEAR_PASSWORD);\n                AccountManager.get(getContext()).clearPassword(a);\n                return null;\n            }\n            throw new UnsupportedOperationException(String.format(\"Unsupported method call %s(%s).\", method, arg));\n        } finally {\n            Binder.restoreCallingIdentity(identityToken);\n        }\n    }\n\n    @Nullable\n    @Override\n    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {\n        throw new UnsupportedOperationException();\n    }\n\n    @Nullable\n    @Override\n    public String getType(Uri uri) {\n        return \"text/plain\";\n    }\n\n    @Nullable","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java#L83-L119","documentation":"AccountContentProvider.call() supports only a fixed set of methods (get_accounts, and clear-password when the caller has google package permission). Any other method name throws UnsupportedOperationException.","triggerScenarios":"Calling ContentResolver.call() with a method string other than PROVIDER_METHOD_GET_ACCOUNTS, or calling PROVIDER_METHOD_CLEAR_PASSWORD without holding the google package permission (the branch falls through to the throw).","commonSituations":"Typos or version drift between caller method string and provider constant; calling clear_password from an unprivileged app so the permission-guarded branch is skipped; copy-pasted code from a newer/older play-services version using renamed methods.","solutions":["Use the exact supported method string (the PROVIDER_METHOD_GET_ACCOUNTS constant value) in your call().","For clear-password, ensure the caller has the google package permission, otherwise the call is rejected.","Wrap the call in try-catch for UnsupportedOperationException and fall back to AccountManager APIs.","Check the microg source for the current list of supported provider methods for your version."],"exampleFix":"// before\nresolver.call(uri, \"getAccounts\", arg, extras);\n// after\nresolver.call(uri, \"get_accounts\", arg, extras); // match PROVIDER_METHOD_GET_ACCOUNTS","handlingStrategy":"try-catch","validationCode":"if (!\"get_accounts\".equals(method) && !(\"clear_password\".equals(method) && hasGooglePermission)) throw new IllegalArgumentException(\"unsupported method: \" + method);","typeGuard":null,"tryCatchPattern":"try { resolver.call(uri, method, arg, extras); } catch (UnsupportedOperationException e) { // fall back to AccountManager }","preventionTips":["Use provider method constant values, not literals from memory","Only call clear_password from privileged apps","Check provider source for supported methods in your version"],"tags":["android","content-provider","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}