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;
public
DocIdEntry ()
{
- time = System.uptimeMillis ();
+ time = SystemClock.uptimeMillis ();
}
/* Return a cache entry comprised of the state of the file
toplevel.idCache.put (documentId, entry);
return entry;
}
+ catch (OperationCanceledException e)
+ {
+ throw e;
+ }
catch (Throwable e)
{
return null;
public boolean
isValid ()
{
- return ((System.uptimeMillis () - time)
- < CACHE_INVALID_TIME);
+ return ((SystemClock.uptimeMillis () - time)
+ < CACHE_INVALID_TIME * 1000);
}
};
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);
}
};
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))