If real-time usage stats is required, try running it as a foreground service. Or if it's ok, access the usage stats only when the user is actively interacting with your app. If your app attempts to gather UsageStatsManager data while in the background, it may fail or receive outdated information. Also make sure your app isn't restricted by battery optimization settings