Added in API level 31

DomainVerificationManager

public final class DomainVerificationManager
extends Object

java.lang.Object
   ↳ android.content.pm.verify.domain.DomainVerificationManager


System service to access domain verification APIs. Applications should use getDomainVerificationUserState(java.lang.String) if necessary to check if/how they are verified for a domain, which is required starting from platform Build.VERSION_CODES.S in order to open Intents which declare Intent#CATEGORY_BROWSABLE or no category and also match against Intent#CATEGORY_DEFAULT IntentFilters, either through an explicit declaration of Intent#CATEGORY_DEFAULT or through the use of PackageManager.MATCH_DEFAULT_ONLY, which is usually added for the caller when using Context#startActivity(Intent) and similar.

Summary

Public methods

DomainVerificationUserState getDomainVerificationUserState(String packageName)

Retrieve the user state for the given package and the Context's user.

Inherited methods

Public methods

getDomainVerificationUserState

Added in API level 31
public DomainVerificationUserState getDomainVerificationUserState (String packageName)

Retrieve the user state for the given package and the Context's user.

Parameters
packageName String: The app to query state for. This value cannot be null.

Returns
DomainVerificationUserState The user selection verification data for the given package for the user, or null if the package does not declare any HTTP/HTTPS domains.

Throws
PackageManager.NameNotFoundException