I am developing a file manager under Intellij IDEA 14.1.6 and I have to support USB OTG flash drives. My file manager works fine with USB OTG on devices with API < 23 (Marshmallow). I have seen multiple references with the statement (1, 2, 3):
...it doesn’t require full support until you choose to target version 23 in your application. If you are targeting version 22 or below, your application will request all permissions at install time just as it would on any device running an OS below Marshmallow.
My project has target:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22"/>
but Nexus 5 (upgraded to Android 6.0.1) can't see USB OTG flash drive, unlike to a few other devices with API 19, 21, 22 which can read and write to flash drive pretty easy.
The question is: Does anybody have checked this statement? Does this statement apply to API 23 or to its preview version (M) only? Does this statement apply to Android Studio only?
EDIT: The only way to get Nexus 5 with Marshmallow works with USB OTG as a previous API level devices is to use a command:
adb shell sm set-force-adoptable true
from terminal.