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