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