Loading cmds/lshal/Timeout.h +3 −7 Original line number Diff line number Diff line Loading @@ -72,14 +72,10 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func return false; } bool success = state.wait(now + delay); if (success) { pthread_join(thread, nullptr); } else { // b/311143089: Abandon this background thread. Resources for a detached // thread are cleaned up when it is terminated. If the background thread // is stalled, it will be terminated when returning from main(). pthread_detach(thread); if (!success) { pthread_kill(thread, SIGINT); } pthread_join(thread, nullptr); return success; } Loading cmds/lshal/main.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,5 @@ int main(int argc, char **argv) { using namespace ::android::lshal; // Background pthreads from timeout() are destroyed upon returning from main(). return Lshal{}.main(Arg{argc, argv}); } libs/binder/Android.bp +15 −9 Original line number Diff line number Diff line Loading @@ -106,6 +106,17 @@ cc_defaults { header_libs: [ "libbinder_headers", ], cflags: [ "-Wextra", "-Wextra-semi", "-Werror", "-Wzero-as-null-pointer-constant", "-Wreorder-init-list", "-Wunused-const-variable", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], } cc_defaults { Loading Loading @@ -135,15 +146,6 @@ cc_defaults { export_aidl_headers: true, }, cflags: [ "-Wextra", "-Wextra-semi", "-Werror", "-Wzero-as-null-pointer-constant", "-Wreorder-init-list", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], product_variables: { debuggable: { cflags: [ Loading Loading @@ -220,6 +222,10 @@ cc_defaults { cflags: [ "-DBINDER_RPC_SINGLE_THREADED", "-DBINDER_ENABLE_LIBLOG_ASSERT", "-DBINDER_DISABLE_NATIVE_HANDLE", "-DBINDER_DISABLE_BLOB", "-DBINDER_NO_LIBBASE", // Trusty libbinder uses vendor stability for its binders "-D__ANDROID_VNDK__", "-U__ANDROID__", Loading libs/binder/Parcel.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ static std::atomic<size_t> gParcelGlobalAllocSize; constexpr size_t kMaxFds = 1024; // Maximum size of a blob to transfer in-place. static const size_t BLOB_INPLACE_LIMIT = 16 * 1024; [[maybe_unused]] static const size_t BLOB_INPLACE_LIMIT = 16 * 1024; #if defined(__BIONIC__) static void FdTag(int fd, const void* old_addr, const void* new_addr) { Loading Loading @@ -886,6 +886,9 @@ void Parcel::updateWorkSourceRequestHeaderPosition() const { } #ifdef BINDER_WITH_KERNEL_IPC #if defined(__ANDROID__) #if defined(__ANDROID_VNDK__) constexpr int32_t kHeader = B_PACK_CHARS('V', 'N', 'D', 'R'); #elif defined(__ANDROID_RECOVERY__) Loading @@ -893,6 +896,14 @@ constexpr int32_t kHeader = B_PACK_CHARS('R', 'E', 'C', 'O'); #else constexpr int32_t kHeader = B_PACK_CHARS('S', 'Y', 'S', 'T'); #endif #else // ANDROID not defined // If kernel binder is used in new environments, we need to make sure it's separated // out and has a separate header. constexpr int32_t kHeader = B_PACK_CHARS('U', 'N', 'K', 'N'); #endif #endif // BINDER_WITH_KERNEL_IPC // Write RPC headers. (previously just the interface token) Loading libs/binder/file.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ #ifdef BINDER_NO_LIBBASE #include "Utils.h" #include <stdint.h> // clang-format off Loading Loading
cmds/lshal/Timeout.h +3 −7 Original line number Diff line number Diff line Loading @@ -72,14 +72,10 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func return false; } bool success = state.wait(now + delay); if (success) { pthread_join(thread, nullptr); } else { // b/311143089: Abandon this background thread. Resources for a detached // thread are cleaned up when it is terminated. If the background thread // is stalled, it will be terminated when returning from main(). pthread_detach(thread); if (!success) { pthread_kill(thread, SIGINT); } pthread_join(thread, nullptr); return success; } Loading
cmds/lshal/main.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,5 @@ int main(int argc, char **argv) { using namespace ::android::lshal; // Background pthreads from timeout() are destroyed upon returning from main(). return Lshal{}.main(Arg{argc, argv}); }
libs/binder/Android.bp +15 −9 Original line number Diff line number Diff line Loading @@ -106,6 +106,17 @@ cc_defaults { header_libs: [ "libbinder_headers", ], cflags: [ "-Wextra", "-Wextra-semi", "-Werror", "-Wzero-as-null-pointer-constant", "-Wreorder-init-list", "-Wunused-const-variable", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], } cc_defaults { Loading Loading @@ -135,15 +146,6 @@ cc_defaults { export_aidl_headers: true, }, cflags: [ "-Wextra", "-Wextra-semi", "-Werror", "-Wzero-as-null-pointer-constant", "-Wreorder-init-list", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], product_variables: { debuggable: { cflags: [ Loading Loading @@ -220,6 +222,10 @@ cc_defaults { cflags: [ "-DBINDER_RPC_SINGLE_THREADED", "-DBINDER_ENABLE_LIBLOG_ASSERT", "-DBINDER_DISABLE_NATIVE_HANDLE", "-DBINDER_DISABLE_BLOB", "-DBINDER_NO_LIBBASE", // Trusty libbinder uses vendor stability for its binders "-D__ANDROID_VNDK__", "-U__ANDROID__", Loading
libs/binder/Parcel.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ static std::atomic<size_t> gParcelGlobalAllocSize; constexpr size_t kMaxFds = 1024; // Maximum size of a blob to transfer in-place. static const size_t BLOB_INPLACE_LIMIT = 16 * 1024; [[maybe_unused]] static const size_t BLOB_INPLACE_LIMIT = 16 * 1024; #if defined(__BIONIC__) static void FdTag(int fd, const void* old_addr, const void* new_addr) { Loading Loading @@ -886,6 +886,9 @@ void Parcel::updateWorkSourceRequestHeaderPosition() const { } #ifdef BINDER_WITH_KERNEL_IPC #if defined(__ANDROID__) #if defined(__ANDROID_VNDK__) constexpr int32_t kHeader = B_PACK_CHARS('V', 'N', 'D', 'R'); #elif defined(__ANDROID_RECOVERY__) Loading @@ -893,6 +896,14 @@ constexpr int32_t kHeader = B_PACK_CHARS('R', 'E', 'C', 'O'); #else constexpr int32_t kHeader = B_PACK_CHARS('S', 'Y', 'S', 'T'); #endif #else // ANDROID not defined // If kernel binder is used in new environments, we need to make sure it's separated // out and has a separate header. constexpr int32_t kHeader = B_PACK_CHARS('U', 'N', 'K', 'N'); #endif #endif // BINDER_WITH_KERNEL_IPC // Write RPC headers. (previously just the interface token) Loading
libs/binder/file.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ #ifdef BINDER_NO_LIBBASE #include "Utils.h" #include <stdint.h> // clang-format off Loading