Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
3f35b011
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
大约 1 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3f35b011
编写于
7月 11, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 11, 2023
浏览文件
操作
浏览文件
下载
差异文件
!2111 启动恢复子系统IPC接口管控
Merge pull request !2111 from zhaohaoran09/master
上级
c677a16c
d7af2960
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
110 addition
and
39 deletion
+110
-39
CODEOWNERS
CODEOWNERS
+16
-0
device_info/device_info_proxy.cpp
device_info/device_info_proxy.cpp
+3
-2
device_info/device_info_stub.cpp
device_info/device_info_stub.cpp
+3
-2
device_info/deviceinfoservice_ipc_interface_code.h
device_info/deviceinfoservice_ipc_interface_code.h
+29
-0
device_info/idevice_info.h
device_info/idevice_info.h
+0
-2
services/param/watcher/agent/watcher_manager_proxy.cpp
services/param/watcher/agent/watcher_manager_proxy.cpp
+5
-5
services/param/watcher/include/iwatcher_manager.h
services/param/watcher/include/iwatcher_manager.h
+1
-8
services/param/watcher/include/param_watcher_ipc_interface_code.h
.../param/watcher/include/param_watcher_ipc_interface_code.h
+32
-0
services/param/watcher/proxy/watcher_manager_stub.cpp
services/param/watcher/proxy/watcher_manager_stub.cpp
+5
-5
test/unittest/deviceinfo/DeviceInfoUnittest.cpp
test/unittest/deviceinfo/DeviceInfoUnittest.cpp
+9
-8
test/unittest/param/watcher_proxy_unittest.cpp
test/unittest/param/watcher_proxy_unittest.cpp
+7
-7
未找到文件。
CODEOWNERS
0 → 100644
浏览文件 @
3f35b011
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# any change to tools/ui_appearance_ipc_interface_code.h needs to be reviewed by @leonchan5
base/startup/init/device_info/deviceinfoservice_ipc_interface_code.h @leonchan5
base/startup/init/services/param/watcher/include/param_watcher_ipc_interface_code.h @leonchan5
\ No newline at end of file
device_info/device_info_proxy.cpp
浏览文件 @
3f35b011
...
...
@@ -19,6 +19,7 @@
#include "parcel.h"
#include "string_ex.h"
#include "sysparam_errno.h"
#include "deviceinfoservice_ipc_interface_code.h"
namespace
OHOS
{
namespace
device_info
{
...
...
@@ -43,7 +44,7 @@ int32_t DeviceInfoProxy::GetUdid(std::string& result)
MessageParcel
reply
;
MessageOption
option
{
MessageOption
::
TF_SYNC
};
data
.
WriteInterfaceToken
(
DeviceInfoProxy
::
GetDescriptor
());
int32_t
ret
=
DeviceInfoSendRequest
(
COMMAND_GET_UDID
,
data
,
reply
,
option
);
int32_t
ret
=
DeviceInfoSendRequest
(
static_cast
<
uint32_t
>
(
DeviceInfoInterfaceCode
::
COMMAND_GET_UDID
)
,
data
,
reply
,
option
);
DINFO_LOGI
(
"DeviceInfoProxy::GetUdid: %d"
,
ret
);
DINFO_CHECK
(
ret
==
ERR_NONE
,
return
ret
,
"getUdid failed, error code is %d"
,
ret
);
result
=
Str16ToStr8
(
reply
.
ReadString16
());
...
...
@@ -57,7 +58,7 @@ int32_t DeviceInfoProxy::GetSerialID(std::string& result)
MessageOption
option
{
MessageOption
::
TF_SYNC
};
data
.
WriteInterfaceToken
(
DeviceInfoProxy
::
GetDescriptor
());
int32_t
ret
=
DeviceInfoSendRequest
(
COMMAND_GET_SERIAL_ID
,
data
,
reply
,
option
);
int32_t
ret
=
DeviceInfoSendRequest
(
static_cast
<
uint32_t
>
(
DeviceInfoInterfaceCode
::
COMMAND_GET_SERIAL_ID
)
,
data
,
reply
,
option
);
DINFO_LOGI
(
"DeviceInfoProxy::GetSerialID: %d"
,
ret
);
DINFO_CHECK
(
ret
==
ERR_NONE
,
return
ret
,
"GetSerial failed, error code is %d"
,
ret
);
result
=
Str16ToStr8
(
reply
.
ReadString16
());
...
...
device_info/device_info_stub.cpp
浏览文件 @
3f35b011
...
...
@@ -31,6 +31,7 @@
#include "parameter.h"
#include "sysparam_errno.h"
#include "init_utils.h"
#include "deviceinfoservice_ipc_interface_code.h"
namespace
OHOS
{
using
namespace
Security
;
...
...
@@ -80,7 +81,7 @@ int32_t DeviceInfoStub::OnRemoteRequest(uint32_t code,
int
ret
=
ERR_FAIL
;
switch
(
code
)
{
case
COMMAND_GET_UDID
:
{
case
static_cast
<
uint32_t
>
(
DeviceInfoInterfaceCode
::
COMMAND_GET_UDID
)
:
{
if
(
!
CheckPermission
(
data
,
"ohos.permission.sec.ACCESS_UDID"
))
{
return
SYSPARAM_PERMISSION_DENIED
;
}
...
...
@@ -90,7 +91,7 @@ int32_t DeviceInfoStub::OnRemoteRequest(uint32_t code,
reply
.
WriteString16
(
Str8ToStr16
(
localDeviceInfo
));
break
;
}
case
COMMAND_GET_SERIAL_ID
:
{
case
static_cast
<
uint32_t
>
(
DeviceInfoInterfaceCode
::
COMMAND_GET_SERIAL_ID
)
:
{
if
(
!
CheckPermission
(
data
,
"ohos.permission.sec.ACCESS_UDID"
))
{
return
SYSPARAM_PERMISSION_DENIED
;
}
...
...
device_info/deviceinfoservice_ipc_interface_code.h
0 → 100644
浏览文件 @
3f35b011
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DEVICEINFOSERVICE_IPC_INTERFACE_CODE_H
#define DEVICEINFOSERVICE_IPC_INTERFACE_CODE_H
/*SAID: 3902 */
namespace
OHOS
{
namespace
device_info
{
enum
class
DeviceInfoInterfaceCode
{
COMMAND_GET_UDID
=
1
,
COMMAND_GET_SERIAL_ID
=
2
,
};
}
// namespace device_info
}
// namespace OHOS
#endif // DEVICEINFOSERVICE_IPC_INTERFACE_CODE_H
device_info/idevice_info.h
浏览文件 @
3f35b011
...
...
@@ -30,8 +30,6 @@ public:
virtual
int32_t
GetUdid
(
std
::
string
&
result
)
=
0
;
virtual
int32_t
GetSerialID
(
std
::
string
&
result
)
=
0
;
static
constexpr
int
COMMAND_GET_UDID
=
MIN_TRANSACTION_ID
+
0
;
static
constexpr
int
COMMAND_GET_SERIAL_ID
=
MIN_TRANSACTION_ID
+
1
;
static
constexpr
int
ERR_FAIL
=
-
1
;
};
}
// namespace device_info
...
...
services/param/watcher/agent/watcher_manager_proxy.cpp
浏览文件 @
3f35b011
...
...
@@ -29,7 +29,7 @@ uint32_t WatcherManagerProxy::AddRemoteWatcher(uint32_t id, const sptr<IWatcher>
MessageParcel
reply
;
MessageOption
option
{
MessageOption
::
TF_SYNC
};
int32_t
res
=
SendWatcherMsg
(
ADD_REMOTE_AGENT
,
data
,
reply
,
option
);
int32_t
res
=
SendWatcherMsg
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
ADD_REMOTE_AGENT
)
,
data
,
reply
,
option
);
WATCHER_CHECK
(
res
==
ERR_OK
,
return
0
,
"Transact error %d"
,
res
);
return
reply
.
ReadUint32
();
}
...
...
@@ -41,7 +41,7 @@ int32_t WatcherManagerProxy::DelRemoteWatcher(uint32_t remoteWatcherId)
data
.
WriteUint32
(
remoteWatcherId
);
MessageParcel
reply
;
MessageOption
option
{
MessageOption
::
TF_SYNC
};
int32_t
res
=
SendWatcherMsg
(
DEL_REMOTE_AGENT
,
data
,
reply
,
option
);
int32_t
res
=
SendWatcherMsg
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
DEL_REMOTE_AGENT
)
,
data
,
reply
,
option
);
WATCHER_CHECK
(
res
==
ERR_OK
,
return
ERR_FLATTEN_OBJECT
,
"Transact error"
);
return
reply
.
ReadInt32
();
}
...
...
@@ -61,17 +61,17 @@ int32_t WatcherManagerProxy::SendMsg(int op, const std::string &keyPrefix, uint3
int32_t
WatcherManagerProxy
::
AddWatcher
(
const
std
::
string
&
keyPrefix
,
uint32_t
remoteWatcherId
)
{
return
SendMsg
(
ADD_WATCHER
,
keyPrefix
,
remoteWatcherId
);
return
SendMsg
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
ADD_WATCHER
)
,
keyPrefix
,
remoteWatcherId
);
}
int32_t
WatcherManagerProxy
::
DelWatcher
(
const
std
::
string
&
keyPrefix
,
uint32_t
remoteWatcherId
)
{
return
SendMsg
(
DEL_WATCHER
,
keyPrefix
,
remoteWatcherId
);
return
SendMsg
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
DEL_WATCHER
)
,
keyPrefix
,
remoteWatcherId
);
}
int32_t
WatcherManagerProxy
::
RefreshWatcher
(
const
std
::
string
&
keyPrefix
,
uint32_t
remoteWatcherId
)
{
return
SendMsg
(
REFRESH_WATCHER
,
keyPrefix
,
remoteWatcherId
);
return
SendMsg
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
REFRESH_WATCHER
)
,
keyPrefix
,
remoteWatcherId
);
}
int32_t
WatcherManagerProxy
::
SendWatcherMsg
(
uint32_t
code
,
...
...
services/param/watcher/include/iwatcher_manager.h
浏览文件 @
3f35b011
...
...
@@ -20,19 +20,12 @@
#include "iremote_broker.h"
#include "iremote_proxy.h"
#include "iwatcher.h"
#include "param_watcher_ipc_interface_code.h"
namespace
OHOS
{
namespace
init_param
{
class
IWatcherManager
:
public
OHOS
::
IRemoteBroker
{
public:
enum
{
ADD_WATCHER
,
DEL_WATCHER
,
ADD_REMOTE_AGENT
,
DEL_REMOTE_AGENT
,
REFRESH_WATCHER
};
DECLARE_INTERFACE_DESCRIPTOR
(
u"OHOS.Startup.IWatcherManager"
);
public:
virtual
uint32_t
AddRemoteWatcher
(
uint32_t
id
,
const
sptr
<
IWatcher
>
&
watcher
)
=
0
;
...
...
services/param/watcher/include/param_watcher_ipc_interface_code.h
0 → 100644
浏览文件 @
3f35b011
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PARAM_WATCHER_IPC_INTERFACE_CODE_H
#define PARAM_WATCHER_IPC_INTERFACE_CODE_H
/*SAID: 3901 */
namespace
OHOS
{
namespace
init_param
{
enum
class
ParamWatcherInterfaceCode
{
ADD_WATCHER
=
0
,
DEL_WATCHER
,
ADD_REMOTE_AGENT
,
DEL_REMOTE_AGENT
,
REFRESH_WATCHER
};
}
// namespace init_param
}
// namespace OHOS
#endif // PARAM_WATCHER_IPC_INTERFACE_CODE_H
services/param/watcher/proxy/watcher_manager_stub.cpp
浏览文件 @
3f35b011
...
...
@@ -28,19 +28,19 @@ int32_t WatcherManagerStub::OnRemoteRequest(uint32_t code,
WATCHER_LOGV
(
"OnRemoteRequest code %u"
,
code
);
switch
(
code
)
{
case
ADD_WATCHER
:
{
case
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
ADD_WATCHER
)
:
{
std
::
string
key
=
data
.
ReadString
();
int
ret
=
AddWatcher
(
key
,
data
.
ReadUint32
());
reply
.
WriteInt32
(
ret
);
break
;
}
case
DEL_WATCHER
:
{
case
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
DEL_WATCHER
)
:
{
std
::
string
key
=
data
.
ReadString
();
int
ret
=
DelWatcher
(
key
,
data
.
ReadUint32
());
reply
.
WriteInt32
(
ret
);
break
;
}
case
ADD_REMOTE_AGENT
:
{
case
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
ADD_REMOTE_AGENT
)
:
{
auto
remote
=
data
.
ReadRemoteObject
();
// 0 is invalid watcherId
uint32_t
id
=
data
.
ReadUint32
();
...
...
@@ -49,12 +49,12 @@ int32_t WatcherManagerStub::OnRemoteRequest(uint32_t code,
reply
.
WriteUint32
(
remoteWatcherId
);
break
;
}
case
DEL_REMOTE_AGENT
:
{
case
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
DEL_REMOTE_AGENT
)
:
{
int
ret
=
DelRemoteWatcher
(
data
.
ReadUint32
());
reply
.
WriteInt32
(
ret
);
break
;
}
case
REFRESH_WATCHER
:
{
case
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
REFRESH_WATCHER
)
:
{
std
::
string
key
=
data
.
ReadString
();
int
ret
=
RefreshWatcher
(
key
,
data
.
ReadUint32
());
reply
.
WriteInt32
(
ret
);
...
...
test/unittest/deviceinfo/DeviceInfoUnittest.cpp
浏览文件 @
3f35b011
...
...
@@ -31,12 +31,13 @@
#include "idevice_info.h"
#include "device_info_stub.h"
#include "sysparam_errno.h"
#include "deviceinfoservice_ipc_interface_code.h"
using
namespace
testing
::
ext
;
using
namespace
std
;
using
namespace
OHOS
;
static
int
g_tokenType
=
OHOS
::
Security
::
AccessToken
::
TOKEN_HAP
;
int
g_tokenType
=
OHOS
::
Security
::
AccessToken
::
TOKEN_HAP
;
int
g_tokenVerifyResult
=
0
;
namespace
OHOS
{
namespace
Security
{
...
...
@@ -125,7 +126,7 @@ HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceInvalidTokenTest, TestSize.Level1)
MessageOption
option
;
g_tokenType
=
OHOS
::
Security
::
AccessToken
::
TOKEN_INVALID
;
data
.
WriteInterfaceToken
(
OHOS
::
device_info
::
DeviceInfoStub
::
GetDescriptor
());
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_UDID
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_UDID
)
,
data
,
reply
,
option
);
}
HWTEST_F
(
DeviceInfoUnittest
,
DeviceInfoServiceFailTest
,
TestSize
.
Level1
)
...
...
@@ -141,10 +142,10 @@ HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceFailTest, TestSize.Level1)
// udid
data
.
WriteInterfaceToken
(
OHOS
::
device_info
::
DeviceInfoStub
::
GetDescriptor
());
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_UDID
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_UDID
)
,
data
,
reply
,
option
);
// serial
data
.
WriteInterfaceToken
(
OHOS
::
device_info
::
DeviceInfoStub
::
GetDescriptor
());
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_SERIAL_ID
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_SERIAL_ID
)
,
data
,
reply
,
option
);
}
HWTEST_F
(
DeviceInfoUnittest
,
DeviceInfoServiceTest
,
TestSize
.
Level1
)
...
...
@@ -158,13 +159,13 @@ HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceTest, TestSize.Level1)
g_tokenType
=
OHOS
::
Security
::
AccessToken
::
TOKEN_HAP
;
g_tokenVerifyResult
=
OHOS
::
Security
::
AccessToken
::
TypePermissionState
::
PERMISSION_GRANTED
;
data
.
WriteInterfaceToken
(
OHOS
::
device_info
::
DeviceInfoStub
::
GetDescriptor
());
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_UDID
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_UDID
)
,
data
,
reply
,
option
);
data
.
WriteInterfaceToken
(
OHOS
::
device_info
::
DeviceInfoStub
::
GetDescriptor
());
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_SERIAL_ID
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_SERIAL_ID
)
,
data
,
reply
,
option
);
data
.
WriteInterfaceToken
(
OHOS
::
device_info
::
DeviceInfoStub
::
GetDescriptor
());
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_SERIAL_ID
+
1
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_SERIAL_ID
)
+
1
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
OHOS
::
device_info
::
IDeviceInfo
::
COMMAND_GET_SERIAL_ID
+
1
,
data
,
reply
,
option
);
deviceInfoService
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
OHOS
::
device_info
::
DeviceInfoInterfaceCode
::
COMMAND_GET_SERIAL_ID
)
+
1
,
data
,
reply
,
option
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
3
));
// wait sa unload 3s
deviceInfoService
->
GetUdid
(
result
);
deviceInfoService
->
GetSerialID
(
result
);
...
...
test/unittest/param/watcher_proxy_unittest.cpp
浏览文件 @
3f35b011
...
...
@@ -78,7 +78,7 @@ public:
bool
ret
=
data
.
WriteRemoteObject
(
watcher
->
AsObject
());
WATCHER_CHECK
(
ret
,
return
0
,
"Can not get remote"
);
data
.
WriteUint32
(
agentId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
ADD_REMOTE_AGENT
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
ADD_REMOTE_AGENT
)
,
data
,
reply
,
option
);
watcherId
=
reply
.
ReadUint32
();
EXPECT_NE
(
watcherId
,
0
);
...
...
@@ -101,7 +101,7 @@ public:
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteUint32
(
watcherId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
DEL_REMOTE_AGENT
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
DEL_REMOTE_AGENT
)
,
data
,
reply
,
option
);
EXPECT_EQ
(
reply
.
ReadInt32
(),
0
);
EXPECT_EQ
(
watcherManager
->
GetRemoteWatcher
(
watcherId
)
==
nullptr
,
1
);
return
0
;
...
...
@@ -118,7 +118,7 @@ public:
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
watcherId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
ADD_WATCHER
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
ADD_WATCHER
)
,
data
,
reply
,
option
);
EXPECT_EQ
(
reply
.
ReadInt32
(),
0
);
EXPECT_EQ
(
watcherManager
->
GetWatcherGroup
(
keyPrefix
)
!=
nullptr
,
1
);
return
0
;
...
...
@@ -135,7 +135,7 @@ public:
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
watcherId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
REFRESH_WATCHER
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
REFRESH_WATCHER
)
,
data
,
reply
,
option
);
EXPECT_EQ
(
reply
.
ReadInt32
(),
0
);
EXPECT_EQ
(
watcherManager
->
GetWatcherGroup
(
keyPrefix
)
!=
nullptr
,
1
);
return
0
;
...
...
@@ -151,7 +151,7 @@ public:
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
watcherId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
DEL_WATCHER
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
DEL_WATCHER
)
,
data
,
reply
,
option
);
EXPECT_EQ
(
reply
.
ReadInt32
(),
0
);
return
0
;
}
...
...
@@ -231,11 +231,11 @@ public:
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
0
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
REFRESH_WATCHER
+
1
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
REFRESH_WATCHER
)
+
1
,
data
,
reply
,
option
);
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
REFRESH_WATCHER
+
1
,
data
,
reply
,
option
);
watcherManager
->
OnRemoteRequest
(
static_cast
<
uint32_t
>
(
ParamWatcherInterfaceCode
::
REFRESH_WATCHER
)
+
1
,
data
,
reply
,
option
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录