diff options
| author | Po Lu <luangruo@yahoo.com> | 2024-04-14 10:36:50 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2024-04-14 10:36:50 +0800 |
| commit | 2823eae0b7cb3bd3f2472fde9e13016a8d406a9a (patch) | |
| tree | 5dfc53e8389ee6cbb8ac96e0a4259d8af5e9ed33 /java/org/gnu/emacs/EmacsService.java | |
| parent | 845246093f8ae88db1061a9beaff04184685f8f4 (diff) | |
Remove leftover tasks from previous Emacs sessions on startup
* java/org/gnu/emacs/EmacsService.java (onCreate): Call
removeOldTasks.
* java/org/gnu/emacs/EmacsWindowManager.java (removeOldTasks):
New function.
* java/proguard.conf: Optimize optimizer configuration.
Diffstat (limited to 'java/org/gnu/emacs/EmacsService.java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index b8ff98e79a7..fd052653087 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -234,6 +234,8 @@ public final class EmacsService extends Service final double scaledDensity; double tempScaledDensity; + super.onCreate (); + SERVICE = this; handler = new Handler (Looper.getMainLooper ()); manager = getAssets (); @@ -247,9 +249,9 @@ public final class EmacsService extends Service resolver = getContentResolver (); mainThread = Thread.currentThread (); - /* If the density used to compute the text size is lesser than - 160, there's likely a bug with display density computation. - Reset it to 160 in that case. + /* If the density used to compute the text size is smaller than 160, + there's likely a bug with display density computation. Reset it + to 160 in that case. Note that Android uses 160 ``dpi'' as the density where 1 point corresponds to 1 pixel, not 72 or 96 as used elsewhere. This @@ -262,6 +264,10 @@ public final class EmacsService extends Service the nested function below. */ scaledDensity = tempScaledDensity; + /* Remove all tasks from previous Emacs sessions but the task + created by the system at startup. */ + EmacsWindowManager.MANAGER.removeOldTasks (this); + try { /* Configure Emacs with the asset manager and other necessary |
