Settings: Follow new ringtone vibration patterns

For preview

See: 7b3ab13002
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Ido Ben-Hur
2021-08-08 16:00:37 +03:00
committed by Joey
parent 1ee5267d6d
commit 3ee81b2fcb

View File

@@ -65,15 +65,17 @@ public class VibrationPatternPreferenceController extends AbstractPreferenceCont
private static final long[] SIMPLE_VIBRATION_PATTERN = { private static final long[] SIMPLE_VIBRATION_PATTERN = {
0, // No delay before starting 0, // No delay before starting
800, // How long to vibrate 1000, // How long to vibrate
800, // How long to wait before vibrating again 1000, // How long to wait before vibrating again
1000, // How long to vibrate
1000, // How long to wait before vibrating again
}; };
private static final long[] DZZZ_DA_VIBRATION_PATTERN = { private static final long[] DZZZ_DA_VIBRATION_PATTERN = {
0, // No delay before starting 0, // No delay before starting
500, // How long to vibrate 500, // How long to vibrate
200, // Delay 200, // Delay
20, // How long to vibrate 70, // How long to vibrate
720, // How long to wait before vibrating again 720, // How long to wait before vibrating again
}; };
@@ -89,11 +91,9 @@ public class VibrationPatternPreferenceController extends AbstractPreferenceCont
private static final long[] DA_DA_DZZZ_VIBRATION_PATTERN = { private static final long[] DA_DA_DZZZ_VIBRATION_PATTERN = {
0, // No delay before starting 0, // No delay before starting
30, // How long to vibrate 70, // How long to vibrate
80, // Delay 80, // Delay
30, // How long to vibrate 70, // How long to vibrate
80, // Delay
50, // How long to vibrate
180, // Delay 180, // Delay
600, // How long to vibrate 600, // How long to vibrate
1050, // How long to wait before vibrating again 1050, // How long to wait before vibrating again
@@ -109,18 +109,6 @@ public class VibrationPatternPreferenceController extends AbstractPreferenceCont
1050, // How long to wait before vibrating again 1050, // How long to wait before vibrating again
}; };
private static final int[] NINE_ELEMENTS_VIBRATION_AMPLITUDE = {
0, // No delay before starting
255, // Vibrate full amplitude
0, // No amplitude while waiting
255,
0,
255,
0,
255,
0,
};
private static final int[] SEVEN_ELEMENTS_VIBRATION_AMPLITUDE = { private static final int[] SEVEN_ELEMENTS_VIBRATION_AMPLITUDE = {
0, // No delay before starting 0, // No delay before starting
255, // Vibrate full amplitude 255, // Vibrate full amplitude
@@ -139,12 +127,6 @@ public class VibrationPatternPreferenceController extends AbstractPreferenceCont
0, 0,
}; };
private static final int[] SIMPLE_VIBRATION_AMPLITUDE = {
0, // No delay before starting
255, // Vibrate full amplitude
0, // No amplitude while waiting
};
public VibrationPatternPreferenceController(Context context) { public VibrationPatternPreferenceController(Context context) {
super(context); super(context);
} }
@@ -255,7 +237,7 @@ public class VibrationPatternPreferenceController extends AbstractPreferenceCont
break; break;
case 3: case 3:
effect = vibrationEffectProxy.createWaveform(DA_DA_DZZZ_VIBRATION_PATTERN, effect = vibrationEffectProxy.createWaveform(DA_DA_DZZZ_VIBRATION_PATTERN,
NINE_ELEMENTS_VIBRATION_AMPLITUDE, -1); SEVEN_ELEMENTS_VIBRATION_AMPLITUDE, -1);
break; break;
case 4: case 4:
effect = vibrationEffectProxy.createWaveform(DA_DZZZ_DA_VIBRATION_PATTERN, effect = vibrationEffectProxy.createWaveform(DA_DZZZ_DA_VIBRATION_PATTERN,
@@ -279,7 +261,7 @@ public class VibrationPatternPreferenceController extends AbstractPreferenceCont
break; break;
default: default:
effect = vibrationEffectProxy.createWaveform(SIMPLE_VIBRATION_PATTERN, effect = vibrationEffectProxy.createWaveform(SIMPLE_VIBRATION_PATTERN,
SIMPLE_VIBRATION_AMPLITUDE, -1); FIVE_ELEMENTS_VIBRATION_AMPLITUDE, -1);
break; break;
} }
vibrator.vibrate(effect, VIBRATION_ATTRIBUTES); vibrator.vibrate(effect, VIBRATION_ATTRIBUTES);