在package/apps/Mms/src/com/android/mms/transaction/MessagingNotification.java中方法updateNotification()的最后一行之前加入一句:
....
notification.audioStreamType = AudioManage.STREAM_ALARM; //加入这句
nm.notify(NOTIFICATION_ID, notification);
}
如是Android JB5需要设置默认声音值,要不然Notification服务的声音默认值会为空,播放不出声音:
需要设置一下声音值:
notification.defaults= Notification.DEFAULT_SOUND; //设置声音
notification.audioStreamType = AudioManager.STREAM_ALARM; //加入这句
nm.notify(NOTIFICATION_ID, notification);