mirror of
https://github.com/openharmony/device_manager.git
synced 2026-07-19 18:13:32 -04:00
@@ -74,6 +74,7 @@ enum {
|
||||
ERR_DM_AUTH_NOT_START = -20026,
|
||||
ERR_DM_AUTH_MESSAGE_INCOMPLETE = -20027,
|
||||
ERR_DM_CREATE_GROUP_FAILED = -20028,
|
||||
ERR_DM_IPC_READ_TOKEN_FAILED = -20029,
|
||||
};
|
||||
|
||||
const std::string TARGET_PKG_NAME_KEY = "targetPkgName";
|
||||
|
||||
@@ -29,7 +29,7 @@ int32_t IpcClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa
|
||||
auto remoteDescriptor = data.ReadInterfaceToken();
|
||||
if (GetDescriptor() != remoteDescriptor) {
|
||||
LOGI("ReadInterfaceToken fail!");
|
||||
return ERR_INVALID_STATE;
|
||||
return ERR_DM_IPC_READ_TOKEN_FAILED;
|
||||
}
|
||||
|
||||
if (IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply) == DM_OK) {
|
||||
|
||||
@@ -84,7 +84,7 @@ int32_t IpcServerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa
|
||||
auto remoteDescriptor = data.ReadInterfaceToken();
|
||||
if (GetDescriptor() != remoteDescriptor) {
|
||||
LOGI("ReadInterfaceToken fail!");
|
||||
return ERR_INVALID_STATE;
|
||||
return ERR_DM_IPC_READ_TOKEN_FAILED;
|
||||
}
|
||||
|
||||
int32_t ret = IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply);
|
||||
|
||||
@@ -87,7 +87,7 @@ HWTEST_F(IpcClientStubTest, OnRemoteRequest_001, testing::ext::TestSize.Level0)
|
||||
* set MessageParcel not null
|
||||
* 2. set set code is SERVER_DEVICE_FA_NOTIFY
|
||||
* 3. call IpcClientStub OnRemoteRequest with parameter
|
||||
* 4. check result is ERR_INVALID_STATE
|
||||
* 4. check result is ERR_DM_IPC_READ_TOKEN_FAILED
|
||||
* @tc.type: FUNC
|
||||
* @tc.require: AR000GHSJK
|
||||
*/
|
||||
@@ -104,8 +104,8 @@ HWTEST_F(IpcClientStubTest, OnRemoteRequest_002, testing::ext::TestSize.Level0)
|
||||
sptr<IpcClientStub> instance = new IpcClientStub();
|
||||
// 3. call IpcClientStub OnRemoteRequest with parameter
|
||||
int ret = instance->OnRemoteRequest(code, data, reply, option);
|
||||
// 4. check result is ERR_INVALID_STATE
|
||||
ASSERT_EQ(ret, ERR_INVALID_STATE);
|
||||
// 4. check result is ERR_DM_IPC_READ_TOKEN_FAILED
|
||||
ASSERT_EQ(ret, ERR_DM_IPC_READ_TOKEN_FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -168,8 +168,8 @@ HWTEST_F(IpcServerStubTest, OnRemoteRequest_002, testing::ext::TestSize.Level0)
|
||||
int ret = 0;
|
||||
// 2. Call IpcServerStub OnRemoteRequest with param
|
||||
ret = IpcServerStub::GetInstance().OnRemoteRequest(code, data, reply, option);
|
||||
// 3. check ret not ERR_INVALID_STATE
|
||||
ASSERT_EQ(ret, ERR_INVALID_STATE);
|
||||
// 3. check ret not ERR_DM_IPC_READ_TOKEN_FAILED
|
||||
ASSERT_EQ(ret, ERR_DM_IPC_READ_TOKEN_FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user