OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Next MinVersion: 2 | 5 // Next MinVersion: 3 |
6 | 6 |
7 module arc.mojom; | 7 module arc.mojom; |
8 | 8 |
9 // Next method ID: 3 | 9 // Represents a document in Android DocumentsProvider. |
| 10 // See Android docs of DocumentsContract.Document for details. |
| 11 struct Document { |
| 12 // Opaque ID of the document. |
| 13 string document_id; |
| 14 |
| 15 // Display name of the document. |
| 16 string display_name; |
| 17 |
| 18 // MIME type of the document. |
| 19 // A directory is represented by a document having MIME_TYPE_DIR MIME type. |
| 20 string mime_type; |
| 21 |
| 22 // Size of the document in bytes. If the size is unknown, -1 is set. |
| 23 int64 size; |
| 24 |
| 25 // Timestamp when the document was modified last time, in milliseconds |
| 26 // since UNIX epoch. |
| 27 // TODO(crbug.com/672737): Use mojo.common.mojom.Time once the type is |
| 28 // converted to a non-native type so that it can be used from Java. |
| 29 uint64 last_modified; |
| 30 }; |
| 31 |
| 32 // Next method ID: 5 |
10 interface FileSystemInstance { | 33 interface FileSystemInstance { |
| 34 // Notes about Android Documents Provider: |
| 35 // |
| 36 // In Android Storage Access Framework, a document is uniquely identified by |
| 37 // a pair of "authority" and "document ID". |
| 38 // |
| 39 // - An authority specifies a Documents Provider that serves a document. |
| 40 // It is the origin part of a content:// URI used to access the Documents |
| 41 // Provider via Content Resolver protocol. |
| 42 // Example: "com.android.providers.media.documents" |
| 43 // - A document ID is an opaque string that specifies a particular document |
| 44 // in a documents provider. Its format varies by providers. |
| 45 // |
| 46 // See the following documents for details about Documents Provider: |
| 47 // https://developer.android.com/guide/topics/providers/document-provider.html |
| 48 // https://developer.android.com/reference/android/provider/DocumentsContract.
html |
| 49 |
| 50 // Queries child documents of the directory specified by |authority| and |
| 51 // |parent_document_id| in Documents Provider. |
| 52 // If such a directory does not exist, null is returned. |
| 53 [MinVersion=2] GetChildDocuments@4(string authority, |
| 54 string parent_document_id) => |
| 55 (array<Document>? documents); |
| 56 |
| 57 // Queries the document specified by |authority| and |document_id| in |
| 58 // Documents Provider. |
| 59 // If such a document does not exist, null is returned. |
| 60 [MinVersion=2] GetDocument@3(string authority, string document_id) => |
| 61 (Document? document); |
| 62 |
11 // Asks the ContentResolver for the size of the file specified by the URL. | 63 // Asks the ContentResolver for the size of the file specified by the URL. |
12 // If the file does not exist or the size is unknown, -1 is returned. | 64 // If the file does not exist or the size is unknown (e.g. directories and |
| 65 // streams), -1 is returned. |
13 [MinVersion=1] GetFileSize@1(string url) => (int64 size); | 66 [MinVersion=1] GetFileSize@1(string url) => (int64 size); |
14 | 67 |
15 // Asks the ContentResolver to get a FD to read the file specified by the | 68 // Asks the ContentResolver to get a FD to read the file specified by the |
16 // URL. | 69 // URL. |
17 [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd); | 70 [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd); |
18 | 71 |
19 // Requests MediaProvider to scan specified files. | 72 // Requests MediaProvider to scan specified files. |
20 // When the specified file does not exist, the corresponding entry in | 73 // When the specified file does not exist, the corresponding entry in |
21 // MediaProvider is removed. | 74 // MediaProvider is removed. |
22 RequestMediaScan@0(array<string> paths); | 75 RequestMediaScan@0(array<string> paths); |
23 }; | 76 }; |
OLD | NEW |