1/*
2 * Copyright (C) 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package android.os.statsd.pdf;
20
21import "frameworks/proto_logging/stats/atoms.proto";
22import "frameworks/proto_logging/stats/atom_field_options.proto";
23import "frameworks/proto_logging/stats/enums/pdf/enums.proto";
24
25option java_package = "com.android.os.pdf";
26option java_multiple_files = true;
27
28extend Atom {
29  optional PdfLoadReported pdf_load_reported = 859 [(module) = "mediaprovider"];
30
31  optional PdfApiUsageReported pdf_api_usage_reported = 860 [(module) = "mediaprovider"];
32
33  optional PdfSearchReported pdf_search_reported = 861 [(module) = "mediaprovider"];
34}
35/**
36 * Logs when client app calls the PDFViewer to load the pdf.
37 * Logged from:
38 *  packages/providers/MediaProvider/pdf.....
39 */
40message PdfLoadReported {
41  // The UID of the app which calls the PDFViewer.
42  // Required.
43  optional int32 uid = 1 [(is_uid) = true];
44
45  // Time taken to parse and successfully load the pdf. Excludes rendering time.
46  // Required.
47  optional int64 duration_millis = 2;
48
49  // The size of the pdf in KB.
50  // Required.
51  optional float file_size_in_kb = 3;
52
53  // The result of the pdf load.
54  // Required.
55  optional android.pdf.PdfLoadResult load_result = 4;
56
57  // Optional.
58  optional android.pdf.PdfLinearizedType type = 5;
59
60  // Required.
61  optional int32 number_of_pages = 6;
62
63  // Unique identifier for a particular loaded document.
64  // Note: This identifier will be different even if the same pdf document is loaded twice.
65  // Required.
66  optional int64 doc_id = 7;
67}
68
69/**
70 * Logs when PdfRenderer APIs are called.
71 * Logged from:
72 *  packages/providers/MediaProvider/pdf.....
73 */
74message PdfApiUsageReported {
75  // The UID of the app which calls the PDFViewer.
76  // Required.
77  optional int32 uid = 1 [(is_uid) = true];
78
79  // Unique identifier for a particular loaded document
80  // Required
81  optional int64 doc_id = 2;
82
83  // The type of the API invoked
84  // Required.
85  optional android.pdf.ApiType api_type = 3;
86
87  // API Response status
88  // Required.
89  optional android.pdf.ApiResponseStatus api_response_status = 4;
90}
91
92/**
93 * Logs when a search API is called.
94 * Logged from:
95 *  packages/providers/MediaProvider/pdf/.....
96 */
97message PdfSearchReported {
98  // The UID of the app which calls the PDFViewer.
99  // Required.
100  optional int32 uid = 1 [(is_uid) = true];
101
102  // Time taken to return list of search results from PDF.
103  // Required.
104  optional int64 duration_millis = 2;
105
106  // The length of the search query string.
107  // Required.
108  optional int32 query_length = 3;
109
110  // The page number at which the query was made.
111  // Required.
112  optional int32 query_page_number = 4;
113
114  // Result of the API call.
115  // Required.
116  optional android.pdf.ApiResponseStatus api_response_status = 5;
117
118  // Unique identifier for a particular loaded document
119  // Required.
120  optional int64 doc_id = 6;
121
122  // Number of pages in the PDF
123  // Optional.
124  optional int32 num_pages = 7;
125
126  // Optional.
127  optional int32 match_count = 8;
128}
129