Loading cmds/servicemanager/ServiceManager.cpp +15 −11 Original line number Diff line number Diff line Loading @@ -423,11 +423,12 @@ ssize_t ServiceManager::Service::getNodeStrongRefCount() { void ServiceManager::handleClientCallbacks() { for (const auto& [name, service] : mNameToService) { handleServiceClientCallback(name); handleServiceClientCallback(name, true); } } ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceName) { ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceName, bool isCalledOnInterval) { auto serviceIt = mNameToService.find(serviceName); if (serviceIt == mNameToService.end() || mNameToClientCallback.count(serviceName) < 1) { return -1; Loading @@ -451,6 +452,8 @@ ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceNa service.guaranteeClient = false; } // only send notifications if this was called via the interval checking workflow if (isCalledOnInterval) { if (hasClients && !service.hasClients) { // client was retrieved in some other way sendClientCallbackNotifications(serviceName, true); Loading @@ -460,6 +463,7 @@ ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceNa if (!hasClients && service.hasClients) { sendClientCallbackNotifications(serviceName, false); } } return count; } Loading Loading @@ -518,7 +522,7 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE); } int clients = handleServiceClientCallback(name); int clients = handleServiceClientCallback(name, false); // clients < 0: feature not implemented or other error. Assume clients. // Otherwise: Loading @@ -527,7 +531,7 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB // So, if clients > 2, then at least one other service on the system must hold a refcount. if (clients < 0 || clients > 2) { // client callbacks are either disabled or there are other clients LOG(INFO) << "Tried to unregister " << name << " but there are clients: " << clients; LOG(INFO) << "Tried to unregister " << name << ", but there are clients: " << clients; return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE); } Loading cmds/servicemanager/ServiceManager.h +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ private: void removeRegistrationCallback(const wp<IBinder>& who, ServiceCallbackMap::iterator* it, bool* found); ssize_t handleServiceClientCallback(const std::string& serviceName); ssize_t handleServiceClientCallback(const std::string& serviceName, bool isCalledOnInterval); // Also updates mHasClients (of what the last callback was) void sendClientCallbackNotifications(const std::string& serviceName, bool hasClients); // removes a callback from mNameToClientCallback, deleting the entry if the vector is empty Loading include/input/Input.h +7 −7 Original line number Diff line number Diff line Loading @@ -354,9 +354,9 @@ public: inline int32_t getDeviceId() const { return mDeviceId; } inline int32_t getSource() const { return mSource; } inline uint32_t getSource() const { return mSource; } inline void setSource(int32_t source) { mSource = source; } inline void setSource(uint32_t source) { mSource = source; } inline int32_t getDisplayId() const { return mDisplayId; } Loading @@ -365,12 +365,12 @@ public: inline std::array<uint8_t, 32> getHmac() const { return mHmac; } protected: void initialize(int32_t deviceId, int32_t source, int32_t displayId, void initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac); void initialize(const InputEvent& from); int32_t mDeviceId; int32_t mSource; uint32_t mSource; int32_t mDisplayId; std::array<uint8_t, 32> mHmac; }; Loading Loading @@ -405,7 +405,7 @@ public: static const char* getLabel(int32_t keyCode); static int32_t getKeyCodeFromLabel(const char* label); void initialize(int32_t deviceId, int32_t source, int32_t displayId, void initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, int32_t repeatCount, nsecs_t downTime, nsecs_t eventTime); Loading Loading @@ -629,7 +629,7 @@ public: ssize_t findPointerIndex(int32_t pointerId) const; void initialize(int32_t deviceId, int32_t source, int32_t displayId, void initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac, int32_t action, int32_t actionButton, int32_t flags, int32_t edgeFlags, int32_t metaState, int32_t buttonState, MotionClassification classification, float xScale, float yScale, float xOffset, Loading Loading @@ -657,7 +657,7 @@ public: status_t writeToParcel(Parcel* parcel) const; #endif static bool isTouchEvent(int32_t source, int32_t action); static bool isTouchEvent(uint32_t source, int32_t action); inline bool isTouchEvent() const { return isTouchEvent(mSource, mAction); } Loading libs/binder/BufferedTextOutput.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ * limitations under the License. */ #include <binder/BufferedTextOutput.h> #include "BufferedTextOutput.h" #include <binder/Debug.h> #include <cutils/atomic.h> Loading libs/binder/include/binder/BufferedTextOutput.h→libs/binder/BufferedTextOutput.h +0 −0 File moved. View file Loading
cmds/servicemanager/ServiceManager.cpp +15 −11 Original line number Diff line number Diff line Loading @@ -423,11 +423,12 @@ ssize_t ServiceManager::Service::getNodeStrongRefCount() { void ServiceManager::handleClientCallbacks() { for (const auto& [name, service] : mNameToService) { handleServiceClientCallback(name); handleServiceClientCallback(name, true); } } ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceName) { ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceName, bool isCalledOnInterval) { auto serviceIt = mNameToService.find(serviceName); if (serviceIt == mNameToService.end() || mNameToClientCallback.count(serviceName) < 1) { return -1; Loading @@ -451,6 +452,8 @@ ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceNa service.guaranteeClient = false; } // only send notifications if this was called via the interval checking workflow if (isCalledOnInterval) { if (hasClients && !service.hasClients) { // client was retrieved in some other way sendClientCallbackNotifications(serviceName, true); Loading @@ -460,6 +463,7 @@ ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceNa if (!hasClients && service.hasClients) { sendClientCallbackNotifications(serviceName, false); } } return count; } Loading Loading @@ -518,7 +522,7 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE); } int clients = handleServiceClientCallback(name); int clients = handleServiceClientCallback(name, false); // clients < 0: feature not implemented or other error. Assume clients. // Otherwise: Loading @@ -527,7 +531,7 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB // So, if clients > 2, then at least one other service on the system must hold a refcount. if (clients < 0 || clients > 2) { // client callbacks are either disabled or there are other clients LOG(INFO) << "Tried to unregister " << name << " but there are clients: " << clients; LOG(INFO) << "Tried to unregister " << name << ", but there are clients: " << clients; return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE); } Loading
cmds/servicemanager/ServiceManager.h +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ private: void removeRegistrationCallback(const wp<IBinder>& who, ServiceCallbackMap::iterator* it, bool* found); ssize_t handleServiceClientCallback(const std::string& serviceName); ssize_t handleServiceClientCallback(const std::string& serviceName, bool isCalledOnInterval); // Also updates mHasClients (of what the last callback was) void sendClientCallbackNotifications(const std::string& serviceName, bool hasClients); // removes a callback from mNameToClientCallback, deleting the entry if the vector is empty Loading
include/input/Input.h +7 −7 Original line number Diff line number Diff line Loading @@ -354,9 +354,9 @@ public: inline int32_t getDeviceId() const { return mDeviceId; } inline int32_t getSource() const { return mSource; } inline uint32_t getSource() const { return mSource; } inline void setSource(int32_t source) { mSource = source; } inline void setSource(uint32_t source) { mSource = source; } inline int32_t getDisplayId() const { return mDisplayId; } Loading @@ -365,12 +365,12 @@ public: inline std::array<uint8_t, 32> getHmac() const { return mHmac; } protected: void initialize(int32_t deviceId, int32_t source, int32_t displayId, void initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac); void initialize(const InputEvent& from); int32_t mDeviceId; int32_t mSource; uint32_t mSource; int32_t mDisplayId; std::array<uint8_t, 32> mHmac; }; Loading Loading @@ -405,7 +405,7 @@ public: static const char* getLabel(int32_t keyCode); static int32_t getKeyCodeFromLabel(const char* label); void initialize(int32_t deviceId, int32_t source, int32_t displayId, void initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, int32_t repeatCount, nsecs_t downTime, nsecs_t eventTime); Loading Loading @@ -629,7 +629,7 @@ public: ssize_t findPointerIndex(int32_t pointerId) const; void initialize(int32_t deviceId, int32_t source, int32_t displayId, void initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac, int32_t action, int32_t actionButton, int32_t flags, int32_t edgeFlags, int32_t metaState, int32_t buttonState, MotionClassification classification, float xScale, float yScale, float xOffset, Loading Loading @@ -657,7 +657,7 @@ public: status_t writeToParcel(Parcel* parcel) const; #endif static bool isTouchEvent(int32_t source, int32_t action); static bool isTouchEvent(uint32_t source, int32_t action); inline bool isTouchEvent() const { return isTouchEvent(mSource, mAction); } Loading
libs/binder/BufferedTextOutput.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ * limitations under the License. */ #include <binder/BufferedTextOutput.h> #include "BufferedTextOutput.h" #include <binder/Debug.h> #include <cutils/atomic.h> Loading
libs/binder/include/binder/BufferedTextOutput.h→libs/binder/BufferedTextOutput.h +0 −0 File moved. View file