Sdílet prostřednictvím


UsbManager.HasPermission Method

Definition

Overloads

HasPermission(UsbAccessory)

Returns true if the caller has permission to access the accessory.

HasPermission(UsbDevice)

Returns true if the caller has permission to access the device.

HasPermission(UsbAccessory)

Returns true if the caller has permission to access the accessory.

[Android.Runtime.Register("hasPermission", "(Landroid/hardware/usb/UsbAccessory;)Z", "GetHasPermission_Landroid_hardware_usb_UsbAccessory_Handler")]
public virtual bool HasPermission (Android.Hardware.Usb.UsbAccessory? accessory);
[<Android.Runtime.Register("hasPermission", "(Landroid/hardware/usb/UsbAccessory;)Z", "GetHasPermission_Landroid_hardware_usb_UsbAccessory_Handler")>]
abstract member HasPermission : Android.Hardware.Usb.UsbAccessory -> bool
override this.HasPermission : Android.Hardware.Usb.UsbAccessory -> bool

Parameters

accessory
UsbAccessory

to check permissions for

Returns

true if caller has permission

Attributes

Remarks

Returns true if the caller has permission to access the accessory. Permission might have been granted temporarily via #requestPermission(UsbAccessory, PendingIntent) or by the user choosing the caller as the default application for the accessory.

Java documentation for android.hardware.usb.UsbManager.hasPermission(android.hardware.usb.UsbAccessory).

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.

Applies to

HasPermission(UsbDevice)

Returns true if the caller has permission to access the device.

[Android.Runtime.Register("hasPermission", "(Landroid/hardware/usb/UsbDevice;)Z", "GetHasPermission_Landroid_hardware_usb_UsbDevice_Handler")]
public virtual bool HasPermission (Android.Hardware.Usb.UsbDevice? device);
[<Android.Runtime.Register("hasPermission", "(Landroid/hardware/usb/UsbDevice;)Z", "GetHasPermission_Landroid_hardware_usb_UsbDevice_Handler")>]
abstract member HasPermission : Android.Hardware.Usb.UsbDevice -> bool
override this.HasPermission : Android.Hardware.Usb.UsbDevice -> bool

Parameters

device
UsbDevice

to check permissions for

Returns

true if caller has permission

Attributes

Remarks

Returns true if the caller has permission to access the device. Permission might have been granted temporarily via #requestPermission(UsbDevice, PendingIntent) or by the user choosing the caller as the default application for the device. Permission for USB devices of class UsbConstants#USB_CLASS_VIDEO for clients that target SDK android.os.Build.VERSION_CODES#P and above can be granted only if they have additionally the android.Manifest.permission#CAMERA permission.

Java documentation for android.hardware.usb.UsbManager.hasPermission(android.hardware.usb.UsbDevice).

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.

Applies to