Issues traversing through directory hierarchy with Android Storage Access Framework / DocumentProvider using MTP

前端 未结 3 433
名媛妹妹
名媛妹妹 2020-12-11 20:47

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

3条回答
  •  轮回少年
    2020-12-11 21:26

    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

提交回复
热议问题