Callback
abstract class Callback
kotlin.Any | |
↳ | android.content.pm.LauncherApps.Callback |
Callbacks for package changes to this and related managed profiles.
Summary
Public constructors | |
---|---|
Callback() |
Public methods | |
---|---|
abstract Unit |
onPackageAdded(packageName: String!, user: UserHandle!) Indicates that a package was added to the specified profile. |
abstract Unit |
onPackageChanged(packageName: String!, user: UserHandle!) Indicates that a package was modified in the specified profile. |
open Unit |
onPackageLoadingProgressChanged(packageName: String, user: UserHandle, progress: Float) Indicates that the loading progress of an installed package has changed. |
abstract Unit |
onPackageRemoved(packageName: String!, user: UserHandle!) Indicates that a package was removed from the specified profile. |
abstract Unit |
onPackagesAvailable(packageNames: Array<String!>!, user: UserHandle!, replacing: Boolean) Indicates that one or more packages have become available. |
open Unit |
onPackagesSuspended(packageNames: Array<String!>!, user: UserHandle!) Indicates that one or more packages have been suspended. |
open Unit |
onPackagesSuspended(packageNames: Array<String!>!, user: UserHandle!, launcherExtras: Bundle?) Indicates that one or more packages have been suspended. |
abstract Unit |
onPackagesUnavailable(: Array<String!>!, : UserHandle!, : Boolean) Indicates that one or more packages have become unavailable. |
open Unit |
onPackagesUnsuspended(packageNames: Array<String!>!, user: UserHandle!) Indicates that one or more packages have been unsuspended. |
open Unit |
onShortcutsChanged(packageName: String, shortcuts: MutableList<ShortcutInfo!>, user: UserHandle) Indicates that one or more shortcuts of any kind (dynamic, pinned, or manifest) have been added, updated or removed. |
Public constructors
Callback
Callback()
Public methods
onPackageAdded
abstract fun onPackageAdded(
packageName: String!,
user: UserHandle!
): Unit
Indicates that a package was added to the specified profile. If a package is added while being updated then onPackageChanged will be called instead.
Parameters | |
---|---|
packageName |
String!: The name of the package that was added. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
onPackageChanged
abstract fun onPackageChanged(
packageName: String!,
user: UserHandle!
): Unit
Indicates that a package was modified in the specified profile. This can happen, for example, when the package is updated or when one or more components are enabled or disabled.
Parameters | |
---|---|
packageName |
String!: The name of the package that has changed. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
onPackageLoadingProgressChanged
open fun onPackageLoadingProgressChanged(
packageName: String,
user: UserHandle,
progress: Float
): Unit
Indicates that the loading progress of an installed package has changed.
Parameters | |
---|---|
packageName |
String: The name of the package that has changed. This value cannot be null . |
user |
UserHandle: The UserHandle of the profile that generated the change. This value cannot be null . |
progress |
Float: The new progress value, between [0, 1]. |
onPackageRemoved
abstract fun onPackageRemoved(
packageName: String!,
user: UserHandle!
): Unit
Indicates that a package was removed from the specified profile. If a package is removed while being updated onPackageChanged will be called instead.
Parameters | |
---|---|
packageName |
String!: The name of the package that was removed. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
onPackagesAvailable
abstract fun onPackagesAvailable(
packageNames: Array<String!>!,
user: UserHandle!,
replacing: Boolean
): Unit
Indicates that one or more packages have become available. For example, this can happen when a removable storage card has reappeared.
Parameters | |
---|---|
packageNames |
Array<String!>!: The names of the packages that have become available. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
replacing |
Boolean: Indicates whether these packages are replacing existing ones. |
onPackagesSuspended
open fun onPackagesSuspended(
packageNames: Array<String!>!,
user: UserHandle!
): Unit
Indicates that one or more packages have been suspended. For example, this can happen when a Device Administrator suspends an applicaton.
Note: On devices running Android P
or higher, any apps that override onPackagesSuspended(java.lang.String[],android.os.UserHandle,android.os.Bundle)
will not receive this callback.
Parameters | |
---|---|
packageNames |
Array<String!>!: The names of the packages that have just been suspended. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
onPackagesSuspended
open funonPackagesSuspended(
packageNames: Array<String!>!,
user: UserHandle!,
launcherExtras: Bundle?
): Unit
Deprecated: launcherExtras
should be obtained by using getSuspendedPackageLauncherExtras(java.lang.String,android.os.UserHandle)
. For all other cases, onPackagesSuspended(java.lang.String[],android.os.UserHandle)
should be used.
Indicates that one or more packages have been suspended. A device administrator or an app with android.permission.SUSPEND_APPS
can do this.
A suspending app with the permission android.permission.SUSPEND_APPS
can optionally provide a Bundle
of extra information that it deems helpful for the launcher to handle the suspended state of these packages. The contents of this Bundle
are supposed to be a contract between the suspending app and the launcher.
Parameters | |
---|---|
packageNames |
Array<String!>!: The names of the packages that have just been suspended. |
user |
UserHandle!: the user for which the given packages were suspended. |
launcherExtras |
Bundle?: A Bundle of extras for the launcher, if provided to the system, null otherwise. |
onPackagesUnavailable
abstract fun onPackagesUnavailable(
: Array<String!>!,
: UserHandle!,
: Boolean
): Unit
Indicates that one or more packages have become unavailable. For example, this can happen when a removable storage card has been removed.
Parameters | |
---|---|
packageNames |
Array<String!>!: The names of the packages that have become unavailable. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
replacing |
Boolean: Indicates whether the packages are about to be replaced with new versions. |
onPackagesUnsuspended
open fun onPackagesUnsuspended(
packageNames: Array<String!>!,
user: UserHandle!
): Unit
Indicates that one or more packages have been unsuspended. For example, this can happen when a Device Administrator unsuspends an applicaton.
Parameters | |
---|---|
packageNames |
Array<String!>!: The names of the packages that have just been unsuspended. |
user |
UserHandle!: The UserHandle of the profile that generated the change. |
onShortcutsChanged
open fun onShortcutsChanged(
packageName: String,
shortcuts: MutableList<ShortcutInfo!>,
user: UserHandle
): Unit
Indicates that one or more shortcuts of any kind (dynamic, pinned, or manifest) have been added, updated or removed.
Only the applications that are allowed to access the shortcut information, as defined in hasShortcutHostPermission()
, will receive it.
Parameters | |
---|---|
packageName |
String: The name of the package that has the shortcuts. This value cannot be null . |
shortcuts |
MutableList<ShortcutInfo!>: All shortcuts from the package (dynamic, manifest and/or pinned). Only "key" information will be provided, as defined in ShortcutInfo#hasKeyFieldsOnly() . This value cannot be null . |
user |
UserHandle: The UserHandle of the profile that generated the change. This value cannot be null . |
See Also