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