提交 79160d34 编写于 作者: O openharmony_ci 提交者: Gitee

!4 Get SA

Merge pull request !4 from ql/sa
......@@ -104,6 +104,8 @@ public:
sptr<DBinderServiceStub> MakeRemoteBinder(const std::u16string &serviceName,
const std::string &deviceID, binder_uintptr_t binderObject, uint64_t pid = 0);
bool RegisterRemoteProxy(std::u16string serviceName, sptr<IRemoteObject> binderObject);
bool RegisterRemoteProxy(std::u16string serviceName, int32_t systemAbilityId);
bool RegisterRemoteProxyInner(std::u16string serviceName, binder_uintptr_t binder);
bool OnRemoteMessageTask(const struct DHandleEntryTxRx *message);
std::shared_ptr<struct SessionInfo> QuerySessionObject(binder_uintptr_t stub);
bool DetachDeathRecipient(sptr<IRemoteObject> object);
......
......@@ -555,9 +555,25 @@ bool DBinderService::RegisterRemoteProxy(std::u16string serviceName, sptr<IRemot
binder_uintptr_t binder = (binder_uintptr_t)binderObject.GetRefPtr();
DBINDER_LOGI("register remote proxy");
return RegisterRemoteProxyInner(serviceName, binder);
}
std::unique_lock<std::shared_mutex> lockGuard(remoteBinderMutex_);
bool DBinderService::RegisterRemoteProxy(std::u16string serviceName, int32_t systemAbilityId)
{
DBINDER_LOGI("register remote proxy, service name = %{public}s", Str16ToStr8(serviceName).c_str());
if (serviceName.length() == 0 || systemAbilityId <= 0) {
DBINDER_LOGE("serviceName.length() = %zu", serviceName.length());
return false;
}
binder_uintptr_t binder = (binder_uintptr_t)systemAbilityId;
return RegisterRemoteProxyInner(serviceName, binder);
}
bool DBinderService::RegisterRemoteProxyInner(std::u16string serviceName, binder_uintptr_t binder)
{
std::unique_lock<std::shared_mutex> lockGuard(remoteBinderMutex_);
// clear historical remnants, Don't care if it succeeds
(void)mapRemoteBinderObjects_.erase(serviceName);
auto result = mapRemoteBinderObjects_.insert(std::pair<std::u16string, binder_uintptr_t>(serviceName, binder));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册