Loading libs/binder/Android.bp +18 −0 Original line number Original line Diff line number Diff line Loading @@ -320,6 +320,24 @@ cc_defaults { "ServiceManagerHost.cpp", "ServiceManagerHost.cpp", ], ], }, }, android: { shared_libs: [ "libapexsupport", "libvndksupport", ], }, recovery: { exclude_shared_libs: [ "libapexsupport", "libvndksupport", ], }, native_bridge: { exclude_shared_libs: [ "libapexsupport", "libvndksupport", ], }, }, }, cflags: [ cflags: [ "-DBINDER_WITH_KERNEL_IPC", "-DBINDER_WITH_KERNEL_IPC", Loading libs/binder/IServiceManager.cpp +26 −0 Original line number Original line Diff line number Diff line Loading @@ -40,6 +40,11 @@ #include "ServiceManagerHost.h" #include "ServiceManagerHost.h" #endif #endif #if defined(__ANDROID__) && !defined(__ANDROID_RECOVERY__) && !defined(__ANDROID_NATIVE_BRIDGE__) #include <android/apexsupport.h> #include <vndksupport/linker.h> #endif #include "Static.h" #include "Static.h" namespace android { namespace android { Loading Loading @@ -259,6 +264,27 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid, bool logP } } } } void* openDeclaredPassthroughHal(const String16& interface, const String16& instance, int flag) { #if defined(__ANDROID__) && !defined(__ANDROID_RECOVERY__) && !defined(__ANDROID_NATIVE_BRIDGE__) sp<IServiceManager> sm = defaultServiceManager(); String16 name = interface + String16("/") + instance; if (!sm->isDeclared(name)) { return nullptr; } String16 libraryName = interface + String16(".") + instance + String16(".so"); if (auto updatableViaApex = sm->updatableViaApex(name); updatableViaApex.has_value()) { return AApexSupport_loadLibrary(String8(libraryName).c_str(), String8(*updatableViaApex).c_str(), flag); } return android_load_sphal_library(String8(libraryName).c_str(), flag); #else (void)interface; (void)instance; (void)flag; return nullptr; #endif } #endif //__ANDROID_VNDK__ #endif //__ANDROID_VNDK__ // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- Loading libs/binder/include/binder/IServiceManager.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -207,6 +207,8 @@ status_t getService(const String16& name, sp<INTERFACE>* outService) return NAME_NOT_FOUND; return NAME_NOT_FOUND; } } void* openDeclaredPassthroughHal(const String16& interface, const String16& instance, int flag); bool checkCallingPermission(const String16& permission); bool checkCallingPermission(const String16& permission); bool checkCallingPermission(const String16& permission, bool checkCallingPermission(const String16& permission, int32_t* outPid, int32_t* outUid); int32_t* outPid, int32_t* outUid); Loading libs/binder/ndk/include_platform/android/binder_manager.h +12 −0 Original line number Original line Diff line number Diff line Loading @@ -242,6 +242,18 @@ void AServiceManager_getUpdatableApexName(const char* instance, void* context, void (*callback)(const char*, void*)) void (*callback)(const char*, void*)) __INTRODUCED_IN(__ANDROID_API_U__); __INTRODUCED_IN(__ANDROID_API_U__); /** * Opens a declared passthrough HAL. * * \param instance identifier of the passthrough service (e.g. "mapper") * \param instance identifier of the implemenatation (e.g. "default") * \param flag passed to dlopen() */ void* AServiceManager_openDeclaredPassthroughHal(const char* interface, const char* instance, int flag) // TODO(b/302113279) use __INTRODUCED_LLNDK for vendor variants __INTRODUCED_IN(__ANDROID_API_V__); /** /** * Prevent lazy services without client from shutting down their process * Prevent lazy services without client from shutting down their process * * Loading libs/binder/ndk/libbinder_ndk.map.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -204,6 +204,7 @@ LIBBINDER_NDK35 { # introduced=VanillaIceCream APersistableBundle_getDoubleVectorKeys; APersistableBundle_getDoubleVectorKeys; APersistableBundle_getStringVectorKeys; APersistableBundle_getStringVectorKeys; APersistableBundle_getPersistableBundleKeys; APersistableBundle_getPersistableBundleKeys; AServiceManager_openDeclaredPassthroughHal; # systemapi llndk }; }; LIBBINDER_NDK_PLATFORM { LIBBINDER_NDK_PLATFORM { Loading Loading
libs/binder/Android.bp +18 −0 Original line number Original line Diff line number Diff line Loading @@ -320,6 +320,24 @@ cc_defaults { "ServiceManagerHost.cpp", "ServiceManagerHost.cpp", ], ], }, }, android: { shared_libs: [ "libapexsupport", "libvndksupport", ], }, recovery: { exclude_shared_libs: [ "libapexsupport", "libvndksupport", ], }, native_bridge: { exclude_shared_libs: [ "libapexsupport", "libvndksupport", ], }, }, }, cflags: [ cflags: [ "-DBINDER_WITH_KERNEL_IPC", "-DBINDER_WITH_KERNEL_IPC", Loading
libs/binder/IServiceManager.cpp +26 −0 Original line number Original line Diff line number Diff line Loading @@ -40,6 +40,11 @@ #include "ServiceManagerHost.h" #include "ServiceManagerHost.h" #endif #endif #if defined(__ANDROID__) && !defined(__ANDROID_RECOVERY__) && !defined(__ANDROID_NATIVE_BRIDGE__) #include <android/apexsupport.h> #include <vndksupport/linker.h> #endif #include "Static.h" #include "Static.h" namespace android { namespace android { Loading Loading @@ -259,6 +264,27 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid, bool logP } } } } void* openDeclaredPassthroughHal(const String16& interface, const String16& instance, int flag) { #if defined(__ANDROID__) && !defined(__ANDROID_RECOVERY__) && !defined(__ANDROID_NATIVE_BRIDGE__) sp<IServiceManager> sm = defaultServiceManager(); String16 name = interface + String16("/") + instance; if (!sm->isDeclared(name)) { return nullptr; } String16 libraryName = interface + String16(".") + instance + String16(".so"); if (auto updatableViaApex = sm->updatableViaApex(name); updatableViaApex.has_value()) { return AApexSupport_loadLibrary(String8(libraryName).c_str(), String8(*updatableViaApex).c_str(), flag); } return android_load_sphal_library(String8(libraryName).c_str(), flag); #else (void)interface; (void)instance; (void)flag; return nullptr; #endif } #endif //__ANDROID_VNDK__ #endif //__ANDROID_VNDK__ // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- Loading
libs/binder/include/binder/IServiceManager.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -207,6 +207,8 @@ status_t getService(const String16& name, sp<INTERFACE>* outService) return NAME_NOT_FOUND; return NAME_NOT_FOUND; } } void* openDeclaredPassthroughHal(const String16& interface, const String16& instance, int flag); bool checkCallingPermission(const String16& permission); bool checkCallingPermission(const String16& permission); bool checkCallingPermission(const String16& permission, bool checkCallingPermission(const String16& permission, int32_t* outPid, int32_t* outUid); int32_t* outPid, int32_t* outUid); Loading
libs/binder/ndk/include_platform/android/binder_manager.h +12 −0 Original line number Original line Diff line number Diff line Loading @@ -242,6 +242,18 @@ void AServiceManager_getUpdatableApexName(const char* instance, void* context, void (*callback)(const char*, void*)) void (*callback)(const char*, void*)) __INTRODUCED_IN(__ANDROID_API_U__); __INTRODUCED_IN(__ANDROID_API_U__); /** * Opens a declared passthrough HAL. * * \param instance identifier of the passthrough service (e.g. "mapper") * \param instance identifier of the implemenatation (e.g. "default") * \param flag passed to dlopen() */ void* AServiceManager_openDeclaredPassthroughHal(const char* interface, const char* instance, int flag) // TODO(b/302113279) use __INTRODUCED_LLNDK for vendor variants __INTRODUCED_IN(__ANDROID_API_V__); /** /** * Prevent lazy services without client from shutting down their process * Prevent lazy services without client from shutting down their process * * Loading
libs/binder/ndk/libbinder_ndk.map.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -204,6 +204,7 @@ LIBBINDER_NDK35 { # introduced=VanillaIceCream APersistableBundle_getDoubleVectorKeys; APersistableBundle_getDoubleVectorKeys; APersistableBundle_getStringVectorKeys; APersistableBundle_getStringVectorKeys; APersistableBundle_getPersistableBundleKeys; APersistableBundle_getPersistableBundleKeys; AServiceManager_openDeclaredPassthroughHal; # systemapi llndk }; }; LIBBINDER_NDK_PLATFORM { LIBBINDER_NDK_PLATFORM { Loading