UPDATE: My initial question may be misleading so I want to rephrase it: I want to traverse through the hierarchy tree from an MTP connected device through Android\'s Storage
After different attempts, I'm not sure there is a way around this SecurityException
for an MTP Data Source (unless someone can refute me on this). Looking at the DocumentProvider.java
source code and the stack trace, it appears that the call to DocumentProvider#isChildDocument
inside DocumentProvider#enforceTree
may not have been properly overriden in the MtpDocumentProvider
implementation in the Android framework. Default implementation always returns false
. #sadface