Skip to content

Commit 3f74300

Browse files
Added(SAFAPI): Add last_modified attribute for termux-saf-stat and termux-saf-ls
Co-authored-by: @BryanJacobs <[email protected]> Co-authored-by: @agnostic-apollo <[email protected]>
1 parent 992ce17 commit 3f74300

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/com/termux/api/apis/SAFAPI.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,14 @@ private static void statDocument(JsonWriter out, Context context, Uri uri) throw
288288
}
289289

290290
out.name("uri");
291-
292291
out.value(uri.toString());
292+
293+
index = c.getColumnIndex(DocumentsContract.Document.COLUMN_LAST_MODIFIED);
294+
if (index >= 0) {
295+
out.name("last_modified");
296+
out.value(c.getLong(index));
297+
}
298+
293299
if (mime != null && !DocumentsContract.Document.MIME_TYPE_DIR.equals(mime)) {
294300
index = c.getColumnIndex(DocumentsContract.Document.COLUMN_SIZE);
295301
if (index >= 0) {

0 commit comments

Comments
 (0)