Loading libs/binder/include/binder/IPCThreadState.h +2 −0 Original line number Diff line number Diff line Loading @@ -141,11 +141,13 @@ public: void restoreCallingIdentity(int64_t token); bool hasExplicitIdentity(); // For main functions - dangerous for libraries to use status_t setupPolling(int* fd); status_t handlePolledCommands(); void flushCommands(); bool flushIfNeeded(); // For main functions - dangerous for libraries to use void joinThreadPool(bool isMain = true); // Stop the local process. Loading libs/binder/include/binder/ProcessState.h +3 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public: sp<IBinder> getContextObject(const sp<IBinder>& caller); // For main functions - dangerous for libraries to use void startThreadPool(); bool becomeContextManager(); Loading @@ -57,8 +58,10 @@ public: sp<IBinder> getStrongProxyForHandle(int32_t handle); void expungeHandle(int32_t handle, IBinder* binder); // TODO: deprecate. void spawnPooledThread(bool isMain); // For main functions - dangerous for libraries to use status_t setThreadPoolMaxThreadCount(size_t maxThreads); status_t enableOnewaySpamDetection(bool enable); void giveThreadPoolName(); Loading libs/binder/ndk/include_platform/android/binder_process.h +9 −0 Original line number Diff line number Diff line Loading @@ -28,17 +28,26 @@ __BEGIN_DECLS * * When using this, it is expected that ABinderProcess_setupPolling and * ABinderProcess_handlePolledCommands are not used. * * Do not use this from a library. Apps setup their own threadpools, and otherwise, the main * function should be responsible for configuring the threadpool for the entire application. */ void ABinderProcess_startThreadPool(); /** * This sets the maximum number of threads that can be started in the threadpool. By default, after * startThreadPool is called, this is 15. If it is called additional times, it will only prevent * the kernel from starting new threads and will not delete already existing threads. * * Do not use this from a library. Apps setup their own threadpools, and otherwise, the main * function should be responsible for configuring the threadpool for the entire application. */ bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads); /** * This adds the current thread to the threadpool. This may cause the threadpool to exceed the * maximum size. * * Do not use this from a library. Apps setup their own threadpools, and otherwise, the main * function should be responsible for configuring the threadpool for the entire application. */ void ABinderProcess_joinThreadPool(); Loading libs/binder/tests/parcel_fuzzer/random_parcel.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,11 @@ void fillRandomParcel(Parcel* p, FuzzedDataProvider&& provider, RandomParcelOpti 1)); CHECK(OK == p->writeFileDescriptor(fd.get(), false /*takeOwnership*/)); } else { // b/260119717 - Adding more FDs can eventually lead to FD limit exhaustion if (options->extraFds.size() > 1000) { return; } std::vector<base::unique_fd> fds = getRandomFds(&provider); CHECK(OK == p->writeFileDescriptor(fds.begin()->release(), Loading libs/binder/trusty/include/log/log.h +5 −3 Original line number Diff line number Diff line Loading @@ -121,6 +121,8 @@ static inline void __ignore_va_args__(...) {} TLOGE("android_errorWriteLog: tag:%x subTag:%s\n", tag, subTag); \ } while (0) extern "C" inline void __assert(const char* file, int line, const char* str) { LOG_ALWAYS_FATAL("%s:%d: assertion \"%s\" failed", file, line, str); } // Override the definition of __assert from binder_status.h #ifndef __BIONIC__ #undef __assert #define __assert(file, line, str) LOG_ALWAYS_FATAL("%s:%d: %s", file, line, str) #endif // __BIONIC__ Loading
libs/binder/include/binder/IPCThreadState.h +2 −0 Original line number Diff line number Diff line Loading @@ -141,11 +141,13 @@ public: void restoreCallingIdentity(int64_t token); bool hasExplicitIdentity(); // For main functions - dangerous for libraries to use status_t setupPolling(int* fd); status_t handlePolledCommands(); void flushCommands(); bool flushIfNeeded(); // For main functions - dangerous for libraries to use void joinThreadPool(bool isMain = true); // Stop the local process. Loading
libs/binder/include/binder/ProcessState.h +3 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public: sp<IBinder> getContextObject(const sp<IBinder>& caller); // For main functions - dangerous for libraries to use void startThreadPool(); bool becomeContextManager(); Loading @@ -57,8 +58,10 @@ public: sp<IBinder> getStrongProxyForHandle(int32_t handle); void expungeHandle(int32_t handle, IBinder* binder); // TODO: deprecate. void spawnPooledThread(bool isMain); // For main functions - dangerous for libraries to use status_t setThreadPoolMaxThreadCount(size_t maxThreads); status_t enableOnewaySpamDetection(bool enable); void giveThreadPoolName(); Loading
libs/binder/ndk/include_platform/android/binder_process.h +9 −0 Original line number Diff line number Diff line Loading @@ -28,17 +28,26 @@ __BEGIN_DECLS * * When using this, it is expected that ABinderProcess_setupPolling and * ABinderProcess_handlePolledCommands are not used. * * Do not use this from a library. Apps setup their own threadpools, and otherwise, the main * function should be responsible for configuring the threadpool for the entire application. */ void ABinderProcess_startThreadPool(); /** * This sets the maximum number of threads that can be started in the threadpool. By default, after * startThreadPool is called, this is 15. If it is called additional times, it will only prevent * the kernel from starting new threads and will not delete already existing threads. * * Do not use this from a library. Apps setup their own threadpools, and otherwise, the main * function should be responsible for configuring the threadpool for the entire application. */ bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads); /** * This adds the current thread to the threadpool. This may cause the threadpool to exceed the * maximum size. * * Do not use this from a library. Apps setup their own threadpools, and otherwise, the main * function should be responsible for configuring the threadpool for the entire application. */ void ABinderProcess_joinThreadPool(); Loading
libs/binder/tests/parcel_fuzzer/random_parcel.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,11 @@ void fillRandomParcel(Parcel* p, FuzzedDataProvider&& provider, RandomParcelOpti 1)); CHECK(OK == p->writeFileDescriptor(fd.get(), false /*takeOwnership*/)); } else { // b/260119717 - Adding more FDs can eventually lead to FD limit exhaustion if (options->extraFds.size() > 1000) { return; } std::vector<base::unique_fd> fds = getRandomFds(&provider); CHECK(OK == p->writeFileDescriptor(fds.begin()->release(), Loading
libs/binder/trusty/include/log/log.h +5 −3 Original line number Diff line number Diff line Loading @@ -121,6 +121,8 @@ static inline void __ignore_va_args__(...) {} TLOGE("android_errorWriteLog: tag:%x subTag:%s\n", tag, subTag); \ } while (0) extern "C" inline void __assert(const char* file, int line, const char* str) { LOG_ALWAYS_FATAL("%s:%d: assertion \"%s\" failed", file, line, str); } // Override the definition of __assert from binder_status.h #ifndef __BIONIC__ #undef __assert #define __assert(file, line, str) LOG_ALWAYS_FATAL("%s:%d: %s", file, line, str) #endif // __BIONIC__