异常上报
1、修改异常上报提示音为系统提示音 2、调试窗控制中心鹰眼本地配置增加提示音开关
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.mogo.eagle.core.utilcode.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 提示音工具类
|
||||
* @since: 2022/6/17
|
||||
*/
|
||||
public class SoundUtils {
|
||||
|
||||
/**
|
||||
* 播放铃声
|
||||
*/
|
||||
public static void playRing(Context context) {
|
||||
try {
|
||||
//用于获取手机 默认提示音(RingtoneManager.TYPE_NOTIFICATION) 的Uri
|
||||
Uri ringUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
MediaPlayer mMediaPlayer = new MediaPlayer();
|
||||
mMediaPlayer.setDataSource(context, ringUri);
|
||||
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
|
||||
mMediaPlayer.setLooping(false);
|
||||
mMediaPlayer.prepare();
|
||||
mMediaPlayer.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user