[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/AudioProfileMana
ger.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<Integer, AudioProfileState>(PREDEFINED_PROFILES_COUNT);
/** Default values of ringer volume for different audio profiles. */
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;
/** Default values of notification volume for different audio profiles. */
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;
/** Default values of alarm volume for different audio profiles. */
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;
/** Default values of vibration for different audio profiles. */
final boolean DEFAULT_VIBRATION_GENERAL = false;
final boolean DEFAULT_VIBRATION_SILENT = false;
final boolean DEFAULT_VIBRATION_MEETING = true;
final boolean DEFAULT_VIBRATION_OUTDOOR = true;
/**
-
Default values that indicate whether the audible DTMF tone should be
-
played by the dialer when d
资料获取→专栏
ialing.
*/
final boolean DEFAULT_DTMFTONE_GENERAL = false;
final boolean DEFAULT_DTMFTONE_SILENT = false;
final boolean DEFAULT_DTMFTONE_MEETING = false;
final boolean DEFAULT_DTMFTONE_OUTDOOR = true;
/**
-
Default values of sound effect(Key clicks, lid open/close…) for
-
different audio profiles.
*/
final boolean DEFAULT_SOUNDEFFECT_GENERAL = false;
final boolean DEFAULT_SOUNDEFFECT_SILENT = false;
final boolean DEFAULT_SOUNDEFFECT_MEETING = false;
final boolean DEFAULT_SOUNDEFFECT_OUTDOOR = false;
/** Default values that indicate whether the lock screen sound are enabled. */
final boolean DEFAULT_LOCK_SCREEN_GENERAL = false;
final boolean DEFAULT_LOCK_SCREEN_SILENT = false;
final boolean DEFAULT_LOCK_SCREEN_MEETING = false;
final boolean DEFAULT_LOCK_SCREEN_OUTDOOR = true;
/** Default values that indicate whether the haptic feedback are enabled. */
final boolean DEFAULT_HAPTIC_FEEDBACK_GENERAL = false;
final boolean DEFAULT_HAPTIC_FEEDBACK_SILENT = false;
c feedback are enabled. */
final boolean DEFAULT_HAPTIC_FEEDBACK_GENERAL = false;
final boolean DEFAULT_HAPTIC_FEEDBACK_SILENT = false;