Loading include/input/InputEventLabels.h +8 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,12 @@ struct InputEventLabel { int value; int value; }; }; struct EvdevEventLabel { std::string type; std::string code; std::string value; }; // NOTE: If you want a new key code, axis code, led code or flag code in keylayout file, // NOTE: If you want a new key code, axis code, led code or flag code in keylayout file, // then you must add it to InputEventLabels.cpp. // then you must add it to InputEventLabels.cpp. Loading @@ -52,6 +58,8 @@ public: static std::optional<int> getLedByLabel(const char* label); static std::optional<int> getLedByLabel(const char* label); static EvdevEventLabel getLinuxEvdevLabel(int32_t type, int32_t code, int32_t value); private: private: static const std::unordered_map<std::string, int> KEYCODES; static const std::unordered_map<std::string, int> KEYCODES; Loading libs/binder/Android.bp +3 −6 Original line number Original line Diff line number Diff line Loading @@ -74,9 +74,6 @@ cc_defaults { name: "libbinder_common_defaults", name: "libbinder_common_defaults", host_supported: true, host_supported: true, // for vndbinder and binderRpcTest vendor_available: true, srcs: [ srcs: [ "Binder.cpp", "Binder.cpp", "BpBinder.cpp", "BpBinder.cpp", Loading Loading @@ -200,7 +197,6 @@ cc_defaults { cc_library_headers { cc_library_headers { name: "trusty_mock_headers", name: "trusty_mock_headers", vendor_available: true, host_supported: true, host_supported: true, export_include_dirs: [ export_include_dirs: [ Loading @@ -215,7 +211,6 @@ cc_library_headers { cc_defaults { cc_defaults { name: "trusty_mock_defaults", name: "trusty_mock_defaults", vendor_available: true, host_supported: true, host_supported: true, header_libs: [ header_libs: [ Loading Loading @@ -309,6 +304,8 @@ cc_library { version_script: "libbinder.map", version_script: "libbinder.map", // for vndbinder vendor_available: true, vndk: { vndk: { enabled: true, enabled: true, }, }, Loading Loading @@ -467,7 +464,6 @@ cc_library_shared { cc_library_static { cc_library_static { name: "libbinder_tls_static", name: "libbinder_tls_static", defaults: ["libbinder_tls_defaults"], defaults: ["libbinder_tls_defaults"], vendor_available: true, visibility: [ visibility: [ ":__subpackages__", ":__subpackages__", ], ], Loading Loading @@ -550,6 +546,7 @@ cc_library { "//packages/modules/Virtualization/javalib/jni", "//packages/modules/Virtualization/javalib/jni", "//packages/modules/Virtualization/vm_payload", "//packages/modules/Virtualization/vm_payload", "//device/google/cuttlefish/shared/minidroid:__subpackages__", "//device/google/cuttlefish/shared/minidroid:__subpackages__", "//system/software_defined_vehicle:__subpackages__", ], ], } } Loading libs/binder/ndk/include_platform/android/binder_manager.h +14 −3 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,16 @@ __BEGIN_DECLS __BEGIN_DECLS enum AServiceManager_AddServiceFlag : uint32_t { /** * This allows processes with AID_ISOLATED to get the binder of the service added. * * Services with methods that perform file IO, web socket creation or ways to egress data must * not be added with this flag for privacy concerns. */ ADD_SERVICE_ALLOW_ISOLATED = 1, }; /** /** * This registers the service with the default service manager under this instance name. This does * This registers the service with the default service manager under this instance name. This does * not take ownership of binder. * not take ownership of binder. Loading @@ -46,12 +56,13 @@ __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServic * * * \param binder object to register globally with the service manager. * \param binder object to register globally with the service manager. * \param instance identifier of the service. This will be used to lookup the service. * \param instance identifier of the service. This will be used to lookup the service. * \param allowIsolated allows if this service can be isolated. * \param flag an AServiceManager_AddServiceFlag enum to denote how the service should be added. * * * \return EX_NONE on success. * \return EX_NONE on success. */ */ __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServiceWithAllowIsolated( __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServiceWithFlag( AIBinder* binder, const char* instance, bool allowIsolated) __INTRODUCED_IN(34); AIBinder* binder, const char* instance, const AServiceManager_AddServiceFlag flag) __INTRODUCED_IN(34); /** /** * Gets a binder object with this specific instance name. Will return nullptr immediately if the * Gets a binder object with this specific instance name. Will return nullptr immediately if the Loading libs/binder/ndk/libbinder_ndk.map.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -158,12 +158,12 @@ LIBBINDER_NDK34 { # introduced=UpsideDownCake AServiceManager_getUpdatableApexName; # systemapi AServiceManager_getUpdatableApexName; # systemapi AServiceManager_registerForServiceNotifications; # systemapi llndk AServiceManager_registerForServiceNotifications; # systemapi llndk AServiceManager_NotificationRegistration_delete; # systemapi llndk AServiceManager_NotificationRegistration_delete; # systemapi llndk AServiceManager_addServiceWithFlag; # systemapi llndk }; }; LIBBINDER_NDK_PLATFORM { LIBBINDER_NDK_PLATFORM { global: global: AParcel_getAllowFds; AParcel_getAllowFds; AServiceManager_addServiceWithAllowIsolated; extern "C++" { extern "C++" { AIBinder_fromPlatformBinder*; AIBinder_fromPlatformBinder*; AIBinder_toPlatformBinder*; AIBinder_toPlatformBinder*; Loading libs/binder/ndk/service_manager.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -42,14 +42,15 @@ binder_exception_t AServiceManager_addService(AIBinder* binder, const char* inst return PruneException(exception); return PruneException(exception); } } binder_exception_t AServiceManager_addServiceWithAllowIsolated(AIBinder* binder, binder_exception_t AServiceManager_addServiceWithFlag(AIBinder* binder, const char* instance, const char* instance, const AServiceManager_AddServiceFlag flag) { bool allowIsolated) { if (binder == nullptr || instance == nullptr) { if (binder == nullptr || instance == nullptr) { return EX_ILLEGAL_ARGUMENT; return EX_ILLEGAL_ARGUMENT; } } sp<IServiceManager> sm = defaultServiceManager(); sp<IServiceManager> sm = defaultServiceManager(); bool allowIsolated = flag & AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED; status_t exception = sm->addService(String16(instance), binder->getBinder(), allowIsolated); status_t exception = sm->addService(String16(instance), binder->getBinder(), allowIsolated); return PruneException(exception); return PruneException(exception); } } Loading Loading
include/input/InputEventLabels.h +8 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,12 @@ struct InputEventLabel { int value; int value; }; }; struct EvdevEventLabel { std::string type; std::string code; std::string value; }; // NOTE: If you want a new key code, axis code, led code or flag code in keylayout file, // NOTE: If you want a new key code, axis code, led code or flag code in keylayout file, // then you must add it to InputEventLabels.cpp. // then you must add it to InputEventLabels.cpp. Loading @@ -52,6 +58,8 @@ public: static std::optional<int> getLedByLabel(const char* label); static std::optional<int> getLedByLabel(const char* label); static EvdevEventLabel getLinuxEvdevLabel(int32_t type, int32_t code, int32_t value); private: private: static const std::unordered_map<std::string, int> KEYCODES; static const std::unordered_map<std::string, int> KEYCODES; Loading
libs/binder/Android.bp +3 −6 Original line number Original line Diff line number Diff line Loading @@ -74,9 +74,6 @@ cc_defaults { name: "libbinder_common_defaults", name: "libbinder_common_defaults", host_supported: true, host_supported: true, // for vndbinder and binderRpcTest vendor_available: true, srcs: [ srcs: [ "Binder.cpp", "Binder.cpp", "BpBinder.cpp", "BpBinder.cpp", Loading Loading @@ -200,7 +197,6 @@ cc_defaults { cc_library_headers { cc_library_headers { name: "trusty_mock_headers", name: "trusty_mock_headers", vendor_available: true, host_supported: true, host_supported: true, export_include_dirs: [ export_include_dirs: [ Loading @@ -215,7 +211,6 @@ cc_library_headers { cc_defaults { cc_defaults { name: "trusty_mock_defaults", name: "trusty_mock_defaults", vendor_available: true, host_supported: true, host_supported: true, header_libs: [ header_libs: [ Loading Loading @@ -309,6 +304,8 @@ cc_library { version_script: "libbinder.map", version_script: "libbinder.map", // for vndbinder vendor_available: true, vndk: { vndk: { enabled: true, enabled: true, }, }, Loading Loading @@ -467,7 +464,6 @@ cc_library_shared { cc_library_static { cc_library_static { name: "libbinder_tls_static", name: "libbinder_tls_static", defaults: ["libbinder_tls_defaults"], defaults: ["libbinder_tls_defaults"], vendor_available: true, visibility: [ visibility: [ ":__subpackages__", ":__subpackages__", ], ], Loading Loading @@ -550,6 +546,7 @@ cc_library { "//packages/modules/Virtualization/javalib/jni", "//packages/modules/Virtualization/javalib/jni", "//packages/modules/Virtualization/vm_payload", "//packages/modules/Virtualization/vm_payload", "//device/google/cuttlefish/shared/minidroid:__subpackages__", "//device/google/cuttlefish/shared/minidroid:__subpackages__", "//system/software_defined_vehicle:__subpackages__", ], ], } } Loading
libs/binder/ndk/include_platform/android/binder_manager.h +14 −3 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,16 @@ __BEGIN_DECLS __BEGIN_DECLS enum AServiceManager_AddServiceFlag : uint32_t { /** * This allows processes with AID_ISOLATED to get the binder of the service added. * * Services with methods that perform file IO, web socket creation or ways to egress data must * not be added with this flag for privacy concerns. */ ADD_SERVICE_ALLOW_ISOLATED = 1, }; /** /** * This registers the service with the default service manager under this instance name. This does * This registers the service with the default service manager under this instance name. This does * not take ownership of binder. * not take ownership of binder. Loading @@ -46,12 +56,13 @@ __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServic * * * \param binder object to register globally with the service manager. * \param binder object to register globally with the service manager. * \param instance identifier of the service. This will be used to lookup the service. * \param instance identifier of the service. This will be used to lookup the service. * \param allowIsolated allows if this service can be isolated. * \param flag an AServiceManager_AddServiceFlag enum to denote how the service should be added. * * * \return EX_NONE on success. * \return EX_NONE on success. */ */ __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServiceWithAllowIsolated( __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServiceWithFlag( AIBinder* binder, const char* instance, bool allowIsolated) __INTRODUCED_IN(34); AIBinder* binder, const char* instance, const AServiceManager_AddServiceFlag flag) __INTRODUCED_IN(34); /** /** * Gets a binder object with this specific instance name. Will return nullptr immediately if the * Gets a binder object with this specific instance name. Will return nullptr immediately if the Loading
libs/binder/ndk/libbinder_ndk.map.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -158,12 +158,12 @@ LIBBINDER_NDK34 { # introduced=UpsideDownCake AServiceManager_getUpdatableApexName; # systemapi AServiceManager_getUpdatableApexName; # systemapi AServiceManager_registerForServiceNotifications; # systemapi llndk AServiceManager_registerForServiceNotifications; # systemapi llndk AServiceManager_NotificationRegistration_delete; # systemapi llndk AServiceManager_NotificationRegistration_delete; # systemapi llndk AServiceManager_addServiceWithFlag; # systemapi llndk }; }; LIBBINDER_NDK_PLATFORM { LIBBINDER_NDK_PLATFORM { global: global: AParcel_getAllowFds; AParcel_getAllowFds; AServiceManager_addServiceWithAllowIsolated; extern "C++" { extern "C++" { AIBinder_fromPlatformBinder*; AIBinder_fromPlatformBinder*; AIBinder_toPlatformBinder*; AIBinder_toPlatformBinder*; Loading
libs/binder/ndk/service_manager.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -42,14 +42,15 @@ binder_exception_t AServiceManager_addService(AIBinder* binder, const char* inst return PruneException(exception); return PruneException(exception); } } binder_exception_t AServiceManager_addServiceWithAllowIsolated(AIBinder* binder, binder_exception_t AServiceManager_addServiceWithFlag(AIBinder* binder, const char* instance, const char* instance, const AServiceManager_AddServiceFlag flag) { bool allowIsolated) { if (binder == nullptr || instance == nullptr) { if (binder == nullptr || instance == nullptr) { return EX_ILLEGAL_ARGUMENT; return EX_ILLEGAL_ARGUMENT; } } sp<IServiceManager> sm = defaultServiceManager(); sp<IServiceManager> sm = defaultServiceManager(); bool allowIsolated = flag & AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED; status_t exception = sm->addService(String16(instance), binder->getBinder(), allowIsolated); status_t exception = sm->addService(String16(instance), binder->getBinder(), allowIsolated); return PruneException(exception); return PruneException(exception); } } Loading