[SOLUTION]
一,针对每个情景模式的默认值修改:
1,默认铃声是统一在alps/build/target/product/core.mk文件中设置,其中ro.config.notification_sound表示通知的默认铃声,ro.config.ringtone表示语音来电和视频来电的铃声,若希望语音来电和视频来电分开设置,请参考FAQ08273 [Audio Profile]如何设置视频来电铃的默认铃声:
PRODUCT_PROPERTY_OVERRIDES:=
ro.config.notification_sound=Proxima.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
ro.config.ringtone=Backroad.ogg
2,情景模式中的其他设定参考到
mediatek/frameworks/base/media/audio/java/com/mediatek/audioprofile/AudioProfileManager.java
中的getDefaultState()
public static AudioProfileState getDefaultState(String profileKey) {
if (null == sDEFAULTSTATES) {
IDefaultProfileStatesGetter defaultProfileStatesGetter =
MediatekClassFactory.createInstance(IDefaultProfileStatesGetter.class);
if (defaultProfileStatesGetter != null) {
sDEFAULTSTATES = defaultProfileStatesGetter.getDefaultProfileStates();
}
if (null == sDEFAULTSTATES) {
sDEFAULTSTATES = new HashMap
final int DEFAULT_RINGER_VOLUME_GENERAL = 8;
final int DEFAULT_RINGER_VOLUME_SILENT = 0;
final int DEFAULT_RINGER_VOLUME_MEETING = 0;
final int DEFAULT_RINGER_VOLUME_OUTDOOR = 15;
final int DEFAULT_NOTIFICATION_VOLUME_GENERAL = 8;
final int DEFAULT_NOTIFICATION_VOLUME_SILENT = 0;
final int DEFAULT_NOTIFICATION_VOLUME_MEETING = 0;
final int DEFAULT_NOTIFICATION_VOLUME_OUTDOOR = 15;
final int DEFAULT_ALARM_VOLUME_GENERAL = 8;
final int DEFAULT_ALARM_VOLUME_SILENT = 0;
final int DEFAULT_ALARM_VOLUME_MEETING = 0;
final int DEFAULT_ALARM_VOLUME_OUTDOOR = 15;
final boolean DEFAULT_VIBRATION_GENERAL = false;
final boolean DEFAULT_VIBRATION_SILENT = false;
final boolean DEFAULT_V
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
开源分享完整内容戳这里
IBRATION_MEETING = true;
final boolean DEFAULT_VIBRATION_OUTDOOR = true;
final boolean DEFAULT_DTMFTONE_GENERAL = false;
final boolean DEFAULT_DTMFTONE_SILENT = false;
final boolean DEFAULT_DTMFTONE_MEETING = false;
final boolean DEFAULT_DTMFTONE_OUTDOOR = true;
final boolean DEFAULT_SOUNDEFFECT_GENERAL = false;
final boolean DEFAULT_SOUNDEFFECT_SILENT = false;
final boolean DEFAULT_SOUNDEFFECT_MEETING = false;
final boolean DEFAULT_SOUNDEFFECT_OUTDOOR = false;
final boolean DEFAULT_LOCK_SCREEN_GENERAL = false;
final boolean DEFAULT_LOCK_SCREEN_SILENT = false;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)