Don't try to output really long URLs HTML5Audio exception handler.
If we catch an IOException in HTML5Audio.setDataSource, do not try and output the URL if it's really long as this will likely lead to an OOM exception being thrown. Bug: 3486963 Change-Id: If10a489b03ec215e078490a81910b02d68190612
This commit is contained in:
@@ -173,7 +173,8 @@ class HTML5Audio extends Handler
|
||||
mState = INITIALIZED;
|
||||
mMediaPlayer.prepareAsync();
|
||||
} catch (IOException e) {
|
||||
Log.e(LOGTAG, "couldn't load the resource: " + url + " exc: " + e);
|
||||
String debugUrl = url.length() > 128 ? url.substring(0, 128) + "..." : url;
|
||||
Log.e(LOGTAG, "couldn't load the resource: "+ debugUrl +" exc: " + e);
|
||||
resetMediaPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user