blob: f22c58b22a97983e66a6480b13277ca6a2c42d0a [file] [log] [blame]
Bob Badour07562132020-05-20 13:18:00 +00001//
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// clang-format off
18#include "native_bridge_support/vdso/interceptable_functions.h"
19
20DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiDevice_fromJava);
21DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiDevice_getNumInputPorts);
22DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiDevice_getNumOutputPorts);
23DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiDevice_getType);
24DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiDevice_release);
25DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiInputPort_close);
26DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiInputPort_open);
27DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiInputPort_send);
28DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiInputPort_sendFlush);
29DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiInputPort_sendWithTimestamp);
30DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiOutputPort_close);
31DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiOutputPort_open);
32DEFINE_INTERCEPTABLE_STUB_FUNCTION(AMidiOutputPort_receive);
33
34static void __attribute__((constructor(0))) init_stub_library() {
35 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiDevice_fromJava);
36 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiDevice_getNumInputPorts);
37 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiDevice_getNumOutputPorts);
38 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiDevice_getType);
39 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiDevice_release);
40 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiInputPort_close);
41 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiInputPort_open);
42 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiInputPort_send);
43 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiInputPort_sendFlush);
44 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiInputPort_sendWithTimestamp);
45 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiOutputPort_close);
46 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiOutputPort_open);
47 INIT_INTERCEPTABLE_STUB_FUNCTION("libamidi.so", AMidiOutputPort_receive);
48}
49// clang-format on