diff options
author | riddle_hsu <riddle_hsu@htc.com> | 2014-11-15 18:16:49 +0800 |
---|---|---|
committer | riddle_hsu <riddle_hsu@htc.com> | 2014-11-15 18:16:49 +0800 |
commit | 98f1f3400d7c5c3b2c3b22f57f590e1b9e5d484d (patch) | |
tree | d5918e0b9e696568679955e96b6555ba60be81bb /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | 5e6cf24213c5eacc9d3e3c8da5826be4a23f22af (diff) |
[ActivityManager] Ensure provider external access count will be released.
Sympton: Oom-adj of provider process will be always 0.
Root Cause: Exception happend in openContentUri
may not call removeContentProviderExternalUnchecked.
Flow:
application [MediaPlayer.setDataSource(Context context, Uri uri)]
uri is invalid, IOException will be caught and below log will appear:
"Couldn't open file on client side, trying server side"
Continue to call setDataSource(String path, Map<String, String> headers)
->mediaserver [MediaPlayerService::Client::setDataSource]
setDataSource(httpService, url, headers) calls openContentProviderFile
->system_server (ActivityManagerService) [openContentUri]
Increase externalProcessNoHandleCount for media provider.
Call [openFile] to media provider.
->android.process.media [check permission for openFile]
enforceReadPermissionInner
->system_server [checkComponentPermission]
Use mediaserver's uid to check READ_EXTERNAL_STORAGE
-> not granted due to it is pure native process, not a known package.
Throw security exception then the flow of openContentUri is broke.
And externalProcessNoHandleCount is unable to decrease.
Application sample code:
String invalidId = "54321";
Uri externalUri = MediaStore.Files.getContentUri("external");
Uri uri = Uri.withAppendedPath(externalUri, invalidId);
mediaPlayer.setDataSource(mContext, uri);
Solution: Move removeContentProviderExternalUnchecked to finally block.
Change-Id: I75eec1f9631e9c6bb18449946d707d51ac21e8a7
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions