Loading libs/binder/ndk/Android.bp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ cc_library { "ibinder_jni.cpp", "ibinder_jni.cpp", "parcel.cpp", "parcel.cpp", "process.cpp", "process.cpp", "stability.cpp", "status.cpp", "status.cpp", "service_manager.cpp", "service_manager.cpp", ], ], Loading @@ -54,7 +55,7 @@ cc_library { version_script: "libbinder_ndk.map.txt", version_script: "libbinder_ndk.map.txt", stubs: { stubs: { symbol_file: "libbinder_ndk.map.txt", symbol_file: "libbinder_ndk.map.txt", versions: ["29"], versions: ["29", "30"], }, }, } } Loading libs/binder/ndk/include_apex/android/binder_stability.h 0 → 100644 +52 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <android/binder_ibinder.h> __BEGIN_DECLS #ifdef __ANDROID_VNDK__ /** * This interface has the stability of the vendor image. */ void AIBinder_markVendorStability(AIBinder* binder); static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) { AIBinder_markVendorStability(binder); } #else // ndef defined __ANDROID_VNDK__ /** * This interface has the stability of the system image. */ void AIBinder_markSystemStability(AIBinder* binder); static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) { AIBinder_markSystemStability(binder); } #endif // ifdef __ANDROID_VNDK__ /** * This interface has system<->vendor stability */ void AIBinder_markVintfStability(AIBinder* binder); __END_DECLS libs/binder/ndk/libbinder_ndk.map.txt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -98,3 +98,12 @@ LIBBINDER_NDK { # introduced=29 local: local: *; *; }; }; LIBBINDER_NDK30 { # introduced=30 global: AIBinder_markSystemStability; # apex AIBinder_markVendorStability; # vndk AIBinder_markVintfStability; # apex vndk local: *; }; libs/binder/ndk/stability.cpp 0 → 100644 +41 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <android/binder_stability.h> #include <binder/Stability.h> #include "ibinder_internal.h" #include <log/log.h> using ::android::internal::Stability; #ifdef __ANDROID_VNDK__ #error libbinder_ndk should only be built in a system context #endif // explicit extern because symbol is only declared in header when __ANDROID_VNDK__ extern "C" void AIBinder_markVendorStability(AIBinder* binder) { Stability::markVndk(binder->getBinder().get()); } void AIBinder_markSystemStability(AIBinder* binder) { Stability::markCompilationUnit(binder->getBinder().get()); } void AIBinder_markVintfStability(AIBinder* binder) { Stability::markVintf(binder->getBinder().get()); } libs/binder/tests/Android.bp +15 −2 Original line number Original line Diff line number Diff line Loading @@ -138,18 +138,31 @@ cc_test { test_suites: ["device-tests"], test_suites: ["device-tests"], } } aidl_interface { name: "binderStabilityTestIface", srcs: [ "IBinderStabilityTest.aidl", "IBinderStabilityTestSub.aidl", ], } cc_test { cc_test { name: "binderStabilityTest", name: "binderStabilityTest", defaults: ["binder_test_defaults"], defaults: ["binder_test_defaults"], srcs: [ srcs: [ "binderStabilityTest.cpp", "binderStabilityTest.cpp", "IBinderStabilityTest.aidl", "IBinderStabilityTestSub.aidl", ], ], shared_libs: [ shared_libs: [ "libbinder_ndk", "libbinder", "libbinder", "liblog", "libutils", "libutils", ], ], static_libs: [ "binderStabilityTestIface-cpp", "binderStabilityTestIface-ndk_platform", ], test_suites: ["device-tests"], test_suites: ["device-tests"], } } Loading
libs/binder/ndk/Android.bp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ cc_library { "ibinder_jni.cpp", "ibinder_jni.cpp", "parcel.cpp", "parcel.cpp", "process.cpp", "process.cpp", "stability.cpp", "status.cpp", "status.cpp", "service_manager.cpp", "service_manager.cpp", ], ], Loading @@ -54,7 +55,7 @@ cc_library { version_script: "libbinder_ndk.map.txt", version_script: "libbinder_ndk.map.txt", stubs: { stubs: { symbol_file: "libbinder_ndk.map.txt", symbol_file: "libbinder_ndk.map.txt", versions: ["29"], versions: ["29", "30"], }, }, } } Loading
libs/binder/ndk/include_apex/android/binder_stability.h 0 → 100644 +52 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <android/binder_ibinder.h> __BEGIN_DECLS #ifdef __ANDROID_VNDK__ /** * This interface has the stability of the vendor image. */ void AIBinder_markVendorStability(AIBinder* binder); static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) { AIBinder_markVendorStability(binder); } #else // ndef defined __ANDROID_VNDK__ /** * This interface has the stability of the system image. */ void AIBinder_markSystemStability(AIBinder* binder); static inline void AIBinder_markCompilationUnitStability(AIBinder* binder) { AIBinder_markSystemStability(binder); } #endif // ifdef __ANDROID_VNDK__ /** * This interface has system<->vendor stability */ void AIBinder_markVintfStability(AIBinder* binder); __END_DECLS
libs/binder/ndk/libbinder_ndk.map.txt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -98,3 +98,12 @@ LIBBINDER_NDK { # introduced=29 local: local: *; *; }; }; LIBBINDER_NDK30 { # introduced=30 global: AIBinder_markSystemStability; # apex AIBinder_markVendorStability; # vndk AIBinder_markVintfStability; # apex vndk local: *; };
libs/binder/ndk/stability.cpp 0 → 100644 +41 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <android/binder_stability.h> #include <binder/Stability.h> #include "ibinder_internal.h" #include <log/log.h> using ::android::internal::Stability; #ifdef __ANDROID_VNDK__ #error libbinder_ndk should only be built in a system context #endif // explicit extern because symbol is only declared in header when __ANDROID_VNDK__ extern "C" void AIBinder_markVendorStability(AIBinder* binder) { Stability::markVndk(binder->getBinder().get()); } void AIBinder_markSystemStability(AIBinder* binder) { Stability::markCompilationUnit(binder->getBinder().get()); } void AIBinder_markVintfStability(AIBinder* binder) { Stability::markVintf(binder->getBinder().get()); }
libs/binder/tests/Android.bp +15 −2 Original line number Original line Diff line number Diff line Loading @@ -138,18 +138,31 @@ cc_test { test_suites: ["device-tests"], test_suites: ["device-tests"], } } aidl_interface { name: "binderStabilityTestIface", srcs: [ "IBinderStabilityTest.aidl", "IBinderStabilityTestSub.aidl", ], } cc_test { cc_test { name: "binderStabilityTest", name: "binderStabilityTest", defaults: ["binder_test_defaults"], defaults: ["binder_test_defaults"], srcs: [ srcs: [ "binderStabilityTest.cpp", "binderStabilityTest.cpp", "IBinderStabilityTest.aidl", "IBinderStabilityTestSub.aidl", ], ], shared_libs: [ shared_libs: [ "libbinder_ndk", "libbinder", "libbinder", "liblog", "libutils", "libutils", ], ], static_libs: [ "binderStabilityTestIface-cpp", "binderStabilityTestIface-ndk_platform", ], test_suites: ["device-tests"], test_suites: ["device-tests"], } }