Modern Android smartphones incorporate intelligent contextual sensing capabilities to streamline user interactions while conserving battery power. Features such as Screen Attention (keeping the display awake while the user is actively looking at it) and Face-Oriented Auto-Rotate (preventing awkward screen rotations when using the device while lying down) rely on real-time computer vision algorithms. In the Android framework, these capabilities are coordinated by AttentionManagerService. For mobile developers, QA engineers, and security analysts evaluating camera wake cycles and user presence detection latencies, Android Debug Bridge (ADB) provides comprehensive diagnostic inspection via dumpsys attention.
Architecture of the Android Attention Service
The attention system service (implemented in com.android.server.attention.AttentionManagerService) interfaces between high-level power management subsystems and low-level computer vision models:
- Screen Attention (Screen Timeout Suppression): When the display nears its inactivity timeout (e.g., 30 seconds),
PowerManagerServicedispatches an attention check toAttentionManagerService. The service activates the front-facing camera via an isolated Private Compute Core process to check if a human face is oriented toward the display. If presence is confirmed, the timeout timer is reset. - Auto-Rotate Face Detection:
WindowManagerServicequeries the attention service when the accelerometer detects a physical rotation threshold. If the user’s face is oriented in alignment with the current screen aspect, orientation changes are suppressed. - Privacy & Isolation: Camera frames captured for attention checking are processed entirely in ephemeral memory within sandboxed system services; no photos or video streams are written to disk or accessible to third-party applications.
Querying the Attention Subsystem via ADB
Connect your Android device with USB debugging authorized and execute the diagnostic command in your terminal:
adb shell dumpsys attention
The command dumps active service connections, historical attention check results, latency metrics, and current user binding states.
Analysing Key Sections of the Attention Dump
1. Service Availability and Implementation Binding
The top section of the dump confirms whether the device OEM has implemented an Attention Service provider:
AttentionManagerService:
isServiceAvailable: true
mComponentName: com.google.android.as/com.google.android.apps.miphone.aiai.attention.service.AiAiAttentionService
mUserId: 0
mBinding: true
Key parameters include:
- isServiceAvailable: Indicates whether the hardware and software stack supports facial presence sensing.
- mComponentName: Identifies the package providing the machine learning inference (commonly Android System Intelligence on Google Pixel devices or OEM equivalent).
- mBinding: Confirms active IPC binding between the system framework and the inference engine.
2. Historical Attention Check Results and Latency
dumpsys attention maintains a rolling buffer of recent attention checks:
Attention Check History:
Timestamp: 2026-11-08 10:14:22, Result: ATTENTION_SUCCESS, Duration: 145ms
Timestamp: 2026-11-08 10:14:52, Result: ATTENTION_SUCCESS, Duration: 120ms
Timestamp: 2026-11-08 10:15:22, Result: ATTENTION_FAILURE (Timed out), Duration: 1500ms
The Result field reveals whether presence was verified:
ATTENTION_SUCCESS: A face was detected looking at the screen; display sleep was successfully prevented.ATTENTION_FAILURE: No face detected or user looked away; the screen proceeds to dim and lock.- Duration: Measures inference latency from camera activation to classification. Typical processing times range from 80ms to 250ms.
Testing and Simulating Attention Checks via ADB
To verify how power management behaves when attention checks pass or fail during automated UI tests, use the cmd attention interface:
1. Query Supported Attention Features
adb shell cmd attention check-service
2. Call an Instant Attention Check
Trigger an on-demand presence scan to evaluate camera activation speed:
adb shell cmd attention call-check
3. Simulate Attention Check Results for QA Automation
To test whether your application stays awake without needing a physical tester in front of the camera, inject synthetic attention states:
# Force attention check to succeed
adb shell cmd attention set-test-result 1
# Clear synthetic overrides and restore live camera sensing
adb shell cmd attention clear-test-result
Monitoring Sensor Privacy Impact
If the user toggles the global Camera Privacy Switch in Android Quick Settings, attention checks are automatically suspended. You can correlate attention check failures with camera privacy state using:
adb shell dumpsys sensor_privacy | grep -i "camera"
When camera access is blocked, dumpsys attention logs immediate bypass codes without spinning up the camera hardware, preserving user privacy preferences.
Utilising dumpsys attention equips Android engineers and battery performance analysts with rigorous visibility into facial presence sensing, enabling optimal calibration of display timeout algorithms and context-aware UI rotation.