attention_monitor

command
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Overview

Monitor user presence via PowerManager and display state.

The AttentionService requires a callback binder and system permissions, making it inaccessible from shell context. This example achieves similar user-presence detection by querying PowerManager (IsInteractive, IsDeviceIdleMode, IsPowerSaveMode) and DisplayManager (brightness), which together indicate whether a user is actively using the device.

Build:

GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o build/attention_monitor ./examples/attention_monitor/
adb push build/attention_monitor /data/local/tmp/ && adb shell /data/local/tmp/attention_monitor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL