[PM-40773] bug: Track accessibility service connection state from the service - #7302
Open
7heMech wants to merge 2 commits into
Open
[PM-40773] bug: Track accessibility service connection state from the service#73027heMech wants to merge 2 commits into
7heMech wants to merge 2 commits into
Conversation
Android 16 no longer reports this app's own accessibility service back to the app: neither Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES nor AccessibilityManager.getEnabledAccessibilityServiceList returns it, so isAccessibilityServiceEnabled always answered false. The setting reads as an empty string and the enabled service list is empty, while the same values are fully populated for adb and for an unrelated app on the same device. The service knows when it is connected, so record that instead of asking the platform. AccessibilityEnabledManager exposes isAccessibilityServiceConnected, set from onServiceConnected and onUnbind, and BitwardenAutofillTileService reads the manager rather than querying the platform on every tap. isAccessibilityServiceEnabled remains the initial value so behaviour before Android 16 is unchanged.
Collaborator
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-40773
New PR under the same ticket, as requested in
#7197 (comment).
#7197 shipped in 2026.8.0 but the reported behaviour is unchanged, so #4601 and #6267 are
still reproducible on 2026.8.0 (21819).
📔 Objective
isAccessibilityServiceEnabledreturns false on Android 16 even when our accessibility serviceis enabled and bound, so "Use accessibility" stays off and the autofill tile shows the "turn on
accessibility" dialog.
Both branches of that check ask the platform about our own service, and Android 16 does not
answer. Logged from inside
com.x8bit.bitwardenon a Pixel 6 Pro (SDK 36,targetSdk37),while
dumpsys accessibilitylisted the service under bothEnabled servicesandBound services:At the same moment
adb shell settings get secure enabled_accessibility_servicesreturned thefull value, and a separate test app also targeting 37 got both services back from
getEnabledAccessibilityServiceList. The restriction applies to the app asking about itself.That is why #7197 did not help. It widened which service names the primary check accepts, but
getEnabledAccessibilityServiceListis restricted the same waySettings.Secureis, so thecheck iterates an empty list no matter which names it would have matched.
So stop asking the platform.
BitwardenAccessibilityServiceknows when it is connected, andAccessibilityEnabledManagerwas already notified from its lifecycle callbacks:refreshAccessibilityEnabledFromSettings()becomesvar isAccessibilityServiceConnected, setin
onServiceConnectedandonUnbind.onCreateno longer refreshes, sinceonServiceConnectedalways follows it.BitwardenAutofillTileServicereads the manager instead of callingapplicationContext.isAccessibilityServiceEnabledon each tap. Without this the tile keepsshowing the dialog.
isAccessibilityServiceEnabledis unchanged and still provides the initial value, sobehaviour before Android 16 is the same.
Verified on the same device with a minified
standardReleasebuild atapplicationIdcom.x8bit.bitwarden, since the previous fix passed an unminified local test and did nothing inthe Play build.
📸 Screenshots