1# Device Usage Statistics Overview 2 3With device usage statistics APIs, you can have a better understanding of the application, notification, and system usage. In application usage statistics, you can query the application usage, event log, and bundle group. The application records (usage history statistics and event records) cached by components are updated to the database for persistent storage within 30 minutes after an event is reported. 4 5## Introduction 6 7Currently you can have access to statistics on the application usage, and the notification and system usage statistics feature will be available for use in later versions. 8 9- **The application usage statistics is updated**: 10 1. Every 30 minutes 11 2. Upon system time change 12 3. Upon start of a new day 13 14- **The application usage statistics can include the following**: 15 1. Events of all applications based on the specified start time and end time 16 2. Application usage duration statistics based on the specified start time and end time 17 3. Events of the current application based on the specified start time and end time 18 4. Application usage duration statistics in the specified time frame at the specified interval (daily, weekly, monthly, or annually) 19 5. Priority group of the current invoker application 20 6. Whether a specific application is in the idle state 21 7. Number of FA usage records specified by **maxNum**, sorted by time (most recent first). If **maxNum** is not specified, the default value **1000** will be used. 22 8. Number of notifications from applications based on the specified start time and end time 23 9. Statistics about system events (hibernation, wakeup, unlocking, and screen locking) that occur between the specified start time and end time 24 10. Priority group of the invoker application or a specified application 25 26- **The setters can be used to:** 27 28 Set the group for the application specified by **bundleName**. 29 30- **The registration APIs can be used to:** 31 32 Register a callback for application group changes. When an application group of the user changes, the change is returned to all applications that have registered the callback. 33 34- **The deregistration APIs can be used to:** 35 36 Deregister the callback for application group changes. 37 38## Required Permissions 39- Before calling the following system APIs, you must request the **ohos.permission.BUNDLE_ACTIVE_INFO** permission: **isIdleState**, **queryBundleEvents**, **queryBundleStatsInfos**, **queryBundleStatsInfoByInterval**, **queryDeviceEventStats**, **queryNotificationEventStats**, **queryAppGroup(bundleName)**, **setAppGroup**, **registerAppGroupCallBack**, **unregisterAppGroupCallBack**, **queryModuleUsageRecords**, and **queryModuleUsageRecords(maxnum)**. 40- You do not need to request this permission before calling **queryCurrentBundleEvents** and **queryAppGroup()**, which are third-party APIs. 41