[sonar] fix sonar plm
This commit is contained in:
@@ -6,14 +6,12 @@ import android.text.TextUtils;
|
||||
|
||||
//播放试听
|
||||
public class Audition implements MediaPlayer.OnPreparedListener, MediaPlayer.OnCompletionListener{
|
||||
private static volatile Audition INSTANCE;
|
||||
public MediaPlayer mediaPlayer;
|
||||
private String oldPath;
|
||||
private OnAuditionListener listener;
|
||||
|
||||
public interface OnAuditionListener {
|
||||
void onAuditionCompletion();
|
||||
|
||||
}
|
||||
|
||||
public void registerOnAuditionListener(OnAuditionListener listener) {
|
||||
@@ -28,16 +26,12 @@ public class Audition implements MediaPlayer.OnPreparedListener, MediaPlayer.OnC
|
||||
}
|
||||
|
||||
public static Audition getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (Audition.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new Audition();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
return Holder.INSTANCE;
|
||||
}
|
||||
|
||||
private static final class Holder{
|
||||
private static final Audition INSTANCE = new Audition();
|
||||
}
|
||||
|
||||
public boolean isPlaying() {
|
||||
return mediaPlayer != null && mediaPlayer.isPlaying();
|
||||
|
||||
@@ -7,9 +7,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.listener.RecordListe
|
||||
|
||||
|
||||
public class RecordManager {
|
||||
private static final String TAG = RecordManager.class.getSimpleName();
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private volatile static RecordManager instance;
|
||||
private final RecordHelper recordHelper;
|
||||
/**
|
||||
* 录音配置
|
||||
@@ -21,14 +19,11 @@ public class RecordManager {
|
||||
}
|
||||
|
||||
public static RecordManager getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (RecordManager.class) {
|
||||
if (instance == null) {
|
||||
instance = new RecordManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
return Holder.instance;
|
||||
}
|
||||
|
||||
private static final class Holder{
|
||||
private static final RecordManager instance = new RecordManager();
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
Reference in New Issue
Block a user