Commit c4a11e8b authored by qinmin's avatar qinmin Committed by Commit bot

Catch runtime exception when creating MediaThrottler

MediaPlayer.create() can throw Runtime exception.
Catch the exception to prevent app crash.

BUG=579702

Review URL: https://codereview.chromium.org/1611193004

Cr-Commit-Position: refs/heads/master@{#370783}
parent d55838aa
...@@ -107,6 +107,8 @@ class MediaThrottler implements MediaPlayer.OnErrorListener { ...@@ -107,6 +107,8 @@ class MediaThrottler implements MediaPlayer.OnErrorListener {
mPlayer = MediaPlayer.create(mContext, R.raw.empty); mPlayer = MediaPlayer.create(mContext, R.raw.empty);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
Log.e(TAG, "Exception happens while creating the watch dog player.", e); Log.e(TAG, "Exception happens while creating the watch dog player.", e);
} catch (RuntimeException e) {
Log.e(TAG, "Exception happens while creating the watch dog player.", e);
} }
if (mPlayer == null) { if (mPlayer == null) {
Log.e(TAG, "Unable to create watch dog player, treat it as server crash."); Log.e(TAG, "Unable to create watch dog player, treat it as server crash.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment