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