aboutsummaryrefslogtreecommitdiffstats
path: root/java/org/gnu
diff options
context:
space:
mode:
authorPo Lu2023-09-28 08:46:35 +0800
committerPo Lu2023-09-28 08:46:35 +0800
commit7b43d70c7379e89318e6333739f991f158b447f6 (patch)
treef32173bc34a1e50a741a52db87d641c2fed46284 /java/org/gnu
parentdc2199de3e663cf3cdcf3cd523d273e230aa3ac0 (diff)
downloademacs-7b43d70c7379e89318e6333739f991f158b447f6.tar.gz
emacs-7b43d70c7379e89318e6333739f991f158b447f6.zip
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.
Diffstat (limited to 'java/org/gnu')
-rw-r--r--java/org/gnu/emacs/EmacsService.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java
index 05952f98cf1..997c6923fcc 100644
--- a/java/org/gnu/emacs/EmacsService.java
+++ b/java/org/gnu/emacs/EmacsService.java
@@ -448,12 +448,13 @@ public final class EmacsService extends Service
448 448
449 @SuppressWarnings ("deprecation") 449 @SuppressWarnings ("deprecation")
450 public void 450 public void
451 ringBell () 451 ringBell (int duration)
452 { 452 {
453 Vibrator vibrator; 453 Vibrator vibrator;
454 VibrationEffect effect; 454 VibrationEffect effect;
455 VibratorManager vibratorManager; 455 VibratorManager vibratorManager;
456 Object tem; 456 Object tem;
457 int amplitude;
457 458
458 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) 459 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
459 { 460 {
@@ -467,13 +468,13 @@ public final class EmacsService extends Service
467 468
468 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) 469 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
469 { 470 {
471 amplitude = VibrationEffect.DEFAULT_AMPLITUDE;
470 effect 472 effect
471 = VibrationEffect.createOneShot (50, 473 = VibrationEffect.createOneShot (duration, amplitude);
472 VibrationEffect.DEFAULT_AMPLITUDE);
473 vibrator.vibrate (effect); 474 vibrator.vibrate (effect);
474 } 475 }
475 else 476 else
476 vibrator.vibrate (50); 477 vibrator.vibrate (duration);
477 } 478 }
478 479
479 public short[] 480 public short[]