UsageStatsManager.queryEvents does not return SCREEN_INTERACTIVE and USER_INTERACTION event in Android 11

29 views Asked by At

I am developing an app. But while testing on the emulator(Android 11) what I am getting are only events of type 1, 2, 23 which corresponds to ACTIVITY_RESUMED, ACTIVITY_PAUSED, ACTIVITY_STOPPED. But for my use case, what I want to track especially are the events SCREEN_INTERACTIVE AND USER_INTERACTION.

What my code is doing is that it I am using workermanager to run background task, and in that I am querying events every 5 minutes. I am keeping the startTime as 5 minutes back from the current time. and in this 5 minutes. I am using another app for testing. like doing various possible interactions in it.

But I am only getting the above mentioned events but not the ones I am interested in i,e SCREEN_INTERACTIVE AND USER_INTERACTION

0

There are 0 answers