setAccessGranted

@MinApiLevel(value = 4)
public void setAccessGranted(@NonNull() String packageName, boolean isGranted)

Grants or denies USB access permissions for an app. Once granted via this method, the apps no more need to request for permission via requestPermission.

Parameters

packageName

package name for the target app

isGranted

specified whether or not to grant permission to the app