1/* 2 * Copyright (C) 2021 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.media; 20 21/* 22 * Status for media errors are numbered by google3/google/rpc/code.proto 23 * 24 * Notes: 25 * 1) The default for Status is "OK" not "UNKNOWN". 26 * 2) android.media.Status is based on Android status codes, not http. 27 * 3) We choose code.proto rather than negative numbers (signed status) 28 * for numeric categorization. 29 * 30 * [Google3 proto] [android.media.Status] 31 * OK = 0; 1 (NO_ERROR) 32 * UNKNOWN = 2; 0 (ERROR_UNKNOWN) 33 * INVALID_ARGUMENT = 3; 2 (ERROR_ARGUMENT) 34 * DEADLINE_EXCEEDED = 4; 3 (ERROR_TIMEOUT) 35 * PERMISSION_DENIED = 7; 4 (ERROR_SECURITY) 36 * RESOURCE_EXHAUSTED = 8; 5 (ERROR_MEMORY) 37 * FAILED_PRECONDITION = 9; 6 (ERROR_STATE) 38 * UNAVAILABLE = 14; 7 (ERROR_IO) 39 */ 40enum Status { 41 // See above for the numbering scheme. 42 // We use ERROR_UNKNOWN = 0 as the default value should new error values 43 // be sent to code not yet updated. 44 ERROR_UNKNOWN = 0; 45 // We use NO_ERROR to be visually distinct from an ERROR enumeration, 46 // though it may flag a best practices warning. 47 NO_ERROR = 1; 48 ERROR_ARGUMENT = 2; 49 ERROR_TIMEOUT = 3; 50 ERROR_SECURITY = 4; 51 ERROR_MEMORY = 5; 52 ERROR_STATE = 6; 53 ERROR_IO = 7; 54} 55