mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-27 00:20:44 +00:00
!1124 多用户需求:RegisterOnListener相关接口修改
Merge pull request !1124 from 韦国庆/master
This commit is contained in:
commit
597c3be32c
@ -121,11 +121,11 @@ public:
|
||||
virtual int32_t StopSyncRemoteMissions(const std::string& devId) = 0;
|
||||
virtual int32_t StopSyncMissionsFromRemote(const CallerInfo& callerInfo) = 0;
|
||||
virtual int32_t RegisterMissionListener(const std::u16string& devId, const sptr<IRemoteObject>& obj) = 0;
|
||||
virtual int32_t RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj)
|
||||
virtual int32_t RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj, int32_t callingUid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual int32_t RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj)
|
||||
virtual int32_t RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj, int32_t callingUid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -62,8 +62,8 @@ public:
|
||||
int32_t RegisterMissionListener(const std::u16string& devId, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterDSchedEventListener(const DSchedEventType& type, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t UnRegisterDSchedEventListener(const DSchedEventType& type, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj, int32_t callingUid) override;
|
||||
int32_t RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj, int32_t callingUid) override;
|
||||
int32_t UnRegisterMissionListener(const std::u16string& devId, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t GetMissionInfos(const std::string& deviceId, int32_t numMissions,
|
||||
std::vector<AAFwk::MissionInfo>& missionInfos) override;
|
||||
|
@ -157,8 +157,8 @@ public:
|
||||
int32_t StopSyncRemoteMissions(const std::string& devId) override;
|
||||
int32_t StopSyncMissionsFromRemote(const CallerInfo& callerInfo) override;
|
||||
int32_t RegisterMissionListener(const std::u16string& devId, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj, int32_t callingUid) override;
|
||||
int32_t RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj, int32_t callingUid) override;
|
||||
int32_t UnRegisterMissionListener(const std::u16string& devId, const sptr<IRemoteObject>& obj) override;
|
||||
int32_t SetMissionContinueState(int32_t missionId, const AAFwk::ContinueState &state) override;
|
||||
void OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override;
|
||||
|
@ -561,7 +561,8 @@ int32_t DistributedSchedProxy::UnRegisterDSchedEventListener(const DSchedEventTy
|
||||
data, reply);
|
||||
}
|
||||
|
||||
int32_t DistributedSchedProxy::RegisterOnListener(const std::string& type, const sptr<IRemoteObject>& obj)
|
||||
int32_t DistributedSchedProxy::RegisterOnListener(const std::string& type,
|
||||
const sptr<IRemoteObject>& obj, int32_t callingUid)
|
||||
{
|
||||
HILOGI("RegisterOnListener called");
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
@ -576,11 +577,13 @@ int32_t DistributedSchedProxy::RegisterOnListener(const std::string& type, const
|
||||
}
|
||||
PARCEL_WRITE_HELPER(data, String, type);
|
||||
PARCEL_WRITE_HELPER(data, RemoteObject, obj);
|
||||
PARCEL_WRITE_HELPER(data, Int32, callingUid);
|
||||
PARCEL_TRANSACT_SYNC_RET_INT(remote, static_cast<uint32_t>(IDSchedInterfaceCode::REGISTER_ON_LISTENER),
|
||||
data, reply);
|
||||
}
|
||||
|
||||
int32_t DistributedSchedProxy::RegisterOffListener(const std::string& type, const sptr<IRemoteObject>& obj)
|
||||
int32_t DistributedSchedProxy::RegisterOffListener(const std::string& type,
|
||||
const sptr<IRemoteObject>& obj, int32_t callingUid)
|
||||
{
|
||||
HILOGI("RegisterOffListener called");
|
||||
sptr<IRemoteObject> remote = Remote();
|
||||
@ -595,6 +598,7 @@ int32_t DistributedSchedProxy::RegisterOffListener(const std::string& type, cons
|
||||
}
|
||||
PARCEL_WRITE_HELPER(data, String, type);
|
||||
PARCEL_WRITE_HELPER(data, RemoteObject, obj);
|
||||
PARCEL_WRITE_HELPER(data, Int32, callingUid);
|
||||
PARCEL_TRANSACT_SYNC_RET_INT(remote, static_cast<uint32_t>(IDSchedInterfaceCode::REGISTER_OFF_LISTENER),
|
||||
data, reply);
|
||||
}
|
||||
|
@ -2845,13 +2845,13 @@ int32_t DistributedSchedService::RegisterMissionListener(const std::u16string& d
|
||||
}
|
||||
|
||||
int32_t DistributedSchedService::RegisterOnListener(const std::string& type,
|
||||
const sptr<IRemoteObject>& obj)
|
||||
const sptr<IRemoteObject>& obj, int32_t callingUid)
|
||||
{
|
||||
return DMSContinueRecvMgr::GetInstance().RegisterOnListener(type, obj);
|
||||
}
|
||||
|
||||
int32_t DistributedSchedService::RegisterOffListener(const std::string& type,
|
||||
const sptr<IRemoteObject>& obj)
|
||||
const sptr<IRemoteObject>& obj, int32_t callingUid)
|
||||
{
|
||||
return DMSContinueRecvMgr::GetInstance().RegisterOffListener(type, obj);
|
||||
}
|
||||
|
@ -1089,7 +1089,12 @@ int32_t DistributedSchedStub::RegisterOnListenerInner(MessageParcel& data, Messa
|
||||
HILOGW("read IRemoteObject failed!");
|
||||
return ERR_FLATTEN_OBJECT;
|
||||
}
|
||||
int32_t result = RegisterOnListener(type, onListener);
|
||||
int32_t callingUid = data.ReadInt32();
|
||||
if (callingUid < 0) {
|
||||
HILOGW("read callingUid failed!");
|
||||
return ERR_FLATTEN_OBJECT;
|
||||
}
|
||||
int32_t result = RegisterOnListener(type, onListener, callingUid);
|
||||
PARCEL_WRITE_REPLY_NOERROR(reply, Int32, result);
|
||||
}
|
||||
|
||||
@ -1109,7 +1114,12 @@ int32_t DistributedSchedStub::RegisterOffListenerInner(MessageParcel& data, Mess
|
||||
HILOGW("read IRemoteObject failed!");
|
||||
return ERR_FLATTEN_OBJECT;
|
||||
}
|
||||
int32_t result = RegisterOffListener(type, onListener);
|
||||
int32_t callingUid = data.ReadInt32();
|
||||
if (callingUid < 0) {
|
||||
HILOGW("read callingUid failed!");
|
||||
return ERR_FLATTEN_OBJECT;
|
||||
}
|
||||
int32_t result = RegisterOffListener(type, onListener, callingUid);
|
||||
PARCEL_WRITE_REPLY_NOERROR(reply, Int32, result);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user