blob: 7eafb9c025d8c0cc15f001f6a45808c1d3adaff1 [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 Moreland6932fe12019-08-08 18:17:51 -070030#ifdef __ANDROID_NDK__
31#error libbinder_ndk should only be built in a system context
32#endif
33
Kalesh Singh8b802912021-03-31 12:13:56 -040034// explicit extern because symbol is only declared in header when __ANDROID_VENDOR__
Steven Moreland12300a02019-08-02 13:27:15 -070035extern "C" void AIBinder_markVendorStability(AIBinder* binder) {
36 Stability::markVndk(binder->getBinder().get());
37}
38
39void AIBinder_markSystemStability(AIBinder* binder) {
40 Stability::markCompilationUnit(binder->getBinder().get());
41}
42
43void AIBinder_markVintfStability(AIBinder* binder) {
44 Stability::markVintf(binder->getBinder().get());
45}
Kalesh Singh8b802912021-03-31 12:13:56 -040046
47// explicit extern because symbol is only declared in header when __ANDROID_VENDOR__
48extern "C" void AIBinder_forceDowngradeToVendorStability(AIBinder* binder) {
49 Stability::forceDowngradeToVendorStability(binder->getBinder());
50}
51
52void AIBinder_forceDowngradeToSystemStability(AIBinder* binder) {
53 Stability::forceDowngradeToSystemStability(binder->getBinder());
54}