The Android Autofill framework enables credential managers, password managers, and payment apps (such as Google Password Manager, Bitwarden, or 1Password) to securely populate usernames, passwords, credit card credentials, and two-factor authentication (2FA) SMS codes into application inputs. Under the hood, the system parses the visual UI hierarchy of target apps using AssistStructure and ViewStructure objects to identify input hints (like autofillHints="password") and coordinates with the active AutofillService. When an application fails to trigger autofill prompts, incorrectly suggests credentials for unrelated fields, or clashes with Android Credential Manager, Android Debug Bridge (ADB) gives developers and security researchers low-level diagnostics using dumpsys autofill.
Understanding the Android Autofill Framework
The Android Autofill subsystem operates as a mediated system service (autofill) within system_server:
- Autofill Service Provider: The application designated by the user in system settings to handle credential generation and retrieval (e.g.
com.google.android.gmsor a third-party password manager). - Autofill Sessions: Ephemeral state-machine sessions established when a user focuses an autofillable input field within an activity. The session captures the window token, client UID, and view hierarchy snapshot.
- AssistStructure: A sanitized snapshot of the app’s view tree, exposing node IDs, input types (e.g.
textPassword,phone,emailAddress), and explicitautofillHints. - Fill Responses & Datasets: Secure bundles sent back by the autofill provider containing candidate values or save requests.
- Credential Manager Integration: In modern Android releases, the Autofill framework works alongside Credential Manager to present Passkeys, federated identity tokens, and saved passwords in a unified bottom-sheet UI.
Connecting via ADB and Dumping Autofill Service State
Ensure your Android device has Developer Options and USB Debugging enabled, then connect via terminal:
adb devices
To inspect the entire internal state of the Android Autofill service across all active user profiles, execute dumpsys autofill:
adb shell dumpsys autofill
The command produces a comprehensive report detailing the active provider, configuration flags, augmented autofill status, and active fill sessions.
Verifying the Active Autofill Provider and Component Settings
To check which application is currently registered as the primary autofill provider for User 0:
adb shell dumpsys autofill | grep -A 8 "Component:"
This reveals the service component name (e.g. com.google.android.gms/.autofill.service.AutofillService). If no provider is selected, the output displays Component: null.
You can also check whether Augmented Autofill (an internal framework used for inline suggestions and optical text recognition) is enabled:
adb shell dumpsys autofill | grep -i "Augmented Autofill"
Inspecting Active Autofill Sessions and View Trees
To diagnose why an input field fails to receive autofill suggestions while interacting with an application:
- Launch the target application on your Android device and tap inside the problematic input field (e.g. username or password box).
- While the keyboard or suggestion bar is displayed, run
dumpsys autofillfiltered for session data:adb shell dumpsys autofill | grep -A 35 "Session:" - Examine the session parameters:
- Session ID: The integer tracking the active fill interaction.
- Flags: Operational flags indicating whether manual autofill was requested (
FLAG_MANUAL_REQUEST). - Focused View ID: The internal integer or resource ID corresponding to the active input.
- Autofill Hints: The hints detected by the framework (e.g.
[username],[password],[creditCardNumber]). If this list is empty, the app developer did not specify standard hints, forcing the provider to guess based on heuristic input types.
Debugging Credential Manager and Inline Autofill Suggestions
In modern Android versions, autofill suggestions can appear directly inside the keyboard suggestion strip (Inline Suggestions) or via Credential Manager bottom sheets. The dump details whether inline suggestions were requested:
adb shell dumpsys autofill | grep -A 10 "Inline Suggestions Request"
This block indicates whether the active keyboard engine (e.g. Gboard) provided an inline suggestion spec and whether the autofill provider returned matching dataset slices.
Interactive Autofill Testing and Reset via cmd autofill
In addition to passive inspection via dumpsys, Android provides the cmd autofill utility to interact with the service directly from the terminal:
To query the default autofill service for the primary user:
adb shell cmd autofill get default-service 0
To set or change the active autofill provider programmatically during automated device provisioning:
adb shell cmd autofill set default-service 0 com.google.android.gms/.autofill.service.AutofillService
To reset and clear all active autofill sessions and cached fill responses:
adb shell cmd autofill reset
To destroy all active sessions without resetting the provider:
adb shell cmd autofill destroy sessions
Monitoring Live Autofill Events with Logcat
To observe autofill events, session lifecycles, and view tree parsing in real time as you navigate through app login forms:
adb logcat -s AutofillManager:V AutofillService:V AutofillManagerService:V
This stream confirms whether the app successfully dispatched an autofill() callback, received a valid FillResponse from the password manager, or was rejected due to secure window (FLAG_SECURE) restrictions.