aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-07-29 11:29:25 +0800
committerPo Lu2023-07-29 11:29:25 +0800
commitd3e1e188739e54079618405bcc5eb7c6914fecdf (patch)
treed22b6f0d659abd04cfdd81537c5c5a739372012a /java
parent47f97b5ae49af49ef3adcad4d4d9cab3668002ff (diff)
downloademacs-d3e1e188739e54079618405bcc5eb7c6914fecdf.tar.gz
emacs-d3e1e188739e54079618405bcc5eb7c6914fecdf.zip
Update Android port
* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry) (getCacheEntry, CacheEntry): Use `uptimeMillis' as the basis for cache expiration.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsSafThread.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/java/org/gnu/emacs/EmacsSafThread.java b/java/org/gnu/emacs/EmacsSafThread.java
index b3d6ab49f6d..9c3e3deb408 100644
--- a/java/org/gnu/emacs/EmacsSafThread.java
+++ b/java/org/gnu/emacs/EmacsSafThread.java
@@ -151,7 +151,7 @@ public final class EmacsSafThread extends HandlerThread
151 public 151 public
152 DocIdEntry () 152 DocIdEntry ()
153 { 153 {
154 time = System.currentTimeMillis (); 154 time = System.uptimeMillis ();
155 } 155 }
156 156
157 /* Return a cache entry comprised of the state of the file 157 /* Return a cache entry comprised of the state of the file
@@ -208,10 +208,7 @@ public final class EmacsSafThread extends HandlerThread
208 } 208 }
209 catch (Throwable e) 209 catch (Throwable e)
210 { 210 {
211 if (e instanceof FileNotFoundException) 211 return null;
212 return null;
213
214 throw e;
215 } 212 }
216 finally 213 finally
217 { 214 {
@@ -223,7 +220,7 @@ public final class EmacsSafThread extends HandlerThread
223 public boolean 220 public boolean
224 isValid () 221 isValid ()
225 { 222 {
226 return ((System.currentTimeMillis () - time) 223 return ((System.uptimeMillis () - time)
227 < CACHE_INVALID_TIME); 224 < CACHE_INVALID_TIME);
228 } 225 }
229 }; 226 };
@@ -243,13 +240,13 @@ public final class EmacsSafThread extends HandlerThread
243 CacheEntry () 240 CacheEntry ()
244 { 241 {
245 children = new HashMap<String, DocIdEntry> (); 242 children = new HashMap<String, DocIdEntry> ();
246 time = System.currentTimeMillis (); 243 time = System.uptimeMillis ();
247 } 244 }
248 245
249 public boolean 246 public boolean
250 isValid () 247 isValid ()
251 { 248 {
252 return ((System.currentTimeMillis () - time) 249 return ((System.uptimeMillis () - time)
253 < CACHE_INVALID_TIME); 250 < CACHE_INVALID_TIME);
254 } 251 }
255 }; 252 };