In the Android operating system, inter-application navigation and workflow handoffs rely on Intents. When a user taps a web link, clicks an email address, takes a photo, or initiates a phone call, the originating application broadcasts an implicit intent (such as ACTION_VIEW, ACTION_SEND, or ACTION_DIAL). When multiple installed applications declare intent filters capable of handling the action—for instance, three different web browsers or two navigation apps—the Android Package Manager must either prompt the user with a disambiguation dialogue or resolve the request to the user’s designated default application.
For mobile enterprise administrators, MDM engineers, and Android developers, troubleshooting intent resolution failures, unexpected browser hijacking, or broken deep links requires inspecting the internal preferred activities database. While modern Android releases expose high-level default app selectors inside the Settings app, the low-level intent filters, match priorities, and explicit component bindings are managed by the Package Manager. Using dumpsys package preferred-apps via the Android Debug Bridge (ADB), you can audit default application associations, inspect intent filter match criteria, and reset disambiguation states directly from the command line.
Architecture of Preferred Activities in Android
The Android Package Manager Service (PackageManagerService) maintains a dedicated persistent registry called the Preferred Activity Map:
- Intent Matching: When an implicit intent is dispatched, the Package Manager queries all installed application packages whose
AndroidManifest.xmlfiles declare matching<intent-filter>tags. - Preferred Resolution: If the user previously selected “Always” in the system disambiguation dialogue or configured a default app in Settings, the Package Manager creates a
PreferredActivityrecord that maps the exact intent parameters (action, category, data URI scheme, MIME type) directly to a target component (Package Name / Activity Name). - Filter Verification: Before dispatching to the preferred activity, the Package Manager validates that the registered component is still installed, enabled, and that its intent filter signature has not been invalidated by an application update.
Querying Preferred Applications via ADB
To inspect active default application mappings across your connected Android device or emulator, open a command prompt or terminal on your workstation.
To inspect the complete preferred activities database, execute:
adb shell dumpsys package preferred-apps
This command queries the Package Manager and outputs a structured breakdown of every preferred activity registered for each user profile (User 0 for the primary owner, User 10 for work profiles, etc.).
A representative snippet appears as follows:
Preferred Activities (User 0):
Activity [com.android.chrome/com.google.android.apps.chrome.Main]
Match: 0x208000
Action: "android.intent.action.VIEW"
Category: "android.intent.category.BROWSABLE"
Category: "android.intent.category.DEFAULT"
Scheme: "http"
Scheme: "https"
Activity [com.google.android.apps.messaging/.ui.ConversationListActivity]
Action: "android.intent.action.SENDTO"
Scheme: "smsto"
Scheme: "sms"
Analysing Intent Filters and Match Levels
The output of dumpsys package preferred-apps exposes the exact cryptographic and functional criteria used by the system to resolve implicit intents:
Activity: The target ComponentName inpackage/classformat that receives the intent execution.Match: The hexadecimal match quality score computed by the Package Manager (e.g.0x208000). Higher match scores indicate specific data URI scheme and authority matches, which take precedence over generic wildcard filters.Action: The standard Android intent action (e.g.android.intent.action.VIEW,android.intent.action.MAIN).Category: Intent categories required for the resolution (e.g.CATEGORY_DEFAULTandCATEGORY_BROWSABLE).Scheme: Supported URI schemes (such ashttp,https,tel,mailto,geo).
If an expected default application fails to open when tapping a link, verify whether the target app’s registered schemes match the incoming URI protocol.
Auditing Default Home Screen Launchers
In corporate environments and kiosk deployments, ensuring that a custom enterprise launcher remains the enforced default home screen is critical.
To inspect the default home launcher registration in the preferred activities list:
adb shell dumpsys package preferred-apps | grep -B 2 -A 5 "android.intent.category.HOME"
The output displays the currently active home launcher:
Activity [com.google.android.apps.nexuslauncher/.NexusLauncherActivity]
Action: "android.intent.action.MAIN"
Category: "android.intent.category.HOME"
Category: "android.intent.category.DEFAULT"
If multiple launchers are installed and no preferred record is listed under category.HOME, the device will prompt the user with a launcher selection dialogue upon pressing the home button.
Auditing App Links and Domain Verification
In modern Android versions (Android 12 and later), web URLs (HTTP/HTTPS) are governed by Android App Links and domain verification rather than standard preferred activities.
To inspect domain verification states for deep-linked web domains:
adb shell dumpsys package domain-preferred-apps
To check whether a specific package (such as an e-commerce or banking app) has successfully verified its Digital Asset Links JSON file to open web URLs natively:
adb shell pm get-app-links com.example.shopapp
A status of verified confirms that clicking links matching the app’s verified domains will open directly inside the native app without launching the default browser.
Clearing and Resetting Preferred Application Defaults via ADB
When testing application handoffs or resolving corrupted intent mappings, you can clear preferred activity registrations directly from ADB without factory resetting the device.
To clear all preferred defaults associated with a specific package (e.g. Chrome):
adb shell pm clear-app-preferred-activities com.android.chrome
Once cleared, re-launching a web link will prompt Android to display the “Open with” disambiguation dialogue, allowing you to select and re-bind a new default application.