blob: 73eb863706eef6d03a6e1b7f587f6141b7963f9e [file] [log] [blame]
Steven Moreland12300a02019-08-02 13:27:15 -07001/*
2 * Copyright (C) 2019 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_stability.h>
18
19#include <binder/Stability.h>
20#include "ibinder_internal.h"
21
22#include <log/log.h>
23
24using ::android::internal::Stability;
25
26#ifdef __ANDROID_VNDK__
27#error libbinder_ndk should only be built in a system context
28#endif
29
Steven Moreland6eec6882023-10-24 23:00:02 +000030#ifdef __ANDROID_VENDOR__
31#error libbinder_ndk should only be built in a system context
32#endif
33
Steven Moreland6932fe12019-08-08 18:17:51 -070034#ifdef __ANDROID_NDK__
35#error libbinder_ndk should only be built in a system context
36#endif
37
Kalesh Singh8b802912021-03-31 12:13:56 -040038// explicit extern because symbol is only declared in header when __ANDROID_VENDOR__
Steven Moreland12300a02019-08-02 13:27:15 -070039extern "C" void AIBinder_markVendorStability(AIBinder* binder) {
40 Stability::markVndk(binder->getBinder().get());
41}
42
43void AIBinder_markSystemStability(AIBinder* binder) {
44 Stability::markCompilationUnit(binder->getBinder().get());
45}
46
47void AIBinder_markVintfStability(AIBinder* binder) {
48 Stability::markVintf(binder->getBinder().get());
49}
Kalesh Singh8b802912021-03-31 12:13:56 -040050
51// explicit extern because symbol is only declared in header when __ANDROID_VENDOR__
52extern "C" void AIBinder_forceDowngradeToVendorStability(AIBinder* binder) {
53 Stability::forceDowngradeToVendorStability(binder->getBinder());
54}
55
56void AIBinder_forceDowngradeToSystemStability(AIBinder* binder) {
57 Stability::forceDowngradeToSystemStability(binder->getBinder());
58}