Update Android port
* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry): (getCacheEntry): (CacheEntry): (documentIdFromName1): Fix earlier change.
This commit is contained in:
parent
183c65e0c4
commit
27fe17f0fc
1 changed files with 18 additions and 7 deletions
|
@ -33,7 +33,9 @@
|
|||
import android.os.CancellationSignal;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.OperationCanceledException;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
|
@ -151,7 +153,7 @@ private final class DocIdEntry
|
|||
public
|
||||
DocIdEntry ()
|
||||
{
|
||||
time = System.uptimeMillis ();
|
||||
time = SystemClock.uptimeMillis ();
|
||||
}
|
||||
|
||||
/* Return a cache entry comprised of the state of the file
|
||||
|
@ -206,6 +208,10 @@ private final class DocIdEntry
|
|||
toplevel.idCache.put (documentId, entry);
|
||||
return entry;
|
||||
}
|
||||
catch (OperationCanceledException e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
return null;
|
||||
|
@ -220,8 +226,8 @@ private final class DocIdEntry
|
|||
public boolean
|
||||
isValid ()
|
||||
{
|
||||
return ((System.uptimeMillis () - time)
|
||||
< CACHE_INVALID_TIME);
|
||||
return ((SystemClock.uptimeMillis () - time)
|
||||
< CACHE_INVALID_TIME * 1000);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -240,14 +246,14 @@ private final class CacheEntry
|
|||
CacheEntry ()
|
||||
{
|
||||
children = new HashMap<String, DocIdEntry> ();
|
||||
time = System.uptimeMillis ();
|
||||
time = SystemClock.uptimeMillis ();
|
||||
}
|
||||
|
||||
public boolean
|
||||
isValid ()
|
||||
{
|
||||
return ((System.uptimeMillis () - time)
|
||||
< CACHE_INVALID_TIME);
|
||||
return ((SystemClock.uptimeMillis () - time)
|
||||
< CACHE_INVALID_TIME * 1000);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -740,7 +746,12 @@ public abstract Object runObject (CancellationSignal signal)
|
|||
obtained. Treat this as if the file does not
|
||||
exist. */
|
||||
|
||||
children.remove (idEntry);
|
||||
children.remove (component);
|
||||
|
||||
if (id == null)
|
||||
id = DocumentsContract.getTreeDocumentId (uri);
|
||||
|
||||
id_return[0] = id;
|
||||
|
||||
if ((type == null
|
||||
|| type.equals (Document.MIME_TYPE_DIR))
|
||||
|
|
Loading…
Add table
Reference in a new issue