diff options
| author | Po Lu | 2024-04-13 11:28:23 +0800 |
|---|---|---|
| committer | Po Lu | 2024-04-13 11:28:48 +0800 |
| commit | 4fc37710788cdab9ebf4264636999ba999a59547 (patch) | |
| tree | e8cc043d3756f1edcabd48db30d6690b0e4b1a27 /java | |
| parent | e8adb8cf5a51ef172fb07786b71e3140b9358764 (diff) | |
| download | emacs-4fc37710788cdab9ebf4264636999ba999a59547.tar.gz emacs-4fc37710788cdab9ebf4264636999ba999a59547.zip | |
Fix task-switching failures on Android 2.3
* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
Don't specify F_A_MULTIPLE_TASK on Android 4.4 and earlier.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsWindowManager.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/java/org/gnu/emacs/EmacsWindowManager.java b/java/org/gnu/emacs/EmacsWindowManager.java index e41b4e068a7..a193d49d0ec 100644 --- a/java/org/gnu/emacs/EmacsWindowManager.java +++ b/java/org/gnu/emacs/EmacsWindowManager.java | |||
| @@ -176,14 +176,20 @@ public final class EmacsWindowManager | |||
| 176 | intent = new Intent (EmacsService.SERVICE, | 176 | intent = new Intent (EmacsService.SERVICE, |
| 177 | EmacsMultitaskActivity.class); | 177 | EmacsMultitaskActivity.class); |
| 178 | 178 | ||
| 179 | intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK | 179 | /* FLAG_ACTIVITY_MULTIPLE_TASK would appear appropriate, but that |
| 180 | | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); | 180 | is not so: on Android 2.3 and earlier, this flag combined with |
| 181 | FLAG_ACTIVITY_NEW_TASK prompts the task switcher to create a | ||
| 182 | new instance of EmacsMultitaskActivity, rather than return to | ||
| 183 | an existing instance, and is entirely redundant, inasmuch as | ||
| 184 | only one multitasking task can exist at any given moment. */ | ||
| 185 | intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); | ||
| 181 | 186 | ||
| 182 | /* Intent.FLAG_ACTIVITY_NEW_DOCUMENT is lamentably unavailable on | 187 | /* Intent.FLAG_ACTIVITY_NEW_DOCUMENT is lamentably unavailable on |
| 183 | older systems than Lolipop. */ | 188 | older systems than Lolipop. */ |
| 184 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) | 189 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) |
| 185 | { | 190 | { |
| 186 | intent.addFlags (Intent.FLAG_ACTIVITY_NEW_DOCUMENT); | 191 | intent.addFlags (Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
| 192 | | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); | ||
| 187 | 193 | ||
| 188 | /* Bind this window to the activity in advance, i.e., before its | 194 | /* Bind this window to the activity in advance, i.e., before its |
| 189 | creation, so that its ID will be recorded in the RecentTasks | 195 | creation, so that its ID will be recorded in the RecentTasks |