Here is a scenario you will run into sooner or later building Android kiosk apps, digital signage, or any long-running background service: you need to know when the user has not interacted with the device for a certain amount of time. Maybe you want to show content after 20 seconds of idle time, then dismiss it the instant someone touches the screen again. You start looking for the right API. PowerManager.isInteractive() tells you if the screen is on, not if anyone is actually using it. onUserInteraction() in an Activity only fires when your own Activity is in the foreground. There is no getLastInteractionTime() anywhere in the SDK. Eventually you land on AccessibilityService, try it, and it works perfectly. This article walks you through exactly how, and why. AccessibilityService is designed for assistive technology โ€” screen readers, switch access, voice control. That is its primary documented purpose. But what makes it useful for our use case is a side effect of how it works: the service receives accessibility events from any app on the device, system-wide, while running in the background. These events include: TYPE_TOUCH_INTERACTION_START โ€” user touched the screen TYPE_VIEW_CLICKED โ€” user tapped a view TYPE_VIEW_SCROLLED โ€” user scrolled content TYPE_GESTURE_DETECTION_START โ€” a gesture was recognized In other words: as long as the screen is on and the user is doing something, your service receives a steady stream of events. When that stream goes quiet, the user is idle. A word on Google Play policy: AccessibilityService is a privileged API. Google Play has strict rules about what justifies its use. For kiosk apps, enterprise deployments, or apps distributed outside the Play Store, this is a legitimate tool. Never use it to collect sensitive data or surveil users. If you are building a consumer app, check whether your use case actually qualifies before submitting to the store. Android Studio Hedgehog or later Min SDK 26+ Kotlin 1.9+ Basic familiarity with Android S