提交 88457c10 编写于 作者: Z Zhang Rui

android: simplify as lint suggested

上级 19338cdb
......@@ -95,15 +95,11 @@ public abstract class AbstractMediaPlayer implements IMediaPlayer {
}
protected final boolean notifyOnError(int what, int extra) {
if (mOnErrorListener != null)
return mOnErrorListener.onError(this, what, extra);
return false;
return mOnErrorListener != null && mOnErrorListener.onError(this, what, extra);
}
protected final boolean notifyOnInfo(int what, int extra) {
if (mOnInfoListener != null)
return mOnInfoListener.onInfo(this, what, extra);
return false;
return mOnInfoListener != null && mOnInfoListener.onInfo(this, what, extra);
}
public void setDataSource(IMediaDataSource mediaDataSource) {
......
......@@ -359,19 +359,15 @@ public class AndroidMediaPlayer extends AbstractMediaPlayer {
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
AndroidMediaPlayer self = mWeakMediaPlayer.get();
if (self == null)
return false;
return self != null && notifyOnInfo(what, extra);
return notifyOnInfo(what, extra);
}
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
AndroidMediaPlayer self = mWeakMediaPlayer.get();
if (self == null)
return false;
return self != null && notifyOnError(what, extra);
return notifyOnError(what, extra);
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册