See Also: UsageStatsManager Members
Provides access to device usage history and statistics. Usage data is aggregated into time intervals: days, weeks, months, and years.
When requesting usage data since a particular time, the request might look something like this: A request for data in the middle of a time interval will include that interval.
NOTE: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application.