public abstract class UsageStatsManagerInternal extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UsageStatsManagerInternal.AppIdleStateChangeListener |
Constructor and Description |
---|
UsageStatsManagerInternal() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addAppIdleStateChangeListener(UsageStatsManagerInternal.AppIdleStateChangeListener listener)
Sets up a listener for changes to packages being accessed.
|
abstract void |
applyRestoredPayload(int user,
String key,
byte[] payload) |
abstract byte[] |
getBackupPayload(int user,
String key) |
abstract int[] |
getIdleUidsForUser(int userId)
Returns all of the uids for a given user where all packages associating with that uid
are in the app idle state -- there are no associated apps that are not idle.
|
abstract boolean |
isAppIdle(String packageName,
int uidForAppId,
int userId)
Returns true if the app has not been used for a certain amount of time.
|
abstract boolean |
isAppIdleParoleOn() |
abstract void |
prepareShutdown()
Prepares the UsageStatsService for shutdown.
|
abstract void |
removeAppIdleStateChangeListener(UsageStatsManagerInternal.AppIdleStateChangeListener listener)
Removes a listener that was previously added for package usage state changes.
|
abstract void |
reportConfigurationChange(Configuration config,
int userId)
Reports a configuration change to the UsageStatsManager.
|
abstract void |
reportContentProviderUsage(String name,
String pkgName,
int userId)
Reports that a content provider has been accessed by a foreground app.
|
abstract void |
reportEvent(ComponentName component,
int userId,
int eventType)
Reports an event to the UsageStatsManager.
|
abstract void |
reportEvent(String packageName,
int userId,
int eventType)
Reports an event to the UsageStatsManager.
|
abstract void |
reportShortcutUsage(String packageName,
String shortcutId,
int userId)
Reports that an action equivalent to a ShortcutInfo is taken by the user.
|
public abstract void reportEvent(ComponentName component, int userId, int eventType)
component
- The component for which this event occurred.userId
- The user id to which the component belongs to.eventType
- The event that occurred. Valid values can be found at
UsageEvents
public abstract void reportEvent(String packageName, int userId, int eventType)
packageName
- The package for which this event occurred.userId
- The user id to which the component belongs to.eventType
- The event that occurred. Valid values can be found at
UsageEvents
public abstract void reportConfigurationChange(Configuration config, int userId)
config
- The new device configuration.public abstract void reportShortcutUsage(String packageName, String shortcutId, int userId)
packageName
- The package name of the shortcut publishershortcutId
- The ID of the shortcut in questionuserId
- The user in which the content provider was accessed.ShortcutManager.reportShortcutUsed(String)
public abstract void reportContentProviderUsage(String name, String pkgName, int userId)
name
- The authority of the content providerpkgName
- The package name of the content provideruserId
- The user in which the content provider was accessed.public abstract void prepareShutdown()
public abstract boolean isAppIdle(String packageName, int uidForAppId, int userId)
packageName
- uidForAppId
- The uid of the app, which will be used for its app iduserId
- public abstract int[] getIdleUidsForUser(int userId)
public abstract boolean isAppIdleParoleOn()
public abstract void addAppIdleStateChangeListener(UsageStatsManagerInternal.AppIdleStateChangeListener listener)
listener
- A listener within the system process.public abstract void removeAppIdleStateChangeListener(UsageStatsManagerInternal.AppIdleStateChangeListener listener)
listener
- The listener within the system process to remove.public abstract byte[] getBackupPayload(int user, String key)
public abstract void applyRestoredPayload(int user, String key, byte[] payload)