blob: ef142b5cf885bbad6bebc8989b72abb1664f79f5 [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
Stephen Crane2a3c2502020-06-16 17:48:35 -070017#include <android/binder_ibinder.h>
Steven Moreland8afad292020-11-06 22:26:51 +000018#include <android/binder_ibinder_platform.h>
Stephen Crane2a3c2502020-06-16 17:48:35 -070019#include <android/binder_manager.h>
20#include <android/binder_parcel.h>
Steven Morelandf183fdd2020-10-27 00:12:12 +000021#include <android/binder_parcel_platform.h>
Stephen Crane2a3c2502020-06-16 17:48:35 -070022#include <android/binder_process.h>
23#include <android/binder_shell.h>
24#include <android/binder_status.h>
25
26namespace android {
27
28namespace c_interface {
29
30// Expose error codes from anonymous enum in binder_status.h
31enum 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
54enum 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
73namespace consts {
74
75enum {
76 FIRST_CALL_TRANSACTION = FIRST_CALL_TRANSACTION,
77 LAST_CALL_TRANSACTION = LAST_CALL_TRANSACTION,
78};
79
80enum {
81 FLAG_ONEWAY = FLAG_ONEWAY,
Steven Morelandf183fdd2020-10-27 00:12:12 +000082 FLAG_CLEAR_BUF = FLAG_CLEAR_BUF,
Stephen Crane2a3c2502020-06-16 17:48:35 -070083};
84
85} // namespace consts
86
87} // namespace c_interface
88
89} // namespace android