提交 76c5f065 编写于 作者: Q qianli

Get SA

Change-Id: I2bbe9e38da921faffa8c7fc50343f39c0c725a65
上级 483c66de
......@@ -104,6 +104,7 @@ 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 OnRemoteMessageTask(const struct DHandleEntryTxRx *message);
std::shared_ptr<struct SessionInfo> QuerySessionObject(binder_uintptr_t stub);
bool DetachDeathRecipient(sptr<IRemoteObject> object);
......
......@@ -564,6 +564,26 @@ bool DBinderService::RegisterRemoteProxy(std::u16string serviceName, sptr<IRemot
return result.second;
}
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) {
DBINDER_LOGE("serviceName.length() = %zu", serviceName.length());
return false;
}
binder_uintptr_t binder = (binder_uintptr_t)systemAbilityId;
DBINDER_LOGI("register remote proxy");
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));
return result.second;
}
bool DBinderService::OnRemoteMessageTask(const struct DHandleEntryTxRx *message)
{
if (message == nullptr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册