diff options
Diffstat (limited to 'java/org/gnu')
40 files changed, 153 insertions, 46 deletions
diff --git a/java/org/gnu/emacs/EmacsActivity.java b/java/org/gnu/emacs/EmacsActivity.java index 439a8defa32..d0d6ac49419 100644 --- a/java/org/gnu/emacs/EmacsActivity.java +++ b/java/org/gnu/emacs/EmacsActivity.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -50,6 +50,11 @@ import android.view.WindowInsetsController; | |||
| 50 | 50 | ||
| 51 | import android.widget.FrameLayout; | 51 | import android.widget.FrameLayout; |
| 52 | 52 | ||
| 53 | import android.window.BackEvent; | ||
| 54 | import android.window.OnBackAnimationCallback; | ||
| 55 | import android.window.OnBackInvokedCallback; | ||
| 56 | import android.window.OnBackInvokedDispatcher; | ||
| 57 | |||
| 53 | public class EmacsActivity extends Activity | 58 | public class EmacsActivity extends Activity |
| 54 | implements EmacsWindowManager.WindowConsumer, | 59 | implements EmacsWindowManager.WindowConsumer, |
| 55 | ViewTreeObserver.OnGlobalLayoutListener | 60 | ViewTreeObserver.OnGlobalLayoutListener |
| @@ -252,6 +257,59 @@ public class EmacsActivity extends Activity | |||
| 252 | return window; | 257 | return window; |
| 253 | } | 258 | } |
| 254 | 259 | ||
| 260 | private void | ||
| 261 | interceptBackGesture () | ||
| 262 | { | ||
| 263 | OnBackInvokedDispatcher dispatcher; | ||
| 264 | int priority = OnBackInvokedDispatcher.PRIORITY_DEFAULT; | ||
| 265 | OnBackInvokedCallback callback; | ||
| 266 | |||
| 267 | dispatcher = getOnBackInvokedDispatcher (); | ||
| 268 | callback = new OnBackAnimationCallback () { | ||
| 269 | @Override | ||
| 270 | public void | ||
| 271 | onBackInvoked () | ||
| 272 | { | ||
| 273 | View view = EmacsActivity.this.getCurrentFocus (); | ||
| 274 | EmacsWindow window; | ||
| 275 | |||
| 276 | if (view instanceof EmacsView) | ||
| 277 | { | ||
| 278 | window = ((EmacsView) view).window; | ||
| 279 | window.onBackInvoked (); | ||
| 280 | } | ||
| 281 | } | ||
| 282 | |||
| 283 | /* The three functions are overridden to prevent a misleading | ||
| 284 | back animation from being displayed, as Emacs intercepts all | ||
| 285 | back gestures and will not return to the home screen. */ | ||
| 286 | |||
| 287 | @Override | ||
| 288 | public void | ||
| 289 | onBackCancelled () | ||
| 290 | { | ||
| 291 | |||
| 292 | } | ||
| 293 | |||
| 294 | @Override | ||
| 295 | public void | ||
| 296 | onBackProgressed (BackEvent gestureEvent) | ||
| 297 | { | ||
| 298 | |||
| 299 | } | ||
| 300 | |||
| 301 | @Override | ||
| 302 | public void | ||
| 303 | onBackStarted (BackEvent gestureEvent) | ||
| 304 | { | ||
| 305 | |||
| 306 | } | ||
| 307 | }; | ||
| 308 | dispatcher.registerOnBackInvokedCallback (priority, callback); | ||
| 309 | } | ||
| 310 | |||
| 311 | |||
| 312 | |||
| 255 | @Override | 313 | @Override |
| 256 | public void | 314 | public void |
| 257 | onCreate (Bundle savedInstanceState) | 315 | onCreate (Bundle savedInstanceState) |
| @@ -286,6 +344,11 @@ public class EmacsActivity extends Activity | |||
| 286 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) | 344 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) |
| 287 | layout.setFitsSystemWindows (true); | 345 | layout.setFitsSystemWindows (true); |
| 288 | 346 | ||
| 347 | /* Android 16 replaces KEYCODE_BACK with a callback registered at | ||
| 348 | the window level. */ | ||
| 349 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) | ||
| 350 | interceptBackGesture (); | ||
| 351 | |||
| 289 | /* Maybe start the Emacs service if necessary. */ | 352 | /* Maybe start the Emacs service if necessary. */ |
| 290 | EmacsService.startEmacsService (this); | 353 | EmacsService.startEmacsService (this); |
| 291 | 354 | ||
diff --git a/java/org/gnu/emacs/EmacsApplication.java b/java/org/gnu/emacs/EmacsApplication.java index d5670bc31b4..d5d3b015a90 100644 --- a/java/org/gnu/emacs/EmacsApplication.java +++ b/java/org/gnu/emacs/EmacsApplication.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsClipboard.java b/java/org/gnu/emacs/EmacsClipboard.java index bab0e76ddaa..1fc1d6d94b4 100644 --- a/java/org/gnu/emacs/EmacsClipboard.java +++ b/java/org/gnu/emacs/EmacsClipboard.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsContextMenu.java b/java/org/gnu/emacs/EmacsContextMenu.java index fff77612227..d32f1c9fe06 100644 --- a/java/org/gnu/emacs/EmacsContextMenu.java +++ b/java/org/gnu/emacs/EmacsContextMenu.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsCursor.java b/java/org/gnu/emacs/EmacsCursor.java index 0b9732d2e1a..247e8d9c087 100644 --- a/java/org/gnu/emacs/EmacsCursor.java +++ b/java/org/gnu/emacs/EmacsCursor.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDesktopNotification.java b/java/org/gnu/emacs/EmacsDesktopNotification.java index 390a0f03bd8..d449872f675 100644 --- a/java/org/gnu/emacs/EmacsDesktopNotification.java +++ b/java/org/gnu/emacs/EmacsDesktopNotification.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDialog.java b/java/org/gnu/emacs/EmacsDialog.java index c706a60158a..d380c1c3041 100644 --- a/java/org/gnu/emacs/EmacsDialog.java +++ b/java/org/gnu/emacs/EmacsDialog.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDialogButtonLayout.java b/java/org/gnu/emacs/EmacsDialogButtonLayout.java index a1f3813c28a..d65c41b277b 100644 --- a/java/org/gnu/emacs/EmacsDialogButtonLayout.java +++ b/java/org/gnu/emacs/EmacsDialogButtonLayout.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDirectoryEntry.java b/java/org/gnu/emacs/EmacsDirectoryEntry.java index 86b14e51da0..06397f73cac 100644 --- a/java/org/gnu/emacs/EmacsDirectoryEntry.java +++ b/java/org/gnu/emacs/EmacsDirectoryEntry.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDocumentsProvider.java b/java/org/gnu/emacs/EmacsDocumentsProvider.java index 400432cb742..daf24ece451 100644 --- a/java/org/gnu/emacs/EmacsDocumentsProvider.java +++ b/java/org/gnu/emacs/EmacsDocumentsProvider.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDrawLine.java b/java/org/gnu/emacs/EmacsDrawLine.java index 7a60315c394..39069652061 100644 --- a/java/org/gnu/emacs/EmacsDrawLine.java +++ b/java/org/gnu/emacs/EmacsDrawLine.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDrawPoint.java b/java/org/gnu/emacs/EmacsDrawPoint.java index 9e7a8dcff49..b36fb2e287c 100644 --- a/java/org/gnu/emacs/EmacsDrawPoint.java +++ b/java/org/gnu/emacs/EmacsDrawPoint.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDrawRectangle.java b/java/org/gnu/emacs/EmacsDrawRectangle.java index b1d17313feb..6d3447c2b2d 100644 --- a/java/org/gnu/emacs/EmacsDrawRectangle.java +++ b/java/org/gnu/emacs/EmacsDrawRectangle.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsDrawable.java b/java/org/gnu/emacs/EmacsDrawable.java index 4bfe10060db..8f69a649570 100644 --- a/java/org/gnu/emacs/EmacsDrawable.java +++ b/java/org/gnu/emacs/EmacsDrawable.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsFillPolygon.java b/java/org/gnu/emacs/EmacsFillPolygon.java index 03919e723ef..f960e309eec 100644 --- a/java/org/gnu/emacs/EmacsFillPolygon.java +++ b/java/org/gnu/emacs/EmacsFillPolygon.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsFillRectangle.java b/java/org/gnu/emacs/EmacsFillRectangle.java index 1b98d420031..70e262f3f82 100644 --- a/java/org/gnu/emacs/EmacsFillRectangle.java +++ b/java/org/gnu/emacs/EmacsFillRectangle.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsFontDriver.java b/java/org/gnu/emacs/EmacsFontDriver.java index f451f53e636..1bdf041b0d0 100644 --- a/java/org/gnu/emacs/EmacsFontDriver.java +++ b/java/org/gnu/emacs/EmacsFontDriver.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Font backend for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Font backend for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsGC.java b/java/org/gnu/emacs/EmacsGC.java index dcec659ecc7..dbf00eb7606 100644 --- a/java/org/gnu/emacs/EmacsGC.java +++ b/java/org/gnu/emacs/EmacsGC.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsHandleObject.java b/java/org/gnu/emacs/EmacsHandleObject.java index 74837753424..b60f4b32f21 100644 --- a/java/org/gnu/emacs/EmacsHandleObject.java +++ b/java/org/gnu/emacs/EmacsHandleObject.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsHolder.java b/java/org/gnu/emacs/EmacsHolder.java index fe420afbc01..02a93d8e002 100644 --- a/java/org/gnu/emacs/EmacsHolder.java +++ b/java/org/gnu/emacs/EmacsHolder.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsInputConnection.java b/java/org/gnu/emacs/EmacsInputConnection.java index b872212d9eb..09433a28c0e 100644 --- a/java/org/gnu/emacs/EmacsInputConnection.java +++ b/java/org/gnu/emacs/EmacsInputConnection.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsLauncherPreferencesActivity.java b/java/org/gnu/emacs/EmacsLauncherPreferencesActivity.java index 36be0d15c86..25a9d68e055 100644 --- a/java/org/gnu/emacs/EmacsLauncherPreferencesActivity.java +++ b/java/org/gnu/emacs/EmacsLauncherPreferencesActivity.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsMultitaskActivity.java b/java/org/gnu/emacs/EmacsMultitaskActivity.java index 0ee1c8cf665..0a7677b84ef 100644 --- a/java/org/gnu/emacs/EmacsMultitaskActivity.java +++ b/java/org/gnu/emacs/EmacsMultitaskActivity.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsNative.java b/java/org/gnu/emacs/EmacsNative.java index 49a21ce1c4d..2c2537da27d 100644 --- a/java/org/gnu/emacs/EmacsNative.java +++ b/java/org/gnu/emacs/EmacsNative.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -61,6 +61,9 @@ public final class EmacsNative | |||
| 61 | scaledDensity is the DPI value used to translate point sizes to | 61 | scaledDensity is the DPI value used to translate point sizes to |
| 62 | pixel sizes when loading fonts. | 62 | pixel sizes when loading fonts. |
| 63 | 63 | ||
| 64 | uiMode holds the bits of the system's UI mode specification | ||
| 65 | defining the active system theme. | ||
| 66 | |||
| 64 | classPath must be the classpath of this app_process process, or | 67 | classPath must be the classpath of this app_process process, or |
| 65 | NULL. | 68 | NULL. |
| 66 | 69 | ||
| @@ -74,6 +77,7 @@ public final class EmacsNative | |||
| 74 | float pixelDensityX, | 77 | float pixelDensityX, |
| 75 | float pixelDensityY, | 78 | float pixelDensityY, |
| 76 | float scaledDensity, | 79 | float scaledDensity, |
| 80 | int uiMode, | ||
| 77 | String classPath, | 81 | String classPath, |
| 78 | EmacsService emacsService, | 82 | EmacsService emacsService, |
| 79 | int apiLevel); | 83 | int apiLevel); |
| @@ -197,8 +201,9 @@ public final class EmacsNative | |||
| 197 | public static native void sendNotificationAction (String tag, String action); | 201 | public static native void sendNotificationAction (String tag, String action); |
| 198 | 202 | ||
| 199 | /* Send an ANDROID_CONFIGURATION_CHANGED event. */ | 203 | /* Send an ANDROID_CONFIGURATION_CHANGED event. */ |
| 200 | public static native void sendConfigurationChanged (float dpiX, float dpiY, | 204 | public static native void sendConfigurationChanged (int detail, float dpiX, |
| 201 | float dpiScaled); | 205 | float dpiY, float dpiScaled, |
| 206 | int ui_mode); | ||
| 202 | 207 | ||
| 203 | /* Return the file name associated with the specified file | 208 | /* Return the file name associated with the specified file |
| 204 | descriptor, or NULL if there is none. */ | 209 | descriptor, or NULL if there is none. */ |
diff --git a/java/org/gnu/emacs/EmacsNoninteractive.java b/java/org/gnu/emacs/EmacsNoninteractive.java index 83ef04b1cf1..4ffe33e6dbb 100644 --- a/java/org/gnu/emacs/EmacsNoninteractive.java +++ b/java/org/gnu/emacs/EmacsNoninteractive.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -67,7 +67,7 @@ public final class EmacsNoninteractive | |||
| 67 | cacheDir = context.getCacheDir ().getCanonicalPath (); | 67 | cacheDir = context.getCacheDir ().getCanonicalPath (); |
| 68 | EmacsNative.setEmacsParams (assets, filesDir, | 68 | EmacsNative.setEmacsParams (assets, filesDir, |
| 69 | libDir, cacheDir, 0.0f, | 69 | libDir, cacheDir, 0.0f, |
| 70 | 0.0f, 0.0f, null, null, | 70 | 0.0f, 0.0f, 0x0, null, null, |
| 71 | Build.VERSION.SDK_INT); | 71 | Build.VERSION.SDK_INT); |
| 72 | 72 | ||
| 73 | /* Now find the dump file that Emacs should use, if it has already | 73 | /* Now find the dump file that Emacs should use, if it has already |
diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java index 908465ad69d..d72fc50ea68 100644 --- a/java/org/gnu/emacs/EmacsOpenActivity.java +++ b/java/org/gnu/emacs/EmacsOpenActivity.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsPixmap.java b/java/org/gnu/emacs/EmacsPixmap.java index c4eb85d765d..12f2f426d6a 100644 --- a/java/org/gnu/emacs/EmacsPixmap.java +++ b/java/org/gnu/emacs/EmacsPixmap.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsPreferencesActivity.java b/java/org/gnu/emacs/EmacsPreferencesActivity.java index 18bff1ed508..bbae458091b 100644 --- a/java/org/gnu/emacs/EmacsPreferencesActivity.java +++ b/java/org/gnu/emacs/EmacsPreferencesActivity.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsSafThread.java b/java/org/gnu/emacs/EmacsSafThread.java index 3857397fe77..a02cbd50bdf 100644 --- a/java/org/gnu/emacs/EmacsSafThread.java +++ b/java/org/gnu/emacs/EmacsSafThread.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsSdk11Clipboard.java b/java/org/gnu/emacs/EmacsSdk11Clipboard.java index 48715646e77..75697c116ba 100644 --- a/java/org/gnu/emacs/EmacsSdk11Clipboard.java +++ b/java/org/gnu/emacs/EmacsSdk11Clipboard.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsSdk23FontDriver.java b/java/org/gnu/emacs/EmacsSdk23FontDriver.java index d1c6c7faad3..fa884db5461 100644 --- a/java/org/gnu/emacs/EmacsSdk23FontDriver.java +++ b/java/org/gnu/emacs/EmacsSdk23FontDriver.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Font backend for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Font backend for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsSdk7FontDriver.java b/java/org/gnu/emacs/EmacsSdk7FontDriver.java index b426c3ba74e..c4ef68382a3 100644 --- a/java/org/gnu/emacs/EmacsSdk7FontDriver.java +++ b/java/org/gnu/emacs/EmacsSdk7FontDriver.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Font backend for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Font backend for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsSdk8Clipboard.java b/java/org/gnu/emacs/EmacsSdk8Clipboard.java index ddb2171ceb1..f5dee4c9986 100644 --- a/java/org/gnu/emacs/EmacsSdk8Clipboard.java +++ b/java/org/gnu/emacs/EmacsSdk8Clipboard.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 3630329839f..9e85b195e67 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -150,6 +150,10 @@ public final class EmacsService extends Service | |||
| 150 | consulted for font scaling. */ | 150 | consulted for font scaling. */ |
| 151 | private double dpiX, dpiY, dpiScaled; | 151 | private double dpiX, dpiY, dpiScaled; |
| 152 | 152 | ||
| 153 | /* The display's previously observed UI mode as it relates to the | ||
| 154 | system theme. */ | ||
| 155 | private int uiMode; | ||
| 156 | |||
| 153 | static | 157 | static |
| 154 | { | 158 | { |
| 155 | servicingQuery = new AtomicInteger (); | 159 | servicingQuery = new AtomicInteger (); |
| @@ -240,6 +244,7 @@ public final class EmacsService extends Service | |||
| 240 | float tempScaledDensity; | 244 | float tempScaledDensity; |
| 241 | Resources resources; | 245 | Resources resources; |
| 242 | DisplayMetrics metrics; | 246 | DisplayMetrics metrics; |
| 247 | Configuration configuration; | ||
| 243 | 248 | ||
| 244 | super.onCreate (); | 249 | super.onCreate (); |
| 245 | 250 | ||
| @@ -254,6 +259,8 @@ public final class EmacsService extends Service | |||
| 254 | tempScaledDensity = ((getScaledDensity (metrics) | 259 | tempScaledDensity = ((getScaledDensity (metrics) |
| 255 | / metrics.density) | 260 | / metrics.density) |
| 256 | * pixelDensityX); | 261 | * pixelDensityX); |
| 262 | configuration = resources.getConfiguration (); | ||
| 263 | uiMode = configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK; | ||
| 257 | resolver = getContentResolver (); | 264 | resolver = getContentResolver (); |
| 258 | mainThread = Thread.currentThread (); | 265 | mainThread = Thread.currentThread (); |
| 259 | 266 | ||
| @@ -311,7 +318,8 @@ public final class EmacsService extends Service | |||
| 311 | EmacsNative.setEmacsParams (manager, filesDir, libDir, | 318 | EmacsNative.setEmacsParams (manager, filesDir, libDir, |
| 312 | cacheDir, pixelDensityX, | 319 | cacheDir, pixelDensityX, |
| 313 | pixelDensityY, scaledDensity, | 320 | pixelDensityY, scaledDensity, |
| 314 | classPath, EmacsService.this, | 321 | uiMode, classPath, |
| 322 | EmacsService.this, | ||
| 315 | Build.VERSION.SDK_INT); | 323 | Build.VERSION.SDK_INT); |
| 316 | } | 324 | } |
| 317 | }, extraStartupArguments); | 325 | }, extraStartupArguments); |
| @@ -375,8 +383,14 @@ public final class EmacsService extends Service | |||
| 375 | dpiX = pixelDensityX; | 383 | dpiX = pixelDensityX; |
| 376 | dpiY = pixelDensityY; | 384 | dpiY = pixelDensityY; |
| 377 | dpiScaled = scaledDensity; | 385 | dpiScaled = scaledDensity; |
| 378 | EmacsNative.sendConfigurationChanged (pixelDensityX, pixelDensityY, | 386 | EmacsNative.sendConfigurationChanged (0, pixelDensityX, pixelDensityY, |
| 379 | scaledDensity); | 387 | scaledDensity, 0); |
| 388 | } | ||
| 389 | |||
| 390 | if ((newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) != uiMode) | ||
| 391 | { | ||
| 392 | uiMode = newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK; | ||
| 393 | EmacsNative.sendConfigurationChanged (1, 0.0f, 0.0f, 0.0f, uiMode); | ||
| 380 | } | 394 | } |
| 381 | 395 | ||
| 382 | super.onConfigurationChanged (newConfig); | 396 | super.onConfigurationChanged (newConfig); |
diff --git a/java/org/gnu/emacs/EmacsSurfaceView.java b/java/org/gnu/emacs/EmacsSurfaceView.java index 8e76113143b..4c6f1811a85 100644 --- a/java/org/gnu/emacs/EmacsSurfaceView.java +++ b/java/org/gnu/emacs/EmacsSurfaceView.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsThread.java b/java/org/gnu/emacs/EmacsThread.java index 312b657d336..3dc534a5ec2 100644 --- a/java/org/gnu/emacs/EmacsThread.java +++ b/java/org/gnu/emacs/EmacsThread.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsTileObject.java b/java/org/gnu/emacs/EmacsTileObject.java index 506e940657c..c080988e3d5 100644 --- a/java/org/gnu/emacs/EmacsTileObject.java +++ b/java/org/gnu/emacs/EmacsTileObject.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2024-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2024-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 8f16dbad257..f2ec99d720f 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 394b2c26414..4edae96ca0d 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -58,6 +58,7 @@ import android.util.SparseArray; | |||
| 58 | import android.util.Log; | 58 | import android.util.Log; |
| 59 | 59 | ||
| 60 | import android.os.Build; | 60 | import android.os.Build; |
| 61 | import android.os.SystemClock; | ||
| 61 | 62 | ||
| 62 | /* This defines a window, which is a handle. Windows represent a | 63 | /* This defines a window, which is a handle. Windows represent a |
| 63 | rectangular subset of the screen with their own contents. | 64 | rectangular subset of the screen with their own contents. |
| @@ -425,6 +426,16 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 425 | requestViewLayout (); | 426 | requestViewLayout (); |
| 426 | } | 427 | } |
| 427 | 428 | ||
| 429 | public synchronized void | ||
| 430 | moveResizeWindow (int x, int y, int width, int height) | ||
| 431 | { | ||
| 432 | rect.left = x; | ||
| 433 | rect.top = y; | ||
| 434 | rect.right = x + width; | ||
| 435 | rect.bottom = y + height; | ||
| 436 | requestViewLayout (); | ||
| 437 | } | ||
| 438 | |||
| 428 | /* Return WM layout parameters for an override redirect window with | 439 | /* Return WM layout parameters for an override redirect window with |
| 429 | the geometry provided here. */ | 440 | the geometry provided here. */ |
| 430 | 441 | ||
| @@ -890,6 +901,20 @@ public final class EmacsWindow extends EmacsHandleObject | |||
| 890 | EmacsNative.sendWindowAction (this.handle, 0); | 901 | EmacsNative.sendWindowAction (this.handle, 0); |
| 891 | } | 902 | } |
| 892 | 903 | ||
| 904 | /* Dispatch a back gesture invocation as a KeyPress event. Lamentably | ||
| 905 | the platform does not appear to support reporting keyboard | ||
| 906 | modifiers with these events. */ | ||
| 907 | |||
| 908 | public void | ||
| 909 | onBackInvoked () | ||
| 910 | { | ||
| 911 | long time = SystemClock.uptimeMillis (); | ||
| 912 | EmacsNative.sendKeyPress (this.handle, time, 0, | ||
| 913 | KeyEvent.KEYCODE_BACK, 0); | ||
| 914 | EmacsNative.sendKeyRelease (this.handle, time, 0, | ||
| 915 | KeyEvent.KEYCODE_BACK, 0); | ||
| 916 | } | ||
| 917 | |||
| 893 | 918 | ||
| 894 | 919 | ||
| 895 | /* Mouse and touch event handling. | 920 | /* Mouse and touch event handling. |
diff --git a/java/org/gnu/emacs/EmacsWindowManager.java b/java/org/gnu/emacs/EmacsWindowManager.java index 6b32c8f8614..91a2eecef19 100644 --- a/java/org/gnu/emacs/EmacsWindowManager.java +++ b/java/org/gnu/emacs/EmacsWindowManager.java | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- | 1 | /* Communication module for Android terminals. -*- c-file-style: "GNU" -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 2023-2025 Free Software Foundation, Inc. | 3 | Copyright (C) 2023-2026 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||