Skip to content

[PM-40773] bug: Track accessibility service connection state from the service - #7302

Open
7heMech wants to merge 2 commits into
bitwarden:mainfrom
7heMech:accessibility-fix
Open

[PM-40773] bug: Track accessibility service connection state from the service#7302
7heMech wants to merge 2 commits into
bitwarden:mainfrom
7heMech:accessibility-fix

Conversation

@7heMech

@7heMech 7heMech commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🎟️ 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

isAccessibilityServiceEnabled returns false on Android 16 even when our accessibility service
is 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.bitwarden on a Pixel 6 Pro (SDK 36, targetSdk 37),
while dumpsys accessibility listed the service under both Enabled services and
Bound services:

packageName=com.x8bit.bitwarden
enabledServices.size=0    // AccessibilityManager.getEnabledAccessibilityServiceList
settingsValue=            // Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, empty string
RESULT=false

At the same moment adb shell settings get secure enabled_accessibility_services returned the
full 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
getEnabledAccessibilityServiceList is restricted the same way Settings.Secure is, so the
check iterates an empty list no matter which names it would have matched.

So stop asking the platform. BitwardenAccessibilityService knows when it is connected, and
AccessibilityEnabledManager was already notified from its lifecycle callbacks:

  • refreshAccessibilityEnabledFromSettings() becomes var isAccessibilityServiceConnected, set
    in onServiceConnected and onUnbind. onCreate no longer refreshes, since
    onServiceConnected always follows it.
  • BitwardenAutofillTileService reads the manager instead of calling
    applicationContext.isAccessibilityServiceEnabled on each tap. Without this the tile keeps
    showing the dialog.
  • isAccessibilityServiceEnabled is unchanged and still provides the initial value, so
    behaviour before Android 16 is the same.

Verified on the same device with a minified standardRelease build at applicationId
com.x8bit.bitwarden, since the previous fix passed an unminified local test and did nothing in
the Play build.

📸 Screenshots

image image

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.
@7heMech
7heMech requested review from a team and david-livefront as code owners August 25, 2026 14:57
@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-42463
Link: https://bitwarden.atlassian.net/browse/PM-42463

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title [PM-40773] bug: Track accessibility service connection state from the service [PM-42463] [PM-40773] bug: Track accessibility service connection state from the service Aug 25, 2026
@7heMech 7heMech changed the title [PM-42463] [PM-40773] bug: Track accessibility service connection state from the service [PM-40773] bug: Track accessibility service connection state from the service Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants