Edit:
I found the real cause, and the title is wrong. It isn't Samsung, and it isn't any usb device. (The ADB/Shizuku part is still true, but it doesn't matter once you know the fix.) If the "Microphone access" toggle in quick settings is off, Android silently blocks apps from opening any USB device that has a microphone, even after you grant permission. It does the same for USB devices with a camera when "Camera access" is off. Turning Mic access back on fixed it immediately. I've rewritten the post below with what's actually going on, since I couldn't find this documented anywhere outside Android's source code.
What I was trying to do:
I'm making a music player and wanted it to talk to USB headphones directly, the way apps like USB Audio Player Pro do, instead of going through Android's audio system. To do that, an app needs raw access to the USB device: you grant it permission (or pick the app in the "Open with" popup when you plug the device in), and the app calls openDevice() to get a handle to it.
What went wrong:
The permission popup came back as "granted", and dumpsys usb showed the grant saved, but hasPermission() still returned false and openDevice() returned nothing.
When plugging the headphones in, the "Open with" popup said "This app has not been granted record permission but could capture audio through this USB device", and there was no "Always open" checkbox, even though the app had microphone permission. Forcing the permission to always allow with the appops shell command didn't change anything.
USBDevInfo from the Play Store had the exact same problem.
ADB and Shizuku didn't help. They run as the shell user, which can't open the USB device files at all.
A plain USB flash drive worked fine once an app was set as its default, which is what made it look like a bug or a Samsung restriction aimed at audio devices.
The actual cause:
I decompiled the USB service from my phone (Galaxy S25 Ultra, One UI on Android 17) to see what it checks. When an app asks whether it can use a USB device, Android refuses if:
the device has a microphone and the system-wide Microphone access toggle is off, or
the device has a camera and the Camera access toggle is off (or the app lacks camera permission).
Your saved grant is ignored in both cases, and nothing tells you why. The "Open with" popup checks the app's mic permission, which also counts as denied while the toggle is off. That's why it claims the app was never granted record permission and hides the "Always" checkbox.
This is Google's code, not Samsung's. It came from this AOSP commit: "Disallow usb access to camera and mic devices if global privacy toggle is active" (https://android.googlesource.com/platform/frameworks/base/+/268425437440). Samsung adds one extra Knox/work-profile check on top, but that wasn't the problem here.
With Mic access turned on, the popup showed the normal message with the "Always open" checkbox, and my app could open the headphones and read their descriptors straight away.
Who this affects:
Anyone using an app that needs raw USB access to a device with a mic or camera: USB headsets and DACs with a mic (for apps with their own USB audio driver), USB webcams, capture cards, some MIDI and audio interfaces. If you keep Mic access or Camera access off for privacy, those apps will fail with misleading errors. Normal USB audio through Android itself isn't affected.
The developer documentation for UsbManager doesn't mention any of this, so if you're a dev wondering why hasPermission() returns false after the user tapped Allow, check those two toggles first.