Loading libs/binder/BpBinder.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ #define LOG_TAG "BpBinder" #define ATRACE_TAG ATRACE_TAG_AIDL //#define LOG_NDEBUG 0 #include <binder/BpBinder.h> Loading @@ -26,6 +27,12 @@ #include <stdio.h> #ifndef __TRUSTY__ #include <cutils/trace.h> #else #define ATRACE_INT(...) #endif #include "BuildFlags.h" #include "file.h" Loading Loading @@ -209,6 +216,7 @@ sp<BpBinder> BpBinder::create(int32_t handle) { sTrackingMap[trackedUid]++; } uint32_t numProxies = sBinderProxyCount.fetch_add(1, std::memory_order_relaxed); ATRACE_INT("binder_proxies", numProxies); uint32_t numLastWarned = sBinderProxyCountWarned.load(std::memory_order_relaxed); uint32_t numNextWarn = numLastWarned + kBinderProxyCountWarnInterval; if (numProxies >= numNextWarn) { Loading Loading @@ -632,8 +640,8 @@ BpBinder::~BpBinder() { } } } --sBinderProxyCount; [[maybe_unused]] uint32_t numProxies = --sBinderProxyCount; ATRACE_INT("binder_proxies", numProxies); if (ipc) { ipc->expungeHandle(binderHandle(), this); ipc->decWeakHandle(binderHandle()); Loading libs/binder/IServiceManager.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <inttypes.h> #include <unistd.h> #include <condition_variable> #include <android-base/properties.h> #include <android/os/BnServiceCallback.h> Loading Loading @@ -642,7 +643,7 @@ public: protected: // Override realGetService for ServiceManagerShim::waitForService. Status realGetService(const std::string& name, sp<IBinder>* _aidl_return) { Status realGetService(const std::string& name, sp<IBinder>* _aidl_return) override { *_aidl_return = getDeviceService({"-g", name}, mOptions); return Status::ok(); } Loading libs/binder/Parcel.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2768,7 +2768,7 @@ void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize, const bin } if (type == BINDER_TYPE_FD) { // FDs from the kernel are always owned FdTag(flat->handle, 0, this); FdTag(flat->handle, nullptr, this); } minOffset = offset + sizeof(flat_binder_object); } Loading libs/binder/RecordedTransaction.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -230,8 +230,8 @@ std::optional<RecordedTransaction> RecordedTransaction::fromFile(const unique_fd } size_t memoryMappedSize = chunkPayloadSize + mmapPayloadStartOffset; void* mappedMemory = mmap(NULL, memoryMappedSize, PROT_READ, MAP_SHARED, fd.get(), mmapPageAlignedStart); void* mappedMemory = mmap(nullptr, memoryMappedSize, PROT_READ, MAP_SHARED, fd.get(), mmapPageAlignedStart); auto mmap_guard = make_scope_guard( [mappedMemory, memoryMappedSize] { munmap(mappedMemory, memoryMappedSize); }); Loading Loading @@ -382,7 +382,7 @@ android::status_t RecordedTransaction::dumpToFile(const unique_fd& fd) const { return UNKNOWN_ERROR; } if (NO_ERROR != writeChunk(fd, END_CHUNK, 0, NULL)) { if (NO_ERROR != writeChunk(fd, END_CHUNK, 0, nullptr)) { ALOGE("Failed to write end chunk to fd %d", fd.get()); return UNKNOWN_ERROR; } Loading libs/binder/Stability.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ bool Stability::requiresVintfDeclaration(const sp<IBinder>& binder) { } void Stability::tryMarkCompilationUnit(IBinder* binder) { (void)setRepr(binder, getLocalLevel(), REPR_NONE); std::ignore = setRepr(binder, getLocalLevel(), REPR_NONE); } // after deprecation of the VNDK, these should be aliases. At some point Loading Loading
libs/binder/BpBinder.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ #define LOG_TAG "BpBinder" #define ATRACE_TAG ATRACE_TAG_AIDL //#define LOG_NDEBUG 0 #include <binder/BpBinder.h> Loading @@ -26,6 +27,12 @@ #include <stdio.h> #ifndef __TRUSTY__ #include <cutils/trace.h> #else #define ATRACE_INT(...) #endif #include "BuildFlags.h" #include "file.h" Loading Loading @@ -209,6 +216,7 @@ sp<BpBinder> BpBinder::create(int32_t handle) { sTrackingMap[trackedUid]++; } uint32_t numProxies = sBinderProxyCount.fetch_add(1, std::memory_order_relaxed); ATRACE_INT("binder_proxies", numProxies); uint32_t numLastWarned = sBinderProxyCountWarned.load(std::memory_order_relaxed); uint32_t numNextWarn = numLastWarned + kBinderProxyCountWarnInterval; if (numProxies >= numNextWarn) { Loading Loading @@ -632,8 +640,8 @@ BpBinder::~BpBinder() { } } } --sBinderProxyCount; [[maybe_unused]] uint32_t numProxies = --sBinderProxyCount; ATRACE_INT("binder_proxies", numProxies); if (ipc) { ipc->expungeHandle(binderHandle(), this); ipc->decWeakHandle(binderHandle()); Loading
libs/binder/IServiceManager.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <inttypes.h> #include <unistd.h> #include <condition_variable> #include <android-base/properties.h> #include <android/os/BnServiceCallback.h> Loading Loading @@ -642,7 +643,7 @@ public: protected: // Override realGetService for ServiceManagerShim::waitForService. Status realGetService(const std::string& name, sp<IBinder>* _aidl_return) { Status realGetService(const std::string& name, sp<IBinder>* _aidl_return) override { *_aidl_return = getDeviceService({"-g", name}, mOptions); return Status::ok(); } Loading
libs/binder/Parcel.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2768,7 +2768,7 @@ void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize, const bin } if (type == BINDER_TYPE_FD) { // FDs from the kernel are always owned FdTag(flat->handle, 0, this); FdTag(flat->handle, nullptr, this); } minOffset = offset + sizeof(flat_binder_object); } Loading
libs/binder/RecordedTransaction.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -230,8 +230,8 @@ std::optional<RecordedTransaction> RecordedTransaction::fromFile(const unique_fd } size_t memoryMappedSize = chunkPayloadSize + mmapPayloadStartOffset; void* mappedMemory = mmap(NULL, memoryMappedSize, PROT_READ, MAP_SHARED, fd.get(), mmapPageAlignedStart); void* mappedMemory = mmap(nullptr, memoryMappedSize, PROT_READ, MAP_SHARED, fd.get(), mmapPageAlignedStart); auto mmap_guard = make_scope_guard( [mappedMemory, memoryMappedSize] { munmap(mappedMemory, memoryMappedSize); }); Loading Loading @@ -382,7 +382,7 @@ android::status_t RecordedTransaction::dumpToFile(const unique_fd& fd) const { return UNKNOWN_ERROR; } if (NO_ERROR != writeChunk(fd, END_CHUNK, 0, NULL)) { if (NO_ERROR != writeChunk(fd, END_CHUNK, 0, nullptr)) { ALOGE("Failed to write end chunk to fd %d", fd.get()); return UNKNOWN_ERROR; } Loading
libs/binder/Stability.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ bool Stability::requiresVintfDeclaration(const sp<IBinder>& binder) { } void Stability::tryMarkCompilationUnit(IBinder* binder) { (void)setRepr(binder, getLocalLevel(), REPR_NONE); std::ignore = setRepr(binder, getLocalLevel(), REPR_NONE); } // after deprecation of the VNDK, these should be aliases. At some point Loading