5

Before API 29, we can remove the launcher icon in the device by removing

<intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

in the manifest file.

As stated here

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:

  • The app is a system app.

  • The app doesn't request any permissions.

  • The app doesn't have a launcher activity that is enabled by default. A launcher activity has an intent containing the ACTION_MAIN action and the CATEGORY_LAUNCHER category.

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

    If the device is a fully managed device, no synthesized activities for any app appear in the returned list. If the current user has a work profile, no synthesized activities for the user's work apps appear in the returned list.

The third condition states as the same as not to have a launcher activity that is enabled.

How to achieve this in android 10?

1 Answers1

0

I believe the third condition is wrong or outdated.

The behavior on Google's current emulator image of Android 10 (Google APIs Intel x86 Atom System Image 29_r09) differs from the documentation:

getActivityList() always returns at least one activity, except if the app satisfies at least one:

  • system app
  • <application> tag is completely empty i.e. no activities, services, ... declared
  • no permissions declared

This behavior corresponds to the release notes from Android Q Beta:

Launcher icon visibility

In Android Q Beta 2, packages that don't declare any permissions in their respective manifest files are hidden from the All apps tray, as are the following types of apps:

  • System apps
  • Apps that don't contain any components inside their respective manifest's <application> tag
cuzi
  • 978
  • 10
  • 21