!460 内源问题修改-公有函数增加函数头注释

Merge pull request !460 from 王移波/master
This commit is contained in:
openharmony_ci
2022-04-07 06:43:41 +00:00
committed by Gitee
12 changed files with 357 additions and 14 deletions
@@ -25,21 +25,38 @@ class IpcNotifyDeviceStateReq : public IpcReq {
DECLARE_IPC_MODEL(IpcNotifyDeviceStateReq);
public:
/**
* @tc.name: IpcNotifyDeviceStateReq::GetDeviceState
* @tc.desc: Ipc notification device status request Get Device State
* @tc.type: FUNC
*/
int32_t GetDeviceState() const
{
return deviceState_;
}
/**
* @tc.name: IpcNotifyDeviceStateReq::SetDeviceState
* @tc.desc: Ipc notification device status request Set Device State
* @tc.type: FUNC
*/
void SetDeviceState(int32_t deviceState)
{
deviceState_ = deviceState;
}
/**
* @tc.name: IpcNotifyDeviceStateReq::GetDeviceInfo
* @tc.desc: Ipc notification device status request Get Device Info
* @tc.type: FUNC
*/
const DmDeviceInfo &GetDeviceInfo() const
{
return dmDeviceInfo_;
}
/**
* @tc.name: IpcNotifyDeviceStateReq::SetDeviceInfo
* @tc.desc: Ipc notification device status request Set Device Info
* @tc.type: FUNC
*/
void SetDeviceInfo(const DmDeviceInfo &dmDeviceInfo)
{
dmDeviceInfo_ = dmDeviceInfo;
+21 -1
View File
@@ -25,9 +25,29 @@ namespace OHOS {
namespace DistributedHardware {
class PinAuthUi {
public:
/**
* @tc.name: PinAuthUi::PinAuthUi
* @tc.desc: AuthUi constructor
* @tc.type: FUNC
*/
PinAuthUi();
/**
* @tc.name: PinAuthUi::ShowPinDialog
* @tc.desc: Show Pin Dialog
* @tc.type: FUNC
*/
int32_t ShowPinDialog(int32_t code, std::shared_ptr<DmAuthManager> authManager);
/**
* @tc.name: PinAuthUi::InputPinDialog
* @tc.desc: Show Input PinDialog
* @tc.type: FUNC
*/
int32_t InputPinDialog(int32_t code, std::shared_ptr<DmAuthManager> authManager);
/**
* @tc.name: PinAuthUi::ClosePage
* @tc.desc: Close Page
* @tc.type: FUNC
*/
int32_t ClosePage(const int32_t &pageId, std::shared_ptr<DmAuthManager> authManager);
private:
@@ -35,4 +55,4 @@ private:
};
} // namespace DistributedHardware
} // namespace OHOS
#endif // OHOS_DM_PIN_AUTH_UI_H
#endif // OHOS_DM_PIN_AUTH_UI_H
@@ -31,30 +31,125 @@ public:
static DeviceManager &GetInstance();
public:
/**
* @tc.name: DeviceManagerImpl::InitDeviceManager
* @tc.desc: Initialize DeviceManager
* @tc.type: FUNC
*/
virtual int32_t InitDeviceManager(const std::string &pkgName, std::shared_ptr<DmInitCallback> dmInitCallback) = 0;
/**
* @tc.name: DeviceManagerImpl::UnInitDeviceManager
* @tc.desc: UnInitialize DeviceManager
* @tc.type: FUNC
*/
virtual int32_t UnInitDeviceManager(const std::string &pkgName) = 0;
/**
* @tc.name: DeviceManagerImpl::GetTrustedDeviceList
* @tc.desc: Get device list of trusted devices
* @tc.type: FUNC
*/
virtual int32_t GetTrustedDeviceList(const std::string &pkgName, const std::string &extra,
std::vector<DmDeviceInfo> &deviceList) = 0;
/**
* @tc.name: DeviceManagerImpl::GetLocalDeviceInfo
* @tc.desc: Get local device information
* @tc.type: FUNC
*/
virtual int32_t GetLocalDeviceInfo(const std::string &pkgName, DmDeviceInfo &deviceInfo) = 0;
/**
* @tc.name: DeviceManagerImpl::RegisterDevStateCallback
* @tc.desc: Register device development status callback
* @tc.type: FUNC
*/
virtual int32_t RegisterDevStateCallback(const std::string &pkgName, const std::string &extra,
std::shared_ptr<DeviceStateCallback> callback) = 0;
/**
* @tc.name: DeviceManagerImpl::UnRegisterDevStateCallback
* @tc.desc: UnRegister device development status callback
* @tc.type: FUNC
*/
virtual int32_t UnRegisterDevStateCallback(const std::string &pkgName) = 0;
/**
* @tc.name: DeviceManagerImpl::StartDeviceDiscovery
* @tc.desc: Initiate device discovery
* @tc.type: FUNC
*/
virtual int32_t StartDeviceDiscovery(const std::string &pkgName, const DmSubscribeInfo &subscribeInfo,
const std::string &extra, std::shared_ptr<DiscoveryCallback> callback) = 0;
/**
* @tc.name: DeviceManagerImpl::StopDeviceDiscovery
* @tc.desc: Stop device discovery
* @tc.type: FUNC
*/
virtual int32_t StopDeviceDiscovery(const std::string &pkgName, uint16_t subscribeId) = 0;
/**
* @tc.name: DeviceManagerImpl::AuthenticateDevice
* @tc.desc: Complete verifying the device
* @tc.type: FUNC
*/
virtual int32_t AuthenticateDevice(const std::string &pkgName, int32_t authType, const DmDeviceInfo &deviceInfo,
const std::string &extra, std::shared_ptr<AuthenticateCallback> callback) = 0;
/**
* @tc.name: DeviceManagerImpl::UnAuthenticateDevice
* @tc.desc: Cancel complete verification of device
* @tc.type: FUNC
*/
virtual int32_t UnAuthenticateDevice(const std::string &pkgName, const std::string &deviceId) = 0;
/**
* @tc.name: DeviceManagerImpl::VerifyAuthentication
* @tc.desc: Verify device authentication
* @tc.type: FUNC
*/
virtual int32_t VerifyAuthentication(const std::string &pkgName, const std::string &authPara,
std::shared_ptr<VerifyAuthCallback> callback) = 0;
/**
* @tc.name: DeviceManagerImpl::RegisterDeviceManagerFaCallback
* @tc.desc: Register Fa callback for device manager
* @tc.type: FUNC
*/
virtual int32_t RegisterDeviceManagerFaCallback(const std::string &pkgName,
std::shared_ptr<DeviceManagerFaCallback> callback) = 0;
/**
* @tc.name: DeviceManagerImpl::UnRegisterDeviceManagerFaCallback
* @tc.desc: Unregister Fa callback for device manager
* @tc.type: FUNC
*/
virtual int32_t UnRegisterDeviceManagerFaCallback(const std::string &pkgName) = 0;
/**
* @tc.name: DeviceManagerImpl::GetFaParam
* @tc.desc: Get Fa Param
* @tc.type: FUNC
*/
virtual int32_t GetFaParam(const std::string &pkgName, DmAuthParam &faParam) = 0;
/**
* @tc.name: DeviceManagerImpl::SetUserOperation
* @tc.desc: Set User Actions
* @tc.type: FUNC
*/
virtual int32_t SetUserOperation(const std::string &pkgName, int32_t action) = 0;
/**
* @tc.name: DeviceManagerImpl::GetUdidByNetworkId
* @tc.desc: Get Udid by NetworkId
* @tc.type: FUNC
*/
virtual int32_t GetUdidByNetworkId(const std::string &pkgName, const std::string &netWorkId, std::string &udid) = 0;
/**
* @tc.name: DeviceManagerImpl::GetUuidByNetworkId
* @tc.desc: Get Uuid by NetworkId
* @tc.type: FUNC
*/
virtual int32_t GetUuidByNetworkId(const std::string &pkgName, const std::string &netWorkId, std::string &uuid) = 0;
/**
* @tc.name: DeviceManagerImpl::RegisterDevStateCallback
* @tc.desc: Register development status callback
* @tc.type: FUNC
*/
virtual int32_t RegisterDevStateCallback(const std::string &pkgName, const std::string &extra) = 0;
/**
* @tc.name: DeviceManagerImpl::UnRegisterDevStateCallback
* @tc.desc: Unregister development status callback
* @tc.type: FUNC
*/
virtual int32_t UnRegisterDevStateCallback(const std::string &pkgName, const std::string &extra) = 0;
};
} // namespace DistributedHardware
@@ -29,35 +29,130 @@ public:
static DeviceManagerImpl &GetInstance();
public:
/**
* @tc.name: DeviceManagerImpl::InitDeviceManager
* @tc.desc: Initialize DeviceManager
* @tc.type: FUNC
*/
virtual int32_t InitDeviceManager(const std::string &pkgName,
std::shared_ptr<DmInitCallback> dmInitCallback) override;
/**
* @tc.name: DeviceManagerImpl::UnInitDeviceManager
* @tc.desc: UnInitialize DeviceManager
* @tc.type: FUNC
*/
virtual int32_t UnInitDeviceManager(const std::string &pkgName) override;
/**
* @tc.name: DeviceManagerImpl::GetTrustedDeviceList
* @tc.desc: Get device list of trusted devices
* @tc.type: FUNC
*/
virtual int32_t GetTrustedDeviceList(const std::string &pkgName, const std::string &extra,
std::vector<DmDeviceInfo> &deviceList) override;
/**
* @tc.name: DeviceManagerImpl::GetLocalDeviceInfo
* @tc.desc: Get local device information
* @tc.type: FUNC
*/
virtual int32_t GetLocalDeviceInfo(const std::string &pkgName, DmDeviceInfo &deviceInfo) override;
/**
* @tc.name: DeviceManagerImpl::RegisterDevStateCallback
* @tc.desc: Register device development status callback
* @tc.type: FUNC
*/
virtual int32_t RegisterDevStateCallback(const std::string &pkgName, const std::string &extra,
std::shared_ptr<DeviceStateCallback> callback) override;
/**
* @tc.name: DeviceManagerImpl::UnRegisterDevStateCallback
* @tc.desc: UnRegister device development status callback
* @tc.type: FUNC
*/
virtual int32_t UnRegisterDevStateCallback(const std::string &pkgName) override;
/**
* @tc.name: DeviceManagerImpl::StartDeviceDiscovery
* @tc.desc: Initiate device discovery
* @tc.type: FUNC
*/
virtual int32_t StartDeviceDiscovery(const std::string &pkgName, const DmSubscribeInfo &subscribeInfo,
const std::string &extra,
std::shared_ptr<DiscoveryCallback> callback) override;
/**
* @tc.name: DeviceManagerImpl::StopDeviceDiscovery
* @tc.desc: Stop device discovery
* @tc.type: FUNC
*/
virtual int32_t StopDeviceDiscovery(const std::string &pkgName, uint16_t subscribeId) override;
/**
* @tc.name: DeviceManagerImpl::AuthenticateDevice
* @tc.desc: Complete verifying the device
* @tc.type: FUNC
*/
virtual int32_t AuthenticateDevice(const std::string &pkgName, int32_t authType, const DmDeviceInfo &deviceInfo,
const std::string &extra,
std::shared_ptr<AuthenticateCallback> callback) override;
/**
* @tc.name: DeviceManagerImpl::UnAuthenticateDevice
* @tc.desc: Cancel complete verification of device
* @tc.type: FUNC
*/
virtual int32_t UnAuthenticateDevice(const std::string &pkgName, const std::string &deviceId) override;
/**
* @tc.name: DeviceManagerImpl::VerifyAuthentication
* @tc.desc: Verify device authentication
* @tc.type: FUNC
*/
virtual int32_t VerifyAuthentication(const std::string &pkgName, const std::string &authPara,
std::shared_ptr<VerifyAuthCallback> callback) override;
/**
* @tc.name: DeviceManagerImpl::RegisterDeviceManagerFaCallback
* @tc.desc: Register Fa callback for device manager
* @tc.type: FUNC
*/
virtual int32_t RegisterDeviceManagerFaCallback(const std::string &packageName,
std::shared_ptr<DeviceManagerFaCallback> callback) override;
/**
* @tc.name: DeviceManagerImpl::UnRegisterDeviceManagerFaCallback
* @tc.desc: Unregister Fa callback for device manager
* @tc.type: FUNC
*/
virtual int32_t UnRegisterDeviceManagerFaCallback(const std::string &pkgName) override;
/**
* @tc.name: DeviceManagerImpl::GetFaParam
* @tc.desc: Get Fa Param
* @tc.type: FUNC
*/
virtual int32_t GetFaParam(const std::string &pkgName, DmAuthParam &faParam) override;
/**
* @tc.name: DeviceManagerImpl::SetUserOperation
* @tc.desc: Set User Actions
* @tc.type: FUNC
*/
virtual int32_t SetUserOperation(const std::string &pkgName, int32_t action) override;
/**
* @tc.name: DeviceManagerImpl::GetUdidByNetworkId
* @tc.desc: Get Udid by NetworkId
* @tc.type: FUNC
*/
virtual int32_t GetUdidByNetworkId(const std::string &pkgName, const std::string &netWorkId,
std::string &udid) override;
/**
* @tc.name: DeviceManagerImpl::GetUuidByNetworkId
* @tc.desc: Get Uuid by NetworkId
* @tc.type: FUNC
*/
virtual int32_t GetUuidByNetworkId(const std::string &pkgName, const std::string &netWorkId,
std::string &uuid) override;
/**
* @tc.name: DeviceManagerImpl::RegisterDevStateCallback
* @tc.desc: Register development status callback
* @tc.type: FUNC
*/
virtual int32_t RegisterDevStateCallback(const std::string &pkgName, const std::string &extra) override;
/**
* @tc.name: DeviceManagerImpl::UnRegisterDevStateCallback
* @tc.desc: Unregister development status callback
* @tc.type: FUNC
*/
virtual int32_t UnRegisterDevStateCallback(const std::string &pkgName, const std::string &extra) override;
private:
@@ -25,21 +25,38 @@ namespace DistributedHardware {
class DmAppImageInfo {
public:
DmAppImageInfo() = default;
/**
* @tc.name: DmAppImageInfo::DmAppImageInfo
* @tc.desc: Dm App Image Info Save Data
* @tc.type: FUNC
*/
explicit DmAppImageInfo(uint8_t *appIcon_, int32_t appIconLen_, uint8_t *appThumbnail_, int32_t appThumbnailLen_)
{
SaveData(appIcon_, appIconLen_, appThumbnail_, appThumbnailLen_);
}
/**
* @tc.name: DmAppImageInfo::Reset
* @tc.desc: Dm App Image Info Reset
* @tc.type: FUNC
*/
void Reset(uint8_t *appIcon_, int32_t appIconLen_, uint8_t *appThumbnail_, int32_t appThumbnailLen_)
{
SaveData(appIcon_, appIconLen_, appThumbnail_, appThumbnailLen_);
}
/**
* @tc.name: DmAppImageInfo::ResetIcon
* @tc.desc: Dm App Image Info ResetIcon
* @tc.type: FUNC
*/
void ResetIcon(uint8_t *appIcon_, int32_t appIconLen_)
{
SaveIconData(appIcon_, appIconLen_);
}
/**
* @tc.name: DmAppImageInfo::InitThumbnail
* @tc.desc: Dm App Image Info Init Thumbnail
* @tc.type: FUNC
*/
void InitThumbnail(int32_t appThumbnailLen_)
{
if (appThumbnailLen_ <= 0 || appThumbnailLen_ > THUMB_MAX_LEN) {
@@ -53,7 +70,11 @@ public:
appThumbnailLen = appThumbnailLen_;
}
}
/**
* @tc.name: DmAppImageInfo::SetThumbnailData
* @tc.desc: Dm App Image Info Init Set Data of Thumbnail
* @tc.type: FUNC
*/
int32_t SetThumbnailData(uint8_t *srcBuffer, int32_t srcBufferLen, int32_t copyIndex, int32_t copyLen)
{
if (srcBuffer == nullptr || srcBufferLen <= 0 || copyLen > srcBufferLen || copyIndex < 0) {
@@ -74,7 +95,11 @@ public:
return 0;
}
/**
* @tc.name: DmAppImageInfo::~DmAppImageInfo
* @tc.desc: Dm App Image Info destructor
* @tc.type: FUNC
*/
~DmAppImageInfo()
{
if (appIcon != nullptr) {
@@ -86,7 +111,11 @@ public:
appThumbnail = nullptr;
}
}
/**
* @tc.name: DmAppImageInfo::DmAppImageInfo
* @tc.desc: Dm App Image Info Constructor
* @tc.type: FUNC
*/
DmAppImageInfo(const DmAppImageInfo &other)
{
if (this != &other) {
@@ -104,7 +133,11 @@ public:
DmAppImageInfo(DmAppImageInfo &&) = delete;
DmAppImageInfo &operator=(DmAppImageInfo &&) = delete;
/**
* @tc.name: DmAppImageInfo::GetAppIconLen
* @tc.desc: Dm App Image Info Get App Icon Len
* @tc.type: FUNC
*/
int32_t GetAppIconLen() const
{
return appIconLen;
@@ -114,12 +147,20 @@ public:
{
return appIcon;
}
/**
* @tc.name: DmAppImageInfo::GetAppThumbnailLen
* @tc.desc: Dm App Image Info Get App ThumbnailLen
* @tc.type: FUNC
*/
int32_t GetAppThumbnailLen() const
{
return appThumbnailLen;
}
/**
* @tc.name: DmAppImageInfo::GetAppThumbnail
* @tc.desc: Dm App Image Info Get App Thumbnail
* @tc.type: FUNC
*/
const uint8_t *GetAppThumbnail() const
{
return appThumbnail;
@@ -32,8 +32,23 @@ public:
explicit IpcClientProxy(std::shared_ptr<IpcClient> ipcClientManager) : ipcClientManager_(ipcClientManager) {};
public:
/**
* @tc.name: IpcClientProxy::Init
* @tc.desc: ipc client initialization
* @tc.type: FUNC
*/
virtual int32_t Init(const std::string &pkgName);
/**
* @tc.name: IpcClientProxy::UnInit
* @tc.desc: ipc client deinitialization
* @tc.type: FUNC
*/
virtual int32_t UnInit(const std::string &pkgName);
/**
* @tc.name: IpcClientProxy::SendRequest
* @tc.desc: ipc client Send Request
* @tc.type: FUNC
*/
virtual int32_t SendRequest(int32_t cmdCode, std::shared_ptr<IpcReq> req, std::shared_ptr<IpcRsp> rsp);
private:
@@ -29,8 +29,23 @@ class IpcClientManager : public IpcClient {
DECLARE_IPC_INTERFACE(IpcClientManager);
public:
/**
* @tc.name: IpcClientManager::Init
* @tc.desc: ipc client Manager initialization
* @tc.type: FUNC
*/
virtual int32_t Init(const std::string &pkgName) override;
/**
* @tc.name: IpcClientManager::Init
* @tc.desc: ipc client Manager Uninitialization
* @tc.type: FUNC
*/
virtual int32_t UnInit(const std::string &pkgName) override;
/**
* @tc.name: IpcClientManager::Init
* @tc.desc: ipc client Manager Send Request
* @tc.type: FUNC
*/
virtual int32_t SendRequest(int32_t cmdCode, std::shared_ptr<IpcReq> req, std::shared_ptr<IpcRsp> rsp) override;
private:
@@ -28,6 +28,11 @@ class IpcClientStub {
DECLARE_SINGLE_INSTANCE(IpcClientStub);
public:
/**
* @tc.name: IpcClientStub::Init
* @tc.desc: Ipc client stub initialization
* @tc.type: FUNC
*/
int32_t Init();
SvcIdentity GetSvcIdentity() const
{
@@ -31,6 +31,11 @@ namespace OHOS {
namespace DistributedHardware {
class DmDeathRecipient : public IRemoteObject::DeathRecipient {
public:
/**
* @tc.name: DmDeathRecipient::OnRemoteDied
* @tc.desc: ipc client initialization
* @tc.type: FUNC
*/
void OnRemoteDied(const wptr<IRemoteObject> &remote) override;
DmDeathRecipient() = default;
~DmDeathRecipient() = default;
@@ -41,8 +46,23 @@ class IpcClientManager : public IpcClient {
DECLARE_IPC_INTERFACE(IpcClientManager);
public:
/**
* @tc.name: IpcClientManager::Init
* @tc.desc: ipc client Manager initialization
* @tc.type: FUNC
*/
virtual int32_t Init(const std::string &pkgName) override;
/**
* @tc.name: IpcClientManager::UnInit
* @tc.desc: ipc client Manager Uninitialization
* @tc.type: FUNC
*/
virtual int32_t UnInit(const std::string &pkgName) override;
/**
* @tc.name: IpcClientManager::SendRequest
* @tc.desc: ipc client Manager Send Request
* @tc.type: FUNC
*/
virtual int32_t SendRequest(int32_t cmdCode, std::shared_ptr<IpcReq> req, std::shared_ptr<IpcRsp> rsp) override;
private:
@@ -31,7 +31,17 @@ class IpcClientStub : public IRemoteStub<IpcRemoteBroker> {
public:
IpcClientStub() {};
~IpcClientStub() {};
/**
* @tc.name: IpcClientStub::OnRemoteRequest
* @tc.desc: Ipc Client Stub remote request
* @tc.type: FUNC
*/
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
/**
* @tc.name: IpcClientStub::SendCmd
* @tc.desc: Ipc Client Stub Send command
* @tc.type: FUNC
*/
int32_t SendCmd(int32_t cmdCode, std::shared_ptr<IpcReq> req, std::shared_ptr<IpcRsp> rsp) override;
};
} // namespace DistributedHardware
@@ -54,7 +54,7 @@ void ShowConfirm::ShowConfirmDialog(const std::string &params, std::shared_ptr<D
} else {
Ace::UIServiceMgrClient::GetInstance()->CancelDialog(id);
LOGI("CancelDialog start id:%d,event:%s,parms:%s", id, event.c_str(), params.c_str());
authManager->StartAuthProcess(atoi(params.c_str()));
authManager->StartAuthProcess(std::stoi(params));
}
});
LOGI("ShowConfirm ace end");
+10
View File
@@ -29,7 +29,17 @@ public:
virtual ~IpcServerListener() = default;
public:
/**
* @tc.name: IpcServerListener::SendRequest
* @tc.desc: Ipc server listener Send Request
* @tc.type: FUNC
*/
int32_t SendRequest(int32_t cmdCode, std::shared_ptr<IpcReq> req, std::shared_ptr<IpcRsp> rsp);
/**
* @tc.name: IpcServerListener::SendAll
* @tc.desc: Ipc server listener send messages
* @tc.type: FUNC
*/
int32_t SendAll(int32_t cmdCode, std::shared_ptr<IpcReq> req, std::shared_ptr<IpcRsp> rsp);
std::shared_ptr<IpcReq> req_;
};