Moving forward, all client file access really needs to be going through explicit APIs like openFileDescriptor(), since that allows the provider to better protect its underlying files. This change also changes several classes to use the AutoClosable pattern, which enables try-with-resources usage. Older release() methods are deprecated in favor of close(). Uniformly apply CloseGuard across several classes, using AtomicBoolean to avoid double-freeing, and fix several resource leaks and bugs related to MediaScanner allocation. Switch MediaScanner and friends to use public API instead of raw AIDL calls. Bug: 22958127 Change-Id: Id722379f72c9e4b80d8b72550d7ce90e5e2bc786
MediaFrameworkTest/ Uses instrumentation and so can be run with runtest. It assumes /sdcard/media_api/ has been populated. contents/media_api/ Push to /sdcard/media_api/ for use with MediaFrameworkTest: adb shell mkdir /sdcard/media_api adb push contents/media_api/ /sdcard/media_api/ All other subdirectories are manual tests or sample apps.