Before creating a new client channel, AMD should check whether it already exists
or not. If it exists, AMD doesn't create the client channel.
Change-Id: Ic147b02a7274371488489b865e0c07b53cfbc07b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
extern "C" EXPORT_API int amd_app_request_broker_connect(pid_t pid, uid_t uid) {
auto& broker = AppRequestBroker::GetInst();
- auto channel = broker.CreateClientChannel(pid, uid);
+ auto channel = broker.FindClientChannel(pid);
+ if (channel != nullptr) {
+ _W("Already exists. pid(%d)", pid);
+ return 0;
+ }
+
+ channel = broker.CreateClientChannel(pid, uid);
if (channel == nullptr)
return -ECOMM;