diff options
| author | 2019-08-28 22:08:47 +0000 | |
|---|---|---|
| committer | 2019-08-28 22:08:47 +0000 | |
| commit | b14d2dede2839b470bcdebdc5d2632fb5dabffa6 (patch) | |
| tree | 619536d722899b031055c7928a07a65c7d5547c2 | |
| parent | 3791f9b071ba271228898a6100be36ac0f80dab4 (diff) | |
| parent | 25266af6f3d88d484d6e3cc49b4bea847c1e55a8 (diff) | |
Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev
| -rw-r--r-- | core/java/android/content/pm/LauncherApps.java | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java index 037a149bfe37..c74daa8eadfc 100644 --- a/core/java/android/content/pm/LauncherApps.java +++ b/core/java/android/content/pm/LauncherApps.java @@ -503,9 +503,38 @@ public class LauncherApps { } /** - * Retrieves a list of launchable activities that match {@link Intent#ACTION_MAIN} and - * {@link Intent#CATEGORY_LAUNCHER}, for a specified user. Result may include - * synthesized activities like app details Activity injected by system. + * Retrieves a list of activities that specify {@link Intent#ACTION_MAIN} and + * {@link Intent#CATEGORY_LAUNCHER}, across all apps, for a specified user. If an app doesn't + * have any activities that specify <code>ACTION_MAIN</code> or <code>CATEGORY_LAUNCHER</code>, + * the system adds a synthesized activity to the list. This synthesized activity represents the + * app's details page within system settings. + * + * <p class="note"><b>Note: </b>It's possible for system apps, such as app stores, to prevent + * the system from adding synthesized activities to the returned list.</p> + * + * <p>As of <a href="/reference/android/os/Build.VERSION_CODES.html#Q">Android Q</a>, at least + * one of the app's activities or synthesized activities appears in the returned list unless the + * app satisfies at least one of the following conditions:</p> + * <ul> + * <li>The app is a system app.</li> + * <li>The app doesn't request any <a href="/guide/topics/permissions/overview">permissions</a>. + * </li> + * <li>The <code><application></code> tag in the app's manifest doesn't contain any child + * elements that represent + * <a href="/guide/components/fundamentals#DeclaringComponents">app components</a>.</li> + * </ul> + * + * <p>Additionally, the system hides synthesized activities for some or all apps in the + * following enterprise-related cases:</p> + * <ul> + * <li>If the device is a + * <a href="https://developers.google.com/android/work/overview#company-owned-devices-for-knowledge-workers">fully + * managed device</a>, no synthesized activities for any app appear in the returned list.</li> + * <li>If the current user has a + * <a href="https://developers.google.com/android/work/overview#employee-owned-devices-byod">work + * profile</a>, no synthesized activities for the user's work apps appear in the returned + * list.</li> + * </ul> * * @param packageName The specific package to query. If null, it checks all installed packages * in the profile. |