mt6735 静音模式下来电能震动
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
希望情景模式为静音模式时,来电可以震动
[SOLUTION]
首先修改Silent这个模式下,震动的默认值,即在AudioProfileManager.Java 的getDefaultState()中将DEFAULT_VIBRATION_SILENT设为true;
然后在AudioService.java的shouldVibrate()中 如下case AudioManager.VIBRATE_SETTING_ON的地方改成true:
public boolean shouldVibrate(int vibrateType) {
if (!mHasVibrator) return false;
switch (getVibrateSetting(vibrateType)) {
case AudioManager.VIBRATE_SETTING_ON:
// return getRingerMode() != AudioManager.RINGER_MODE_SILENT;
return true; //Modify this line
case AudioManager.VIBRATE_SETTING_ONLY_SILENT:
return getRingerMode() == AudioManager.RINGER_MODE_VIBRATE;
case AudioManager.VIBRATE_SETTING_OFF:
// return false, even for incoming calls
return false;
default:
return false;
}
}
希望情景模式为静音模式时,来电可以震动
[SOLUTION]
首先修改Silent这个模式下,震动的默认值,即在AudioProfileManager.Java 的getDefaultState()中将DEFAULT_VIBRATION_SILENT设为true;
然后在AudioService.java的shouldVibrate()中 如下case AudioManager.VIBRATE_SETTING_ON的地方改成true:
public boolean shouldVibrate(int vibrateType) {
if (!mHasVibrator) return false;
switch (getVibrateSetting(vibrateType)) {
case AudioManager.VIBRATE_SETTING_ON:
// return getRingerMode() != AudioManager.RINGER_MODE_SILENT;
return true; //Modify this line
case AudioManager.VIBRATE_SETTING_ONLY_SILENT:
return getRingerMode() == AudioManager.RINGER_MODE_VIBRATE;
case AudioManager.VIBRATE_SETTING_OFF:
// return false, even for incoming calls
return false;
default:
return false;
}
}
666666
顶顶顶