Loading libs/binder/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,7 @@ cc_defaults { "-Wunused-const-variable", "-Wunused-result", "-Wexit-time-destructors", "-Wshadow", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", // Hide symbols by default and set the BUILDING_LIBBINDER macro so that Loading libs/binder/BackendUnifiedServiceManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ Status BackendUnifiedServiceManager::updateCache(const std::string& serviceName, if (atrace_is_tag_enabled(ATRACE_TAG_AIDL)) { traceStr = "BinderCacheWithInvalidation::updateCache : " + serviceName; } binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, traceStr.c_str()); binder::ScopedTrace outerAidlTrace(ATRACE_TAG_AIDL, traceStr.c_str()); if (!binder) { binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, Loading libs/binder/IPermissionController.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -160,8 +160,8 @@ status_t BnPermissionController::onTransact( case GET_PACKAGE_UID_TRANSACTION: { CHECK_INTERFACE(IPermissionController, data, reply); String16 package = data.readString16(); int flags = data.readInt32(); const int uid = getPackageUid(package, flags); int intFlags = data.readInt32(); const int uid = getPackageUid(package, intFlags); reply->writeNoException(); reply->writeInt32(uid); return NO_ERROR; Loading libs/binder/IServiceManager.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -587,8 +587,7 @@ CppBackendShim::CppBackendShim(const sp<BackendUnifiedServiceManager>& impl) sp<IBinder> CppBackendShim::getService(const String16& name) const { static bool gSystemBootCompleted = false; sp<IBinder> svc = checkService(name); if (svc != nullptr) return svc; if (sp<IBinder> svc = checkService(name); svc != nullptr) return svc; sp<ProcessState> self = ProcessState::selfOrNull(); const bool isVendorService = Loading libs/binder/LazyServiceRegistrar.cpp +14 −10 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ private: */ void maybeTryShutdownLocked(); void updateCacheClientCount(); // for below std::mutex mMutex; Loading Loading @@ -243,24 +245,26 @@ void ClientCounterCallbackImpl::maybeTryShutdownLocked() { } } void ClientCounterCallbackImpl::updateCacheClientCount() { size_t numWithClients = 0; for (const auto& [name, registered] : mRegisteredServices) { (void)name; if (registered.clients) numWithClients++; } mNumConnectedServices = numWithClients; } Status ClientCounterCallbackImpl::onClients(const sp<IBinder>& service, bool clients) { std::lock_guard<std::mutex> lock(mMutex); auto & [name, registered] = *assertRegisteredService(service); if (registered.clients == clients) { LOG_ALWAYS_FATAL("Process already thought %s had clients: %d but servicemanager has " "notified has clients: %d", name.c_str(), registered.clients, clients); "notified has clients: %d", name.c_str(), registered.clients, clients); } registered.clients = clients; // update cache count of clients { size_t numWithClients = 0; for (const auto& [name, registered] : mRegisteredServices) { (void) name; if (registered.clients) numWithClients++; } mNumConnectedServices = numWithClients; } updateCacheClientCount(); ALOGI("Process has %zu (of %zu available) client(s) in use after notification %s has clients: %d", mNumConnectedServices, mRegisteredServices.size(), name.c_str(), clients); Loading Loading
libs/binder/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,7 @@ cc_defaults { "-Wunused-const-variable", "-Wunused-result", "-Wexit-time-destructors", "-Wshadow", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", // Hide symbols by default and set the BUILDING_LIBBINDER macro so that Loading
libs/binder/BackendUnifiedServiceManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,7 @@ Status BackendUnifiedServiceManager::updateCache(const std::string& serviceName, if (atrace_is_tag_enabled(ATRACE_TAG_AIDL)) { traceStr = "BinderCacheWithInvalidation::updateCache : " + serviceName; } binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, traceStr.c_str()); binder::ScopedTrace outerAidlTrace(ATRACE_TAG_AIDL, traceStr.c_str()); if (!binder) { binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, Loading
libs/binder/IPermissionController.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -160,8 +160,8 @@ status_t BnPermissionController::onTransact( case GET_PACKAGE_UID_TRANSACTION: { CHECK_INTERFACE(IPermissionController, data, reply); String16 package = data.readString16(); int flags = data.readInt32(); const int uid = getPackageUid(package, flags); int intFlags = data.readInt32(); const int uid = getPackageUid(package, intFlags); reply->writeNoException(); reply->writeInt32(uid); return NO_ERROR; Loading
libs/binder/IServiceManager.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -587,8 +587,7 @@ CppBackendShim::CppBackendShim(const sp<BackendUnifiedServiceManager>& impl) sp<IBinder> CppBackendShim::getService(const String16& name) const { static bool gSystemBootCompleted = false; sp<IBinder> svc = checkService(name); if (svc != nullptr) return svc; if (sp<IBinder> svc = checkService(name); svc != nullptr) return svc; sp<ProcessState> self = ProcessState::selfOrNull(); const bool isVendorService = Loading
libs/binder/LazyServiceRegistrar.cpp +14 −10 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ private: */ void maybeTryShutdownLocked(); void updateCacheClientCount(); // for below std::mutex mMutex; Loading Loading @@ -243,24 +245,26 @@ void ClientCounterCallbackImpl::maybeTryShutdownLocked() { } } void ClientCounterCallbackImpl::updateCacheClientCount() { size_t numWithClients = 0; for (const auto& [name, registered] : mRegisteredServices) { (void)name; if (registered.clients) numWithClients++; } mNumConnectedServices = numWithClients; } Status ClientCounterCallbackImpl::onClients(const sp<IBinder>& service, bool clients) { std::lock_guard<std::mutex> lock(mMutex); auto & [name, registered] = *assertRegisteredService(service); if (registered.clients == clients) { LOG_ALWAYS_FATAL("Process already thought %s had clients: %d but servicemanager has " "notified has clients: %d", name.c_str(), registered.clients, clients); "notified has clients: %d", name.c_str(), registered.clients, clients); } registered.clients = clients; // update cache count of clients { size_t numWithClients = 0; for (const auto& [name, registered] : mRegisteredServices) { (void) name; if (registered.clients) numWithClients++; } mNumConnectedServices = numWithClients; } updateCacheClientCount(); ALOGI("Process has %zu (of %zu available) client(s) in use after notification %s has clients: %d", mNumConnectedServices, mRegisteredServices.size(), name.c_str(), clients); Loading