Update Android port
* doc/emacs/android.texi (Android Windowing): Document `android-keyboard-bell-duration'. * java/org/gnu/emacs/EmacsService.java (ringBell): New argument DURATION. * src/android.c (android_init_emacs_service): Adjust correspondingly. (android_bell): Provide the duration of the vibration. * src/androidfns.c (syms_of_androidfns) <android_keyboard_bell_duration>: New variable.
This commit is contained in:
@@ -448,12 +448,13 @@ public final class EmacsService extends Service
|
||||
|
||||
@SuppressWarnings ("deprecation")
|
||||
public void
|
||||
ringBell ()
|
||||
ringBell (int duration)
|
||||
{
|
||||
Vibrator vibrator;
|
||||
VibrationEffect effect;
|
||||
VibratorManager vibratorManager;
|
||||
Object tem;
|
||||
int amplitude;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||
{
|
||||
@@ -467,13 +468,13 @@ public final class EmacsService extends Service
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
{
|
||||
amplitude = VibrationEffect.DEFAULT_AMPLITUDE;
|
||||
effect
|
||||
= VibrationEffect.createOneShot (50,
|
||||
VibrationEffect.DEFAULT_AMPLITUDE);
|
||||
= VibrationEffect.createOneShot (duration, amplitude);
|
||||
vibrator.vibrate (effect);
|
||||
}
|
||||
else
|
||||
vibrator.vibrate (50);
|
||||
vibrator.vibrate (duration);
|
||||
}
|
||||
|
||||
public short[]
|
||||
|
||||
Reference in New Issue
Block a user