Loading res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,9 @@ <!-- Determines if the granting of temporary location permission to the default dialer during an emergency call should be allowed. --> <bool name="grant_location_permission_enabled">false</bool> <!-- When true, a simple full intensity on/off vibration pattern will be used when calls ring. When false, a fancy vibration pattern which ramps up and down will be used. Devices should overlay this value based on the type of vibration hardware they employ. --> <bool name="use_simple_vibration_pattern">false</bool> </resources> src/com/android/server/telecom/Ringer.java +21 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,18 @@ public class Ringer { 255, // Peak 0}; // pause before repetition private static final long[] SIMPLE_VIBRATION_PATTERN = { 0, // No delay before starting 1000, // How long to vibrate 1000, // How long to wait before vibrating again }; private static final int[] SIMPLE_VIBRATION_AMPLITUDE = { 0, // No delay before starting 255, // Vibrate full amplitude 0, // No amplitude while waiting }; /** * Indicates that vibration should be repeated at element 5 in the {@link #PULSE_AMPLITUDE} and * {@link #PULSE_PATTERN} arrays. This means repetition will happen for the main ease-in/peak Loading @@ -56,6 +68,8 @@ public class Ringer { */ private static final int REPEAT_VIBRATION_AT = 5; private static final int REPEAT_SIMPLE_VIBRATION_AT = 1; private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE) Loading Loading @@ -110,9 +124,14 @@ public class Ringer { mRingtoneFactory = ringtoneFactory; mInCallController = inCallController; if (mContext.getResources().getBoolean(R.bool.use_simple_vibration_pattern)) { mVibrationEffect = VibrationEffect.createWaveform(SIMPLE_VIBRATION_PATTERN, SIMPLE_VIBRATION_AMPLITUDE, REPEAT_SIMPLE_VIBRATION_AT); } else { mVibrationEffect = VibrationEffect.createWaveform(PULSE_PATTERN, PULSE_AMPLITUDE, REPEAT_VIBRATION_AT); } } public boolean startRinging(Call foregroundCall, boolean isHfpDeviceAttached) { if (foregroundCall == null) { Loading Loading
res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -50,4 +50,9 @@ <!-- Determines if the granting of temporary location permission to the default dialer during an emergency call should be allowed. --> <bool name="grant_location_permission_enabled">false</bool> <!-- When true, a simple full intensity on/off vibration pattern will be used when calls ring. When false, a fancy vibration pattern which ramps up and down will be used. Devices should overlay this value based on the type of vibration hardware they employ. --> <bool name="use_simple_vibration_pattern">false</bool> </resources>
src/com/android/server/telecom/Ringer.java +21 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,18 @@ public class Ringer { 255, // Peak 0}; // pause before repetition private static final long[] SIMPLE_VIBRATION_PATTERN = { 0, // No delay before starting 1000, // How long to vibrate 1000, // How long to wait before vibrating again }; private static final int[] SIMPLE_VIBRATION_AMPLITUDE = { 0, // No delay before starting 255, // Vibrate full amplitude 0, // No amplitude while waiting }; /** * Indicates that vibration should be repeated at element 5 in the {@link #PULSE_AMPLITUDE} and * {@link #PULSE_PATTERN} arrays. This means repetition will happen for the main ease-in/peak Loading @@ -56,6 +68,8 @@ public class Ringer { */ private static final int REPEAT_VIBRATION_AT = 5; private static final int REPEAT_SIMPLE_VIBRATION_AT = 1; private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE) Loading Loading @@ -110,9 +124,14 @@ public class Ringer { mRingtoneFactory = ringtoneFactory; mInCallController = inCallController; if (mContext.getResources().getBoolean(R.bool.use_simple_vibration_pattern)) { mVibrationEffect = VibrationEffect.createWaveform(SIMPLE_VIBRATION_PATTERN, SIMPLE_VIBRATION_AMPLITUDE, REPEAT_SIMPLE_VIBRATION_AT); } else { mVibrationEffect = VibrationEffect.createWaveform(PULSE_PATTERN, PULSE_AMPLITUDE, REPEAT_VIBRATION_AT); } } public boolean startRinging(Call foregroundCall, boolean isHfpDeviceAttached) { if (foregroundCall == null) { Loading