Language

PermissionCheckCode Enum

Definition

Specifies the result of a service permission check.

public enum PermissionCheckCode
type PermissionCheckCode = 
Inheritance
PermissionCheckCode

Fields

Name Value Description
Granted 1

Indicates the caller can register service info callbacks or resolve a service.

This is a result code for checkPermissionForService(String,String,Executor,IntConsumer).

Android reference for android.net.nsd.NsdManager.SERVICE_PERMISSION_GRANTED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Denied 2

Indicates the caller is not allowed to register service info callbacks or resolve a service.

This is a result code for checkPermissionForService(String,String,Executor,IntConsumer).

Android reference for android.net.nsd.NsdManager.SERVICE_PERMISSION_DENIED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Remarks

These are alternative result codes, not flags. NsdManager.CheckPermissionForService checks the stored service approval list for the caller. The result indicates whether Android remembers picker approval for access to that service without the local network permission; it is not a check of all permissions that can allow access.

For apps that target Android 17 (API level 37) or later, the local network permission rules apply. A Denied result does not negate an independently granted android.permission.ACCESS_LOCAL_NETWORK permission: resolution and service information callback registration can still be permitted through that permission. A previous picker selection can be revoked; this check does not guarantee that the service is available.

Android 17 source for NsdManager.checkPermissionForService and its result codes.

Android 17 implementation of the stored service approval check and the independent local network permission check.

Applies to