summaryrefslogtreecommitdiff
path: root/proto/log_enums.proto
blob: 2f8d93c261cf4b1019dbab123e157fec2565c6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";

package mobiledatadownload.logs;

option java_package = "com.google.mobiledatadownload";
option java_outer_classname = "LogEnumsProto";

// MDD client side events used for logging with MddLogData.
//
// Each feature gets a range of 1000 enums starting at X000. 1st enum specifies
// if the feature is enabled. Subsequent 999 enums can be used to define events
// within the feature. Unused enums in the range are left for future use for
// the *same* feature.
// If a feature ever exhausts it's quota of enums, it should be migrated to a
// new range of contiguous 2000 enums by deprecating the existing enums.
//
// Enums should never be deleted or reused, but they can be renamed*. Old enums
// should be left in their position with [deprecated=true] attribute.
//
// * For renaming enums, see <internal>
message MddClientEvent {
  enum Code {
    // Do not use this default value.
    EVENT_CODE_UNSPECIFIED = 0;

    // Events for Mobile Data Download (<internal>) (1000-1999).
    // Next enum for data download: 1114

    // Log in a periodic tasks.
    // Logged with DataDownloadFileGroupStats, MddFileGroupStatus.
    DATA_DOWNLOAD_FILE_GROUP_STATUS = 1044;

    // MDD download result log.
    DATA_DOWNLOAD_RESULT_LOG = 1068;

    // Log MddStorageStats in daily maintenance.
    DATA_DOWNLOAD_STORAGE_STATS = 1055;

    // Log event for MDD Lib api result.
    DATA_DOWNLOAD_LIB_API_RESULT = 1108;

    // Log MddNetworkStats in daily maintenance.
    DATA_DOWNLOAD_NETWORK_STATS = 1056;

    // File group download started.
    DATA_DOWNLOAD_STARTED = 1070;

    // File group download complete.
    DATA_DOWNLOAD_COMPLETE = 1007;

    // The log event for MDD download latency.
    DATA_DOWNLOAD_LATENCY_LOG = 1080;

    // All files in the group were already available when the file group was
    // added.
    DATA_DOWNLOAD_COMPLETE_IMMEDIATE = 1032;

    DATA_DOWNLOAD_PENDING_GROUP_REPLACED = 1115;

    reserved 1000 to 1006;
    reserved 1008 to 1031;
    reserved 1033 to 1043;
    reserved 1045 to 1054;
    reserved 1057 to 1067;
    reserved 1069;
    reserved 1071 to 1079;
    reserved 1081 to 1107;
    reserved 1109 to 1114;

    reserved 2000 to 2999, 3000 to 3999, 4000 to 4099, 4100 to 4199,
        5000 to 5999, 6000 to 6999, 7000 to 7999, 8000 to 8999, 9000 to 9999,
        10000 to 10999, 11000 to 11999, 12000 to 12999, 13000, 13999,
        14000 to 14999, 15000 to 15999, 16000 to 16999, 17000 to 17999,
        18000 to 18999, 19000 to 19999;
  }
}

message MddFileGroupDownloadStatus {
  enum Code {
    INVALID = 0;
    COMPLETE = 1;
    PENDING = 2;
    FAILED = 3;
  }
}

// Result of MDD download api call.
message MddDownloadResult {
  enum Code {
    UNSPECIFIED = 0;  // unset value

    // File downloaded successfully.
    SUCCESS = 1;

    // The error we don't know.
    UNKNOWN_ERROR = 2;

    // The errors from the android downloader v1 outside MDD, which comes from:
    // <internal>
    // The block 100-199 (included) is reserved for android downloader v1.
    // Next tag: 112
    ANDROID_DOWNLOADER_UNKNOWN = 100;
    ANDROID_DOWNLOADER_CANCELED = 101;
    ANDROID_DOWNLOADER_INVALID_REQUEST = 102;
    ANDROID_DOWNLOADER_HTTP_ERROR = 103;
    ANDROID_DOWNLOADER_REQUEST_ERROR = 104;
    ANDROID_DOWNLOADER_RESPONSE_OPEN_ERROR = 105;
    ANDROID_DOWNLOADER_RESPONSE_CLOSE_ERROR = 106;
    ANDROID_DOWNLOADER_NETWORK_IO_ERROR = 107;
    ANDROID_DOWNLOADER_DISK_IO_ERROR = 108;
    ANDROID_DOWNLOADER_FILE_SYSTEM_ERROR = 109;
    ANDROID_DOWNLOADER_UNKNOWN_IO_ERROR = 110;
    ANDROID_DOWNLOADER_OAUTH_ERROR = 111;

    // The errors from the android downloader v2 outside MDD, which comes from:
    // <internal>
    // The block 200-299 (included) is reserved for android downloader v2.
    // Next tag: 201
    ANDROID_DOWNLOADER2_ERROR = 200;

    // The data file group has not been added to MDD by the time the caller
    // makes download API call.
    GROUP_NOT_FOUND_ERROR = 300;

    // The DownloadListener is present but the DownloadMonitor is not provided.
    DOWNLOAD_MONITOR_NOT_PROVIDED_ERROR = 301;

    // Errors from unsatisfied download preconditions.
    INSECURE_URL_ERROR = 302;
    LOW_DISK_ERROR = 303;

    // Errors from download preparation.
    UNABLE_TO_CREATE_FILE_URI_ERROR = 304;
    SHARED_FILE_NOT_FOUND_ERROR = 305;
    MALFORMED_FILE_URI_ERROR = 306;
    UNABLE_TO_CREATE_MOBSTORE_RESPONSE_WRITER_ERROR = 307;

    // Errors from file validation.
    UNABLE_TO_VALIDATE_DOWNLOAD_FILE_ERROR = 308;
    DOWNLOADED_FILE_NOT_FOUND_ERROR = 309;
    DOWNLOADED_FILE_CHECKSUM_MISMATCH_ERROR = 310;
    CUSTOM_FILEGROUP_VALIDATION_FAILED = 330;

    // Errors from download transforms.
    UNABLE_TO_SERIALIZE_DOWNLOAD_TRANSFORM_ERROR = 311;
    DOWNLOAD_TRANSFORM_IO_ERROR = 312;
    FINAL_FILE_CHECKSUM_MISMATCH_ERROR = 313;

    // Errors from delta download.
    DELTA_DOWNLOAD_BASE_FILE_NOT_FOUND_ERROR = 314;
    DELTA_DOWNLOAD_DECODE_IO_ERROR = 315;

    // The error occurs after the file is ready.
    UNABLE_TO_UPDATE_FILE_STATE_ERROR = 316;

    // Fail to update the file group metadata.
    UNABLE_TO_UPDATE_GROUP_METADATA_ERROR = 317;

    // Errors from sharing files with the blob storage.
    // Failed to update the metadata max_expiration_date.
    UNABLE_TO_UPDATE_FILE_MAX_EXPIRATION_DATE = 318;
    UNABLE_SHARE_FILE_BEFORE_DOWNLOAD_ERROR = 319;
    UNABLE_SHARE_FILE_AFTER_DOWNLOAD_ERROR = 320;

    // Download errors related to isolated file structure
    UNABLE_TO_REMOVE_SYMLINK_STRUCTURE = 321;
    UNABLE_TO_CREATE_SYMLINK_STRUCTURE = 322;

    // Download errors related to importing inline files
    UNABLE_TO_RESERVE_FILE_ENTRY = 323;
    INVALID_INLINE_FILE_URL_SCHEME = 324;
    INLINE_FILE_IO_ERROR = 327;
    MISSING_INLINE_DOWNLOAD_PARAMS = 328;
    MISSING_INLINE_FILE_SOURCE = 329;

    // Download errors related to URL parsing
    MALFORMED_DOWNLOAD_URL = 325;
    UNSUPPORTED_DOWNLOAD_URL_SCHEME = 326;

    // Download errors for manifest file group populator.
    MANIFEST_FILE_GROUP_POPULATOR_INVALID_FLAG_ERROR = 400;
    MANIFEST_FILE_GROUP_POPULATOR_CONTENT_CHANGED_DURING_DOWNLOAD_ERROR = 401;
    MANIFEST_FILE_GROUP_POPULATOR_PARSE_MANIFEST_FILE_ERROR = 402;
    MANIFEST_FILE_GROUP_POPULATOR_DELETE_MANIFEST_FILE_ERROR = 403;
    MANIFEST_FILE_GROUP_POPULATOR_METADATA_IO_ERROR = 404;

    reserved 1000 to 3000;
  }
}

// Collection of MDD Lib's Public API methods used when logging the result of an
// MDD Lib API call.
message MddLibApiName {
  enum Code {
    UNKNOWN = 0;

    // File Group metadata management APIs.
    // NOTE: These APIs will include DataDownloadFileGroupStats in their
    // logs.
    ADD_FILE_GROUP = 1;
    GET_FILE_GROUP = 2;
    REMOVE_FILE_GROUP = 3;
    REPORT_USAGE = 4;

    // File Group data management APIs.
    // NOTE: These APIs will include DataDownloadFileGroupStats in their
    // logs.
    CANCEL_FOREGROUND_DOWNLOAD = 5;
    DOWNLOAD_FILE_GROUP = 6;
    DOWNLOAD_FILE_GROUP_WITH_FOREGROUND_SERVICE = 7;
    IMPORT_FILES = 8;

    // File Group metadata bulk management APIs
    // NOTE: These APIs will not include DataDownloadFileGroupStats in
    // their logs.
    CLEAR = 9;
    GET_FILE_GROUPS_BY_FILTER = 10;
    MAINTENANCE = 11;
    REMOVE_FILE_GROUPS_BY_FILTER = 12;

    // File data management APIs
    // NOTE: These APIs will not include DataDownloadFileGroupStats in
    // their logs.
    DOWNLOAD_FILE = 13;
    DOWNLOAD_FILE_WITH_FOREGROUND_SERVICE = 14;

    // Task scheduling APIs.
    // NOTE: These APIs will not include DataDownloadFileGroupStats in
    // their logs.
    HANDLE_TASK = 15;
    SCHEDULE_PERIODIC_BACKGROUND_TASKS = 16;
    SYNC = 17;

    // Calls to phenotype external experiment id setting

    // NOTE: this isn't actually an MDD API but the data is in the same format.
    // DataDownloadFileGroupStats will be populated when available.
    PHENOTYPE_CLEAR_EXPERIMENT_IDS = 18;
    PHENOTYPE_UPDATE_EXPERIMENT_IDS = 19;
    PHENOTYPE_CLEAR_ALL = 20;
  }
}

// Result enum when logging the result of an MDD Lib API call.
message MddLibApiResult {
  enum Code {
    RESULT_UNKNOWN = 0;
    RESULT_SUCCESS = 1;

    // Codes for failures
    // Used for failures whose is reason is unknown.
    RESULT_FAILURE = 2;
    // Request cancelled
    RESULT_CANCELLED = 3;
    // Interrupted
    RESULT_INTERRUPTED = 4;
    RESULT_IO_ERROR = 5;
    RESULT_ILLEGAL_STATE = 6;
    RESULT_ILLEGAL_ARGUMENT = 7;
    RESULT_UNSUPPORTED_OPERATION = 8;
    RESULT_DOWNLOAD_ERROR = 9;
  }
}