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 that the check found stored approval for the service.

This is a result code for CheckPermissionForService(String, String, IExecutor, IIntConsumer).

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 that the check did not report stored approval for the service. An independent local network permission can still allow access.

This is a result code for CheckPermissionForService(String, String, IExecutor, IIntConsumer).

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.

Applies to