From 25266af6f3d88d484d6e3cc49b4bea847c1e55a8 Mon Sep 17 00:00:00 2001 From: Kevin Hufnagle Date: Wed, 14 Aug 2019 17:23:58 -0700 Subject: docs: Added desc. of launcher app criteria in Q As of Android Q, an app is included in the return value of LauncherApps#getActivityList() unless it fulfills specific criteria. This CL describes the conditions necessary for an app's activities to *not* appear in the list. Test: make ds-docs -j32 Bug: 130352392 Change-Id: I6a6e17351a6c1234229d1d7eb8147ee2c24ee2c9 --- core/java/android/content/pm/LauncherApps.java | 35 +++++++++++++++++++++++--- 1 file 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 ACTION_MAIN or CATEGORY_LAUNCHER, + * the system adds a synthesized activity to the list. This synthesized activity represents the + * app's details page within system settings. + * + *

Note: It's possible for system apps, such as app stores, to prevent + * the system from adding synthesized activities to the returned list.

+ * + *

As of Android Q, 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:

+ * + * + *

Additionally, the system hides synthesized activities for some or all apps in the + * following enterprise-related cases:

+ * * * @param packageName The specific package to query. If null, it checks all installed packages * in the profile. -- cgit v1.2.3-59-g8ed1b