Android修改情景模式的默认值

[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;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值