diff options
| author | 2023-01-14 04:43:50 +0000 | |
|---|---|---|
| committer | 2024-01-04 19:43:36 +0000 | |
| commit | 3ecb730deda990a59c20eedc866f0297832aedba (patch) | |
| tree | 1dfefac05eb8bd568f8e36708f2bf647c4439c08 | |
| parent | 1ba74fd3dfed42c319a3cc9bc831bd7a8057a360 (diff) | |
Expand on javadoc for stopped application state
BUG=264706988
Change-Id: I7d972380f6e0e784a46ae7c0f2e68e2147134bda
| -rw-r--r-- | core/java/android/content/Intent.java | 13 | ||||
| -rw-r--r-- | core/java/android/content/pm/ApplicationInfo.java | 13 |
2 files changed, 22 insertions, 4 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 183b9b0000d2..7c52238b477a 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -6971,16 +6971,21 @@ public class Intent implements Parcelable, Cloneable { public static final int FLAG_DEBUG_LOG_RESOLUTION = 0x00000008; /** * If set, this intent will not match any components in packages that - * are currently stopped. If this is not set, then the default behavior - * is to include such applications in the result. + * are currently + * {@linkplain android.content.pm.ApplicationInfo#FLAG_STOPPED stopped}. + * If this is not set, then the default behavior is to include such + * applications in the result. */ public static final int FLAG_EXCLUDE_STOPPED_PACKAGES = 0x00000010; /** * If set, this intent will always match any components in packages that - * are currently stopped. This is the default behavior when + * are currently + * {@linkplain android.content.pm.ApplicationInfo#FLAG_STOPPED stopped}. + * This is the default behavior when * {@link #FLAG_EXCLUDE_STOPPED_PACKAGES} is not set. If both of these * flags are set, this one wins (it allows overriding of exclude for - * places where the framework may automatically set the exclude flag). + * places where the framework may automatically set the exclude flag, + * such as broadcasts). */ public static final int FLAG_INCLUDE_STOPPED_PACKAGES = 0x00000020; diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 3713380485ea..869c621e8564 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -375,6 +375,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { /** * Value for {@link #flags}: true if this application's package is in * the stopped state. + * + * <p>Stopped is the initial state after an app is installed, before it is launched + * or otherwise directly interacted with by the user. The system tries not to + * start it unless initiated by a user interaction (typically launching its icon + * from the launcher, could also include user actions like adding it as an app widget, + * selecting it as a live wallpaper, selecting it as a keyboard, etc). Stopped + * applications will not receive broadcasts unless the sender specifies + * {@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES}. + * + * <p>Applications should avoid launching activies, binding to or starting services, or + * otherwise causing a stopped application to run unless initiated by the user. + * + * <p>An app can also return to the stopped state by a "force stop". */ public static final int FLAG_STOPPED = 1<<21; |