Stephen Crane | 2a3c250 | 2020-06-16 17:48:35 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2020 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 | |
| 17 | #include <android/binder_ibinder.h> |
| 18 | #include <android/binder_manager.h> |
| 19 | #include <android/binder_parcel.h> |
| 20 | #include <android/binder_process.h> |
| 21 | #include <android/binder_shell.h> |
| 22 | #include <android/binder_status.h> |
| 23 | |
| 24 | namespace android { |
| 25 | |
| 26 | namespace c_interface { |
| 27 | |
| 28 | // Expose error codes from anonymous enum in binder_status.h |
| 29 | enum StatusCode { |
| 30 | OK = STATUS_OK, |
| 31 | UNKNOWN_ERROR = STATUS_UNKNOWN_ERROR, |
| 32 | NO_MEMORY = STATUS_NO_MEMORY, |
| 33 | INVALID_OPERATION = STATUS_INVALID_OPERATION, |
| 34 | BAD_VALUE = STATUS_BAD_VALUE, |
| 35 | BAD_TYPE = STATUS_BAD_TYPE, |
| 36 | NAME_NOT_FOUND = STATUS_NAME_NOT_FOUND, |
| 37 | PERMISSION_DENIED = STATUS_PERMISSION_DENIED, |
| 38 | NO_INIT = STATUS_NO_INIT, |
| 39 | ALREADY_EXISTS = STATUS_ALREADY_EXISTS, |
| 40 | DEAD_OBJECT = STATUS_DEAD_OBJECT, |
| 41 | FAILED_TRANSACTION = STATUS_FAILED_TRANSACTION, |
| 42 | BAD_INDEX = STATUS_BAD_INDEX, |
| 43 | NOT_ENOUGH_DATA = STATUS_NOT_ENOUGH_DATA, |
| 44 | WOULD_BLOCK = STATUS_WOULD_BLOCK, |
| 45 | TIMED_OUT = STATUS_TIMED_OUT, |
| 46 | UNKNOWN_TRANSACTION = STATUS_UNKNOWN_TRANSACTION, |
| 47 | FDS_NOT_ALLOWED = STATUS_FDS_NOT_ALLOWED, |
| 48 | UNEXPECTED_NULL = STATUS_UNEXPECTED_NULL, |
| 49 | }; |
| 50 | |
| 51 | // Expose exception codes from anonymous enum in binder_status.h |
| 52 | enum ExceptionCode { |
| 53 | NONE = EX_NONE, |
| 54 | SECURITY = EX_SECURITY, |
| 55 | BAD_PARCELABLE = EX_BAD_PARCELABLE, |
| 56 | ILLEGAL_ARGUMENT = EX_ILLEGAL_ARGUMENT, |
| 57 | NULL_POINTER = EX_NULL_POINTER, |
| 58 | ILLEGAL_STATE = EX_ILLEGAL_STATE, |
| 59 | NETWORK_MAIN_THREAD = EX_NETWORK_MAIN_THREAD, |
| 60 | UNSUPPORTED_OPERATION = EX_UNSUPPORTED_OPERATION, |
| 61 | SERVICE_SPECIFIC = EX_SERVICE_SPECIFIC, |
| 62 | PARCELABLE = EX_PARCELABLE, |
| 63 | |
| 64 | /** |
| 65 | * This is special, and indicates to native binder proxies that the |
| 66 | * transaction has failed at a low level. |
| 67 | */ |
| 68 | TRANSACTION_FAILED = EX_TRANSACTION_FAILED, |
| 69 | }; |
| 70 | |
| 71 | namespace consts { |
| 72 | |
| 73 | enum { |
| 74 | FIRST_CALL_TRANSACTION = FIRST_CALL_TRANSACTION, |
| 75 | LAST_CALL_TRANSACTION = LAST_CALL_TRANSACTION, |
| 76 | }; |
| 77 | |
| 78 | enum { |
| 79 | FLAG_ONEWAY = FLAG_ONEWAY, |
| 80 | }; |
| 81 | |
| 82 | } // namespace consts |
| 83 | |
| 84 | } // namespace c_interface |
| 85 | |
| 86 | } // namespace android |