When selecting text on modern Android devices, the operating system does not merely highlight characters; it intelligently identifies structured entities. If a user taps on a physical street address, telephone number, email address, tracking number, flight code, or URL inside a message or web page, Android automatically expands the selection boundary to capture the entire entity and displays an actionable smart contextual action chip (such as “Open in Maps”, “Call”, “Send Email”, or “Track Package”) directly in the floating text selection toolbar.
This contextual intelligence is orchestrated by the Text Classification Framework and managed system-wide by the TextClassificationManagerService. Leveraging lightweight, on-device natural language processing (NLP) models, the Text Classifier analyzes text strings locally without transmitting sensitive clipboard contents to external servers. For mobile application developers, system customizers, and security researchers evaluating entity extraction latency or debugging why custom text actions fail to appear, the Android Debug Bridge (ADB) diagnostic command dumpsys textclassification exposes the complete runtime state of text classification models and active sessions. This guide explains how the Text Classification subsystem operates and details how to extract and audit model telemetry using ADB.
Architecture of the Android Text Classification Framework
The Android Text Classification subsystem operates through an extensible client-provider model designed for offline, privacy-first NLP processing:
- TextClassificationManager: The client-facing system API used by UI widgets (such as
TextView,EditText, and web views) to request text classification, linkify parsing, and smart selection generation. - TextClassificationManagerService: A system service running inside the
system_serverprocess. It validates calling app permissions, manages multi-user isolation, and routes classification queries to the active provider implementation. - TextClassifierService: The backend intelligence engine that executes the classification algorithms. By default, this is provided by Android System Intelligence (
com.google.android.as) on Google Pixel and standard Android builds, or by proprietary OEM equivalents on Samsung, Xiaomi, and OnePlus devices. - Model Annotator and Entity Extraction: The provider runs compact neural network models (e.g.
universal.modelor language-specificen.model) that scan text for entity regular expressions and semantic patterns, scoring candidates with confidence percentages.
Inspecting dumpsys textclassification allows developers to verify which model files are actively loaded into memory, how long classification inferences take, and what application packages are submitting queries.
Verifying ADB Connectivity and Service Status
Connect your Android test device or emulator via USB or wireless debugging and verify device communication:
adb devices -l
Confirm that the textclassification service is registered in the Android service directory:
adb shell service list | grep -i textclassification
The system returns the active Binder interface descriptor:
192 textclassification: [android.view.textclassifier.ITextClassificationManager]
If the service is present, the Text Classification Manager is operational and ready to accept diagnostic queries.
Dumping Global Text Classification State
To inspect the entire diagnostic state of the Text Classification subsystem across all user profiles, execute the basic dumpsys command:
adb shell dumpsys textclassification
The output provides an overview of the bound service provider, loaded model versions, and session metrics:
TEXT CLASSIFICATION MANAGER SERVICE (dumpsys textclassification)
================================================================
User 0:
Default service name: com.google.android.as/com.google.android.apps.miphone.aiai.textclassifier.TextClassifierService
Service bound: true
Bound component: ComponentInfo{com.google.android.as/com.google.android.apps.miphone.aiai.textclassifier.TextClassifierService}
Is temporary service: false
Active sessions: 1
Session: TextClassificationSessionId{id=4b8e2109-1a7f-490b-8d12-6e84d2f0714c}
Client package: com.android.chrome (UID 10142)
Created at: 2026-11-08 02:45:10
Last interaction: 2026-11-08 02:58:22
Model Information:
Active model: /data/misc/textclassifier/textclassifier.universal.model
Model version: 924
Supported locales: [en-US, en-GB, fr-FR, de-DE, es-ES]
Supported entity types: [address, email, phone, url, date, datetime, flight, tracking_number]
Key information revealed in this diagnostic dump includes:
- Default Service Name: Confirms the active on-device intelligence package providing text classification (e.g. Android System Intelligence under
com.google.android.as). - Model Information: Identifies the active neural network model file path, version number, and supported entity types (e.g.
flight,tracking_number,address). - Active Sessions & Client Package: Details which applications are currently holding open classification contexts (in the example above, Google Chrome).
Auditing Classification Performance and Latency Counters
In addition to static configuration details, dumpsys textclassification records execution metrics and latency statistics for recent classification events.
To inspect performance counters, filter dumpsys output for query durations:
adb shell dumpsys textclassification | grep -A 10 "Performance stats"
The output highlights inference duration metrics:
Performance stats:
Total requests: 1,482
Average classifyText latency: 4.8 ms
Average suggestSelection latency: 6.2 ms
Average generateLinks latency: 12.1 ms
Cache hit rate: 68.4%
Because text classification occurs directly during user gesture interactions (such as double-tapping or long-pressing text), inference latency must remain under 16 milliseconds to prevent dropped frames and visual stutter in the user interface. An average latency of 4 to 6 ms confirms optimal local hardware execution.
Tracing Real-Time Classification Events
To observe how the text classification service behaves when interacting with different text types:
- Open an application (e.g. Messages, Chrome, or Notes) on the Android device.
- Select a text string containing a phone number or address (e.g. “1600 Amphitheatre Pkwy, Mountain View, CA”).
- Capture the dumpsys output immediately via ADB:
adb shell dumpsys textclassification > tc_dump.txt - Inspect
tc_dump.txtto verify whether the entity was accurately categorized underaddresswith high confidence, and confirm that the recommended action intent (e.g.android.intent.action.VIEWwith geo URI) was successfully returned to the calling application.
Temporarily Overriding the Text Classifier Service for Testing
Android allows developers to override the default text classification engine with a custom debug provider using cmd textclassification, facilitating offline unit testing and benchmarking.
Setting a Temporary Classification Service
To redirect text classification queries to a custom test package implementing Android’s TextClassifierService:
# Syntax: cmd textclassification set-temporary-service <USER_ID> <COMPONENT_NAME> <DURATION_MS>
adb shell cmd textclassification set-temporary-service 0 com.example.customclassifier/.MyTextClassifierService 300000
This binds system classification queries to com.example.customclassifier for 5 minutes (300,000 ms). Confirm the binding in dumpsys:
adb shell dumpsys textclassification | grep -i "temporary"
Clearing the Temporary Service Override
To immediately restore the device’s default system text classifier provider, clear the temporary override:
adb shell cmd textclassification set-temporary-service 0
Troubleshooting Common Text Classification Issues
When Smart Selection fails or smart contextual action buttons do not appear in the floating toolbar, check the following diagnostic indicators:
- Service Unbound (
Service bound: false): Indicates the underlying intelligence package (e.g.com.google.android.as) crashed or was disabled via package manager. Verify system server logcat messages using:adb logcat -d -s TextClassificationManagerService:V AndroidRuntime:E - Outdated or Missing Model Files: If
Model Informationshows no active model path, the device has not completed initial model provisioning. Connect to Wi-Fi to allow Google Play Services or OEM update components to download the latest language pack. - Calling Package Sandboxing / Permissions: Third-party applications that implement custom text selection toolbars must ensure they do not consume or intercept text selection events without querying
TextClassificationManager.