Add <queries> so Outreach can actually see installed apps

Android 11+ package-visibility filtering makes getInstalledApplications()
and getLaunchIntentForPackage() return a very small subset unless the
caller declares <queries> or holds QUERY_ALL_PACKAGES.

OutreachMcpProvider.queryInstalledApps filters to apps that "have a
launcher" (MAIN + LAUNCHER) and launchApp invokes getLaunchIntentForPackage,
so the right shape is an <intent> query for MAIN+LAUNCHER. Also add
ACTION_VIEW queries for http/https so open_link can resolve browsers /
deep-link handlers.

Not using QUERY_ALL_PACKAGES -- Play Store policy is strict about that
permission and the targeted queries give us what the tools need.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Monk 2026-04-16 16:00:12 -04:00
parent f9cd248a68
commit 50ef690d4e

View file

@ -18,6 +18,27 @@
tappable notification. See GitHub issue #102. -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- Android 11+ package-visibility: without these <queries> declarations,
getInstalledApplications() only returns our own package plus a few
system components, and getLaunchIntentForPackage() returns null for
third-party apps. We specifically want apps the user could launch
(MAIN + LAUNCHER) and apps that can handle common ACTION_VIEW URIs
for open_link. See OutreachMcpProvider.queryInstalledApps / launchApp. -->
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
</queries>
<!-- === Usage === -->
<uses-permission