5fdfbc2e02f46509474057e4366585f6a6062cb9 |
|
17-Sep-2014 |
Jeff Sharkey <jsharkey@android.com> |
Utility to represent document trees. API 21 adds the powerful new ACTION_OPEN_DOCUMENT_TREE, but it can be tedious to use correctly, and developers can be overwhelmed when suddenly forced to use it because of SD card security changes. To ease the transition process, this change introduces a new DocumentFile object that looks and feels like a traditional java.util.File object. However, it has nontrivial overhead because it creates new objects for every file traversed, and because it doesn't cache any metadata. Since developers probably have code heavily using java.util.File, offer fromFile() to simplify their code paths; they can adopt DocumentFile and have their core logic work on both API 21 and older versions. Bug: 17490054 Change-Id: I034a0d6b800bcba489e5a6231b4fe62b5076456d
/frameworks/support/tests/java/android/support/v4/provider/DocumentFileTest.java
|