From 4c24a00762b1b8adf9851f98c99c90ae8ac2b88b Mon Sep 17 00:00:00 2001 From: dengjiewen Date: Sat, 1 Jul 2023 06:29:14 +0000 Subject: [PATCH] move ipc code to single .h file and add CODEOWNERS file Signed-off-by: dengjiewen Change-Id: I145b9a00e007e9918776fc09936cba099ac99fac --- CODEOWNERS | 29 +++++++++++++ .../ipc/common_defines/co_auth_interface.h | 8 +--- .../co_auth_interface_ipc_interface_code.h | 29 +++++++++++++ .../executor_callback_interface.h | 11 +---- ...or_callback_interface_ipc_interface_code.h | 33 +++++++++++++++ .../executor_messenger_interface.h | 6 +-- ...r_messenger_interface_ipc_interface_code.h | 30 +++++++++++++ ...dm_callback_interface_ipc_interface_code.h | 30 +++++++++++++ ...fo_callback_interface_ipc_interface_code.h | 29 +++++++++++++ ...fo_callback_interface_ipc_interface_code.h | 29 +++++++++++++ .../ipc/common_defines/user_auth_interface.h | 21 +--------- .../user_auth_interface_ipc_interface_code.h | 42 +++++++++++++++++++ .../user_idm_callback_interface.h | 16 ++----- .../ipc/common_defines/user_idm_interface.h | 16 +------ .../user_idm_interface_ipc_interface_code.h | 38 +++++++++++++++++ frameworks/native/ipc/src/co_auth_proxy.cpp | 2 +- frameworks/native/ipc/src/co_auth_stub.cpp | 2 +- .../ipc/src/executor_callback_proxy.cpp | 10 ++--- .../native/ipc/src/executor_callback_stub.cpp | 10 ++--- .../ipc/src/executor_messenger_proxy.cpp | 4 +- .../ipc/src/executor_messenger_stub.cpp | 4 +- .../ipc/src/user_auth_callback_proxy.cpp | 8 ++-- .../ipc/src/user_auth_callback_stub.cpp | 8 ++-- frameworks/native/ipc/src/user_auth_proxy.cpp | 16 +++---- frameworks/native/ipc/src/user_auth_stub.cpp | 18 ++++---- .../ipc/src/user_idm_callback_proxy.cpp | 8 ++-- .../native/ipc/src/user_idm_callback_stub.cpp | 8 ++-- frameworks/native/ipc/src/user_idm_proxy.cpp | 20 ++++----- frameworks/native/ipc/src/user_idm_stub.cpp | 20 ++++----- .../src/executor_callback_proxy_test.cpp | 12 +++--- .../src/executor_callback_stub_test.cpp | 10 ++--- .../src/executor_messenger_proxy_test.cpp | 4 +- .../src/executor_messenger_stub_test.cpp | 4 +- .../src/user_auth_callback_proxy_test.cpp | 8 ++-- .../src/user_auth_callback_stub_test.cpp | 8 ++-- .../src/user_idm_callback_proxy_test.cpp | 4 +- .../src/user_idm_callback_stub_test.cpp | 12 +++--- .../services/src/co_auth_stub_test.cpp | 6 +-- .../services/src/user_auth_stub_test.cpp | 30 ++++++------- .../services/src/user_idm_stub_test.cpp | 40 +++++++++--------- 40 files changed, 439 insertions(+), 204 deletions(-) create mode 100644 CODEOWNERS create mode 100644 frameworks/native/ipc/common_defines/co_auth_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/executor_callback_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/executor_messenger_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/idm_callback_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/idm_get_cred_info_callback_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/idm_get_secure_user_info_callback_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/user_auth_interface_ipc_interface_code.h create mode 100644 frameworks/native/ipc/common_defines/user_idm_interface_ipc_interface_code.h diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 000000000..f3c2e07c1 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,29 @@ +# 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 frameworks/native/ipc/common_defines/co_auth_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/co_auth_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/executor_callback_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/executor_callback_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/executor_messenger_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/executor_messenger_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/idm_callback_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/idm_callback_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/idm_get_cred_info_callback_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/idm_get_cred_info_callback_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/idm_get_secure_user_info_callback_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/idm_get_secure_user_info_callback_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/user_auth_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/user_auth_interface_ipc_interface_code.h @leonchan5 +#any change to frameworks/native/ipc/common_defines/user_idm_interface_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/ipc/common_defines/user_idm_interface_ipc_interface_code.h @leonchan5 diff --git a/frameworks/native/ipc/common_defines/co_auth_interface.h b/frameworks/native/ipc/common_defines/co_auth_interface.h index 5ae9d5355..abe5970d1 100644 --- a/frameworks/native/ipc/common_defines/co_auth_interface.h +++ b/frameworks/native/ipc/common_defines/co_auth_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -21,6 +21,7 @@ #include "executor_callback_interface.h" #include "iam_common_defines.h" +#include "co_auth_interface_ipc_interface_code.h" #include "iremote_broker.h" #include "refbase.h" @@ -29,11 +30,6 @@ namespace UserIam { namespace UserAuth { class CoAuthInterface : public IRemoteBroker { public: - /* Message ID */ - enum : uint32_t { - CO_AUTH_EXECUTOR_REGISTER = 0, - }; - struct ExecutorRegisterInfo { AuthType authType; ExecutorRole executorRole; diff --git a/frameworks/native/ipc/common_defines/co_auth_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/co_auth_interface_ipc_interface_code.h new file mode 100644 index 000000000..d45a1b4ed --- /dev/null +++ b/frameworks/native/ipc/common_defines/co_auth_interface_ipc_interface_code.h @@ -0,0 +1,29 @@ +/* + * 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 CO_AUTH_INTERFACE_IPC_INTERFACE_CODE_H +#define CO_AUTH_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 931 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class CoAuthInterfaceCode { + CO_AUTH_EXECUTOR_REGISTER = 0, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // CO_AUTH_INTERFACE_IPC_INTERFACE_CODE_H diff --git a/frameworks/native/ipc/common_defines/executor_callback_interface.h b/frameworks/native/ipc/common_defines/executor_callback_interface.h index 2738857c4..5b0f077e8 100644 --- a/frameworks/native/ipc/common_defines/executor_callback_interface.h +++ b/frameworks/native/ipc/common_defines/executor_callback_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -21,19 +21,12 @@ #include "iremote_broker.h" #include "executor_messenger_interface.h" +#include "executor_callback_interface_ipc_interface_code.h" namespace OHOS { namespace UserIam { namespace UserAuth { class ExecutorCallbackInterface : public IRemoteBroker { public: - /* Message ID */ - enum : uint32_t { - ON_MESSENGER_READY = 1, - ON_BEGIN_EXECUTE, - ON_END_EXECUTE, - ON_SET_PROPERTY, - ON_GET_PROPERTY, - }; virtual void OnMessengerReady(sptr &messenger, const std::vector &publicKey, const std::vector &templateIdList) = 0; virtual int32_t OnBeginExecute(uint64_t scheduleId, const std::vector &publicKey, diff --git a/frameworks/native/ipc/common_defines/executor_callback_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/executor_callback_interface_ipc_interface_code.h new file mode 100644 index 000000000..d45b030fa --- /dev/null +++ b/frameworks/native/ipc/common_defines/executor_callback_interface_ipc_interface_code.h @@ -0,0 +1,33 @@ +/* + * 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 EXECUTOR_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H +#define EXECUTOR_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 931 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class ExecutorCallbackInterfaceCode { + ON_MESSENGER_READY = 1, + ON_BEGIN_EXECUTE, + ON_END_EXECUTE, + ON_SET_PROPERTY, + ON_GET_PROPERTY, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // EXECUTOR_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H diff --git a/frameworks/native/ipc/common_defines/executor_messenger_interface.h b/frameworks/native/ipc/common_defines/executor_messenger_interface.h index 8082529b1..7cef299fd 100644 --- a/frameworks/native/ipc/common_defines/executor_messenger_interface.h +++ b/frameworks/native/ipc/common_defines/executor_messenger_interface.h @@ -19,6 +19,7 @@ #include "iremote_broker.h" #include "attributes.h" +#include "executor_messenger_interface_ipc_interface_code.h" #include "iam_common_defines.h" namespace OHOS { @@ -26,11 +27,6 @@ namespace UserIam { namespace UserAuth { class ExecutorMessengerInterface : public IRemoteBroker { public: - /* Message ID */ - enum : uint32_t { - CO_AUTH_SEND_DATA = 0, - CO_AUTH_FINISH, - }; virtual int32_t SendData(uint64_t scheduleId, uint64_t transNum, ExecutorRole srcRole, ExecutorRole dstRole, const std::vector &msg) = 0; virtual int32_t Finish(uint64_t scheduleId, ExecutorRole srcRole, ResultCode resultCode, diff --git a/frameworks/native/ipc/common_defines/executor_messenger_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/executor_messenger_interface_ipc_interface_code.h new file mode 100644 index 000000000..984654fdc --- /dev/null +++ b/frameworks/native/ipc/common_defines/executor_messenger_interface_ipc_interface_code.h @@ -0,0 +1,30 @@ +/* + * 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 EXECUTOR_MESSENGER_INTERFACE_IPC_INTERFACE_CODE_H +#define EXECUTOR_MESSENGER_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 931 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class ExecutorMessengerInterfaceCode { + CO_AUTH_SEND_DATA = 0, + CO_AUTH_FINISH, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // EXECUTOR_MESSENGER_INTERFACE_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/ipc/common_defines/idm_callback_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/idm_callback_interface_ipc_interface_code.h new file mode 100644 index 000000000..99604ce50 --- /dev/null +++ b/frameworks/native/ipc/common_defines/idm_callback_interface_ipc_interface_code.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 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 IDM_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H +#define IDM_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 901 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class IdmCallbackInterfaceCode{ + IDM_CALLBACK_ON_RESULT = 0, + IDM_CALLBACK_ON_ACQUIRE_INFO, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // IDM_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/ipc/common_defines/idm_get_cred_info_callback_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/idm_get_cred_info_callback_interface_ipc_interface_code.h new file mode 100644 index 000000000..0ed421040 --- /dev/null +++ b/frameworks/native/ipc/common_defines/idm_get_cred_info_callback_interface_ipc_interface_code.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 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 IDM_GET_CRED_INFO_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H +#define IDM_GET_CRED_INFO_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 901 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class IdmGetCredInfoCallbackInterfaceCode{ + ON_GET_INFO = 0, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // IDM_GET_CRED_INFO_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/ipc/common_defines/idm_get_secure_user_info_callback_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/idm_get_secure_user_info_callback_interface_ipc_interface_code.h new file mode 100644 index 000000000..c7e9dc64c --- /dev/null +++ b/frameworks/native/ipc/common_defines/idm_get_secure_user_info_callback_interface_ipc_interface_code.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 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 IDM_GET_SECURE_USER_INFO_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H +#define IDM_GET_SECURE_USER_INFO_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 901 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class IdmGetSecureUserInfoCallbackInterfaceCode{ + ON_GET_SEC_INFO = 0, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // IDM_GET_SECURE_USER_INFO_CALLBACK_INTERFACE_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/ipc/common_defines/user_auth_interface.h b/frameworks/native/ipc/common_defines/user_auth_interface.h index 37803b4cd..dc724d64b 100644 --- a/frameworks/native/ipc/common_defines/user_auth_interface.h +++ b/frameworks/native/ipc/common_defines/user_auth_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -24,30 +24,13 @@ #include "attributes.h" #include "user_auth_callback_interface.h" +#include "user_auth_interface_ipc_interface_code.h" namespace OHOS { namespace UserIam { namespace UserAuth { class UserAuthInterface : public IRemoteBroker { public: - /* Message ID */ - enum : uint32_t { - USER_AUTH_GET_AVAILABLE_STATUS = 0, - USER_AUTH_GET_PROPERTY, - USER_AUTH_SET_PROPERTY, - USER_AUTH_AUTH, - USER_AUTH_AUTH_USER, - USER_AUTH_CANCEL_AUTH, - USER_AUTH_GET_VERSION, - USER_AUTH_ON_RESULT, - USER_AUTH_GET_EX_PROP, - USER_AUTH_SET_EX_PROP, - USER_AUTH_ACQUIRE_INFO, - USER_AUTH_IDENTIFY, - USER_AUTH_CANCEL_IDENTIFY, - USER_AUTH_ON_IDENTIFY_RESULT, - }; - virtual int32_t GetAvailableStatus(int32_t apiVersion, AuthType authType, AuthTrustLevel authTrustLevel) = 0; virtual void GetProperty(int32_t userId, AuthType authType, diff --git a/frameworks/native/ipc/common_defines/user_auth_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/user_auth_interface_ipc_interface_code.h new file mode 100644 index 000000000..809a9cc5f --- /dev/null +++ b/frameworks/native/ipc/common_defines/user_auth_interface_ipc_interface_code.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 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 USER_AUTH_INTERFACE_IPC_INTERFACE_CODE_H +#define USER_AUTH_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 921 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class UserAuthInterfaceCode { + USER_AUTH_GET_AVAILABLE_STATUS = 0, + USER_AUTH_GET_PROPERTY, + USER_AUTH_SET_PROPERTY, + USER_AUTH_AUTH, + USER_AUTH_AUTH_USER, + USER_AUTH_CANCEL_AUTH, + USER_AUTH_GET_VERSION, + USER_AUTH_ON_RESULT, + USER_AUTH_GET_EX_PROP, + USER_AUTH_SET_EX_PROP, + USER_AUTH_ACQUIRE_INFO, + USER_AUTH_IDENTIFY, + USER_AUTH_CANCEL_IDENTIFY, + USER_AUTH_ON_IDENTIFY_RESULT, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // USER_AUTH_INTERFACE_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/ipc/common_defines/user_idm_callback_interface.h b/frameworks/native/ipc/common_defines/user_idm_callback_interface.h index 915c8a70c..c3ecc767c 100644 --- a/frameworks/native/ipc/common_defines/user_idm_callback_interface.h +++ b/frameworks/native/ipc/common_defines/user_idm_callback_interface.h @@ -23,6 +23,9 @@ #include "attributes.h" #include "iam_common_defines.h" #include "iam_callback_interface.h" +#include "idm_callback_interface_ipc_interface_code.h" +#include "idm_get_cred_info_callback_interface_ipc_interface_code.h" +#include "idm_get_secure_user_info_callback_interface_ipc_interface_code.h" #include "user_idm_client_defines.h" namespace OHOS { @@ -30,10 +33,6 @@ namespace UserIam { namespace UserAuth { class IdmGetCredInfoCallbackInterface : public IRemoteBroker { public: - enum { - ON_GET_INFO = 0, - }; - /* * return all registered credential information. */ @@ -44,10 +43,6 @@ public: class IdmGetSecureUserInfoCallbackInterface : public IRemoteBroker { public: - enum { - ON_GET_SEC_INFO = 0, - }; - /* * return all registered security information. */ @@ -58,11 +53,6 @@ public: class IdmCallbackInterface : public IamCallbackInterface { public: - enum { - IDM_CALLBACK_ON_RESULT = 0, - IDM_CALLBACK_ON_ACQUIRE_INFO, - }; - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.useridm.IIDMCallback"); }; } // namespace UserAuth diff --git a/frameworks/native/ipc/common_defines/user_idm_interface.h b/frameworks/native/ipc/common_defines/user_idm_interface.h index 2d33c4066..99292efe3 100644 --- a/frameworks/native/ipc/common_defines/user_idm_interface.h +++ b/frameworks/native/ipc/common_defines/user_idm_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-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 @@ -20,25 +20,13 @@ #include "refbase.h" #include "user_idm_callback_interface.h" +#include "user_idm_interface_ipc_interface_code.h" namespace OHOS { namespace UserIam { namespace UserAuth { class UserIdmInterface : public IRemoteBroker { public: - enum : uint32_t { - USER_IDM_OPEN_SESSION = 0, - USER_IDM_CLOSE_SESSION, - USER_IDM_GET_CRED_INFO, - USER_IDM_GET_SEC_INFO, - USER_IDM_ADD_CREDENTIAL, - USER_IDM_UPDATE_CREDENTIAL, - USER_IDM_CANCEL, - USER_IDM_ENFORCE_DEL_USER, - USER_IDM_DEL_USER, - USER_IDM_DEL_CRED, - }; - struct CredentialPara { AuthType authType {ALL}; PinSubType pinType {PIN_SIX}; diff --git a/frameworks/native/ipc/common_defines/user_idm_interface_ipc_interface_code.h b/frameworks/native/ipc/common_defines/user_idm_interface_ipc_interface_code.h new file mode 100644 index 000000000..edfb843c1 --- /dev/null +++ b/frameworks/native/ipc/common_defines/user_idm_interface_ipc_interface_code.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 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 USER_IDM_INTERFACE_IPC_INTERFACE_CODE_H +#define USER_IDM_INTERFACE_IPC_INTERFACE_CODE_H + +/* SAID: 931 */ +namespace OHOS { +namespace UserIam { +namespace UserAuth { +enum class UserIdmInterfaceCode { + USER_IDM_OPEN_SESSION = 0, + USER_IDM_CLOSE_SESSION, + USER_IDM_GET_CRED_INFO, + USER_IDM_GET_SEC_INFO, + USER_IDM_ADD_CREDENTIAL, + USER_IDM_UPDATE_CREDENTIAL, + USER_IDM_CANCEL, + USER_IDM_ENFORCE_DEL_USER, + USER_IDM_DEL_USER, + USER_IDM_DEL_CRED, +}; +} // namespace UserAuth +} // namespace UserIam +} // namespace OHOS +#endif // USER_IDM_INTERFACE_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/ipc/src/co_auth_proxy.cpp b/frameworks/native/ipc/src/co_auth_proxy.cpp index c46b33500..f5635ea71 100644 --- a/frameworks/native/ipc/src/co_auth_proxy.cpp +++ b/frameworks/native/ipc/src/co_auth_proxy.cpp @@ -82,7 +82,7 @@ uint64_t CoAuthProxy::ExecutorRegister(const ExecutorRegisterInfo &info, sptr(CoAuthInterfaceCode::CO_AUTH_EXECUTOR_REGISTER), data, reply); if (!ret) { IAM_LOGE("failed to send request"); return BAD_CONTEXT_ID; diff --git a/frameworks/native/ipc/src/co_auth_stub.cpp b/frameworks/native/ipc/src/co_auth_stub.cpp index b72279164..5bcfbe3a5 100644 --- a/frameworks/native/ipc/src/co_auth_stub.cpp +++ b/frameworks/native/ipc/src/co_auth_stub.cpp @@ -35,7 +35,7 @@ int32_t CoAuthStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageP return GENERAL_ERROR; } switch (code) { - case CoAuthInterface::CO_AUTH_EXECUTOR_REGISTER: + case static_cast(CoAuthInterfaceCode::CO_AUTH_EXECUTOR_REGISTER): return ExecutorRegisterStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/frameworks/native/ipc/src/executor_callback_proxy.cpp b/frameworks/native/ipc/src/executor_callback_proxy.cpp index 55d97145d..090ed8ba5 100644 --- a/frameworks/native/ipc/src/executor_callback_proxy.cpp +++ b/frameworks/native/ipc/src/executor_callback_proxy.cpp @@ -51,7 +51,7 @@ void ExecutorCallbackProxy::OnMessengerReady(sptr &m return; } - bool result = SendRequest(ExecutorCallbackInterface::ON_MESSENGER_READY, data, reply); + bool result = SendRequest(static_cast(ExecutorCallbackInterfaceCode::ON_MESSENGER_READY), data, reply); if (!result) { IAM_LOGE("send request failed"); return; @@ -82,7 +82,7 @@ int32_t ExecutorCallbackProxy::OnBeginExecute(uint64_t scheduleId, const std::ve return GENERAL_ERROR; } - bool ret = SendRequest(ExecutorCallbackInterface::ON_BEGIN_EXECUTE, data, reply); + bool ret = SendRequest(static_cast(ExecutorCallbackInterfaceCode::ON_BEGIN_EXECUTE), data, reply); if (!ret) { IAM_LOGE("send request failed"); return GENERAL_ERROR; @@ -114,7 +114,7 @@ int32_t ExecutorCallbackProxy::OnEndExecute(uint64_t scheduleId, const Attribute return GENERAL_ERROR; } - bool ret = SendRequest(ExecutorCallbackInterface::ON_END_EXECUTE, data, reply); + bool ret = SendRequest(static_cast(ExecutorCallbackInterfaceCode::ON_END_EXECUTE), data, reply); if (!ret) { IAM_LOGE("send request failed"); return GENERAL_ERROR; @@ -142,7 +142,7 @@ int32_t ExecutorCallbackProxy::OnSetProperty(const Attributes &properties) return GENERAL_ERROR; } - bool ret = SendRequest(ExecutorCallbackInterface::ON_SET_PROPERTY, data, reply); + bool ret = SendRequest(static_cast(ExecutorCallbackInterfaceCode::ON_SET_PROPERTY), data, reply); if (!ret) { IAM_LOGE("send request failed"); return GENERAL_ERROR; @@ -170,7 +170,7 @@ int32_t ExecutorCallbackProxy::OnGetProperty(const Attributes &condition, Attrib return GENERAL_ERROR; } - bool ret = SendRequest(ExecutorCallbackInterface::ON_GET_PROPERTY, data, reply); + bool ret = SendRequest(static_cast(ExecutorCallbackInterfaceCode::ON_GET_PROPERTY), data, reply); if (!ret) { IAM_LOGE("send request failed"); return GENERAL_ERROR; diff --git a/frameworks/native/ipc/src/executor_callback_stub.cpp b/frameworks/native/ipc/src/executor_callback_stub.cpp index ce96b746d..80f6b04ef 100644 --- a/frameworks/native/ipc/src/executor_callback_stub.cpp +++ b/frameworks/native/ipc/src/executor_callback_stub.cpp @@ -33,15 +33,15 @@ int32_t ExecutorCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data return GENERAL_ERROR; } switch (code) { - case ExecutorCallbackInterface::ON_MESSENGER_READY: + case static_cast(ExecutorCallbackInterfaceCode::ON_MESSENGER_READY): return OnMessengerReadyStub(data, reply); - case ExecutorCallbackInterface::ON_BEGIN_EXECUTE: + case static_cast(ExecutorCallbackInterfaceCode::ON_BEGIN_EXECUTE): return OnBeginExecuteStub(data, reply); - case ExecutorCallbackInterface::ON_END_EXECUTE: + case static_cast(ExecutorCallbackInterfaceCode::ON_END_EXECUTE): return OnEndExecuteStub(data, reply); - case ExecutorCallbackInterface::ON_SET_PROPERTY: + case static_cast(ExecutorCallbackInterfaceCode::ON_SET_PROPERTY): return OnSetPropertyStub(data, reply); - case ExecutorCallbackInterface::ON_GET_PROPERTY: + case static_cast(ExecutorCallbackInterfaceCode::ON_GET_PROPERTY): return OnGetPropertyStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/frameworks/native/ipc/src/executor_messenger_proxy.cpp b/frameworks/native/ipc/src/executor_messenger_proxy.cpp index 0ff027fa9..e821b9e75 100644 --- a/frameworks/native/ipc/src/executor_messenger_proxy.cpp +++ b/frameworks/native/ipc/src/executor_messenger_proxy.cpp @@ -58,7 +58,7 @@ int32_t ExecutorMessengerProxy::SendData(uint64_t scheduleId, uint64_t transNum, return WRITE_PARCEL_ERROR; } - bool ret = SendRequest(ExecutorMessengerInterface::CO_AUTH_SEND_DATA, data, reply); + bool ret = SendRequest(static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_SEND_DATA), data, reply); if (!ret) { IAM_LOGE("failed to send request"); return GENERAL_ERROR; @@ -103,7 +103,7 @@ int32_t ExecutorMessengerProxy::Finish(uint64_t scheduleId, ExecutorRole srcRole return WRITE_PARCEL_ERROR; } - bool ret = SendRequest(ExecutorMessengerInterface::CO_AUTH_FINISH, data, reply); + bool ret = SendRequest(static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_FINISH), data, reply); if (!ret) { IAM_LOGE("failed to send request"); return GENERAL_ERROR; diff --git a/frameworks/native/ipc/src/executor_messenger_stub.cpp b/frameworks/native/ipc/src/executor_messenger_stub.cpp index e7cb2d043..f493b0225 100644 --- a/frameworks/native/ipc/src/executor_messenger_stub.cpp +++ b/frameworks/native/ipc/src/executor_messenger_stub.cpp @@ -36,9 +36,9 @@ int32_t ExecutorMessengerStub::OnRemoteRequest(uint32_t code, MessageParcel &dat return GENERAL_ERROR; } switch (code) { - case ExecutorMessengerInterface::CO_AUTH_SEND_DATA: + case static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_SEND_DATA): return SendDataStub(data, reply); - case ExecutorMessengerInterface::CO_AUTH_FINISH: + case static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_FINISH): return FinishStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/frameworks/native/ipc/src/user_auth_callback_proxy.cpp b/frameworks/native/ipc/src/user_auth_callback_proxy.cpp index 7bab3b019..93b33b36d 100644 --- a/frameworks/native/ipc/src/user_auth_callback_proxy.cpp +++ b/frameworks/native/ipc/src/user_auth_callback_proxy.cpp @@ -45,7 +45,7 @@ void UserAuthCallbackProxy::OnResult(int32_t result, const Attributes &extraInfo return; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_ON_RESULT, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_ON_RESULT), data, reply); if (!ret) { IAM_LOGE("send request failed"); } @@ -76,7 +76,7 @@ void UserAuthCallbackProxy::OnAcquireInfo(int32_t module, int32_t acquireInfo, c return; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_ACQUIRE_INFO, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_ACQUIRE_INFO), data, reply); if (!ret) { IAM_LOGE("send request failed"); } @@ -121,7 +121,7 @@ void GetExecutorPropertyCallbackProxy::OnGetExecutorPropertyResult(int32_t resul return; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_GET_EX_PROP, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_GET_EX_PROP), data, reply); if (!ret) { IAM_LOGE("send request failed"); } @@ -161,7 +161,7 @@ void SetExecutorPropertyCallbackProxy::OnSetExecutorPropertyResult(int32_t resul return; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_SET_EX_PROP, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_SET_EX_PROP), data, reply); if (!ret) { IAM_LOGE("send request failed"); } diff --git a/frameworks/native/ipc/src/user_auth_callback_stub.cpp b/frameworks/native/ipc/src/user_auth_callback_stub.cpp index 9531c2345..18dbd0748 100644 --- a/frameworks/native/ipc/src/user_auth_callback_stub.cpp +++ b/frameworks/native/ipc/src/user_auth_callback_stub.cpp @@ -35,9 +35,9 @@ int32_t UserAuthCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data } switch (code) { - case UserAuthInterface::USER_AUTH_ON_RESULT: + case static_cast(UserAuthInterfaceCode::USER_AUTH_ON_RESULT): return OnResultStub(data, reply); - case UserAuthInterface::USER_AUTH_ACQUIRE_INFO: + case static_cast(UserAuthInterfaceCode::USER_AUTH_ACQUIRE_INFO): return OnAcquireInfoStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); @@ -98,7 +98,7 @@ int32_t GetExecutorPropertyCallbackStub::OnRemoteRequest(uint32_t code, MessageP return GENERAL_ERROR; } - if (code == UserAuthInterface::USER_AUTH_GET_EX_PROP) { + if (code == static_cast(UserAuthInterfaceCode::USER_AUTH_GET_EX_PROP)) { return OnGetExecutorPropertyResultStub(data, reply); } return IPCObjectStub::OnRemoteRequest(code, data, reply, option); @@ -133,7 +133,7 @@ int32_t SetExecutorPropertyCallbackStub::OnRemoteRequest(uint32_t code, MessageP return GENERAL_ERROR; } - if (code == UserAuthInterface::USER_AUTH_SET_EX_PROP) { + if (code == static_cast(UserAuthInterfaceCode::USER_AUTH_SET_EX_PROP)) { return OnSetExecutorPropertyResultStub(data, reply); } return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/frameworks/native/ipc/src/user_auth_proxy.cpp b/frameworks/native/ipc/src/user_auth_proxy.cpp index 21a2e0f86..207518443 100644 --- a/frameworks/native/ipc/src/user_auth_proxy.cpp +++ b/frameworks/native/ipc/src/user_auth_proxy.cpp @@ -56,7 +56,7 @@ int32_t UserAuthProxy::GetAvailableStatus(int32_t apiVersion, AuthType authType, return WRITE_PARCEL_ERROR; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_GET_AVAILABLE_STATUS, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_GET_AVAILABLE_STATUS), data, reply); if (!ret) { return GENERAL_ERROR; } @@ -109,7 +109,7 @@ void UserAuthProxy::GetProperty(int32_t userId, AuthType authType, return; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_GET_PROPERTY, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_GET_PROPERTY), data, reply); if (!ret) { Attributes attr; callback->OnGetExecutorPropertyResult(GENERAL_ERROR, attr); @@ -148,7 +148,7 @@ void UserAuthProxy::SetProperty(int32_t userId, AuthType authType, const Attribu return; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_SET_PROPERTY, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_SET_PROPERTY), data, reply); if (!ret) { callback->OnSetExecutorPropertyResult(GENERAL_ERROR); } @@ -198,7 +198,7 @@ uint64_t UserAuthProxy::Auth(int32_t apiVersion, const std::vector &cha IAM_LOGE("failed to write apiVersion"); return BAD_CONTEXT_ID; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_AUTH, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH), data, reply); if (!ret) { return BAD_CONTEXT_ID; } @@ -232,7 +232,7 @@ uint64_t UserAuthProxy::AuthUser(int32_t userId, const std::vector &cha return BAD_CONTEXT_ID; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_AUTH_USER, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH_USER), data, reply); if (!ret) { return BAD_CONTEXT_ID; } @@ -270,7 +270,7 @@ uint64_t UserAuthProxy::Identify(const std::vector &challenge, AuthType return BAD_CONTEXT_ID; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_IDENTIFY, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_IDENTIFY), data, reply); if (!ret) { return BAD_CONTEXT_ID; } @@ -295,7 +295,7 @@ int32_t UserAuthProxy::CancelAuthOrIdentify(uint64_t contextId) return GENERAL_ERROR; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_CANCEL_AUTH, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_CANCEL_AUTH), data, reply); if (!ret) { return GENERAL_ERROR; } @@ -317,7 +317,7 @@ int32_t UserAuthProxy::GetVersion(int32_t &version) return GENERAL_ERROR; } - bool ret = SendRequest(UserAuthInterface::USER_AUTH_GET_VERSION, data, reply); + bool ret = SendRequest(static_cast(UserAuthInterfaceCode::USER_AUTH_GET_VERSION), data, reply); if (!ret) { return GENERAL_ERROR; } diff --git a/frameworks/native/ipc/src/user_auth_stub.cpp b/frameworks/native/ipc/src/user_auth_stub.cpp index 6880c8120..2a922db5f 100644 --- a/frameworks/native/ipc/src/user_auth_stub.cpp +++ b/frameworks/native/ipc/src/user_auth_stub.cpp @@ -40,23 +40,23 @@ int32_t UserAuthStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messag return GENERAL_ERROR; } switch (code) { - case UserAuthInterface::USER_AUTH_GET_AVAILABLE_STATUS: + case static_cast(UserAuthInterfaceCode::USER_AUTH_GET_AVAILABLE_STATUS): return GetAvailableStatusStub(data, reply); - case UserAuthInterface::USER_AUTH_GET_PROPERTY: + case static_cast(UserAuthInterfaceCode::USER_AUTH_GET_PROPERTY): return GetPropertyStub(data, reply); - case UserAuthInterface::USER_AUTH_SET_PROPERTY: + case static_cast(UserAuthInterfaceCode::USER_AUTH_SET_PROPERTY): return SetPropertyStub(data, reply); - case UserAuthInterface::USER_AUTH_AUTH: + case static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH): return AuthStub(data, reply); - case UserAuthInterface::USER_AUTH_AUTH_USER: + case static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH_USER): return AuthUserStub(data, reply); - case UserAuthInterface::USER_AUTH_CANCEL_AUTH: + case static_cast(UserAuthInterfaceCode::USER_AUTH_CANCEL_AUTH): return CancelAuthOrIdentifyStub(data, reply); - case UserAuthInterface::USER_AUTH_IDENTIFY: + case static_cast(UserAuthInterfaceCode::USER_AUTH_IDENTIFY): return IdentifyStub(data, reply); - case UserAuthInterface::USER_AUTH_CANCEL_IDENTIFY: + case static_cast(UserAuthInterfaceCode::USER_AUTH_CANCEL_IDENTIFY): return CancelAuthOrIdentifyStub(data, reply); - case UserAuthInterface::USER_AUTH_GET_VERSION: + case static_cast(UserAuthInterfaceCode::USER_AUTH_GET_VERSION): return GetVersionStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/frameworks/native/ipc/src/user_idm_callback_proxy.cpp b/frameworks/native/ipc/src/user_idm_callback_proxy.cpp index 37fe730c3..de621e7dd 100644 --- a/frameworks/native/ipc/src/user_idm_callback_proxy.cpp +++ b/frameworks/native/ipc/src/user_idm_callback_proxy.cpp @@ -45,7 +45,7 @@ void IdmCallbackProxy::OnResult(int32_t result, const Attributes &extraInfo) return; } - bool ret = SendRequest(IDM_CALLBACK_ON_RESULT, data, reply); + bool ret = SendRequest(static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_RESULT), data, reply); if (!ret) { IAM_LOGE("failed to send request"); } @@ -76,7 +76,7 @@ void IdmCallbackProxy::OnAcquireInfo(int32_t module, int32_t acquireInfo, const return; } - bool ret = SendRequest(IDM_CALLBACK_ON_ACQUIRE_INFO, data, reply); + bool ret = SendRequest(static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_ACQUIRE_INFO), data, reply); if (!ret) { IAM_LOGE("failed to send request"); } @@ -135,7 +135,7 @@ void IdmGetCredentialInfoProxy::OnCredentialInfos(const std::vector(IdmGetCredInfoCallbackInterfaceCode::ON_GET_INFO), data, reply); if (!ret) { IAM_LOGE("failed to send request"); } @@ -202,7 +202,7 @@ void IdmGetSecureUserInfoProxy::OnSecureUserInfo(const SecUserInfo &secUserInfo) return; } - bool ret = SendRequest(ON_GET_SEC_INFO, data, reply); + bool ret = SendRequest(static_cast(IdmGetSecureUserInfoCallbackInterfaceCode::ON_GET_SEC_INFO), data, reply); if (!ret) { IAM_LOGE("failed to send request"); } diff --git a/frameworks/native/ipc/src/user_idm_callback_stub.cpp b/frameworks/native/ipc/src/user_idm_callback_stub.cpp index aecb4e265..1c99ee1b2 100644 --- a/frameworks/native/ipc/src/user_idm_callback_stub.cpp +++ b/frameworks/native/ipc/src/user_idm_callback_stub.cpp @@ -38,9 +38,9 @@ int32_t IdmCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Mes } switch (code) { - case IdmCallbackInterface::IDM_CALLBACK_ON_RESULT: + case static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_RESULT): return OnResultStub(data, reply); - case IdmCallbackInterface::IDM_CALLBACK_ON_ACQUIRE_INFO: + case static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_ACQUIRE_INFO): return OnAcquireInfoStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); @@ -101,7 +101,7 @@ int32_t IdmGetCredInfoCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel return GENERAL_ERROR; } - if (code == IdmGetCredInfoCallbackInterface::ON_GET_INFO) { + if (code == static_cast(IdmGetCredInfoCallbackInterfaceCode::ON_GET_INFO)) { return OnCredentialInfosStub(data, reply); } return IPCObjectStub::OnRemoteRequest(code, data, reply, option); @@ -169,7 +169,7 @@ int32_t IdmGetSecureUserInfoCallbackStub::OnRemoteRequest(uint32_t code, Message return GENERAL_ERROR; } - if (code == IdmGetSecureUserInfoCallbackInterface::ON_GET_SEC_INFO) { + if (code == static_cast(IdmGetSecureUserInfoCallbackInterfaceCode::ON_GET_SEC_INFO)) { return OnSecureUserInfoStub(data, reply); } return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/frameworks/native/ipc/src/user_idm_proxy.cpp b/frameworks/native/ipc/src/user_idm_proxy.cpp index c07d944fc..f673a35d5 100644 --- a/frameworks/native/ipc/src/user_idm_proxy.cpp +++ b/frameworks/native/ipc/src/user_idm_proxy.cpp @@ -42,7 +42,7 @@ int32_t UserIdmProxy::OpenSession(int32_t userId, std::vector &challeng return WRITE_PARCEL_ERROR; } - bool ret = SendRequest(UserIdmInterface::USER_IDM_OPEN_SESSION, data, reply); + bool ret = SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_OPEN_SESSION), data, reply); if (!ret) { return GENERAL_ERROR; } @@ -67,7 +67,7 @@ void UserIdmProxy::CloseSession(int32_t userId) return; } - SendRequest(UserIdmInterface::USER_IDM_CLOSE_SESSION, data, reply); + SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_CLOSE_SESSION), data, reply); } int32_t UserIdmProxy::GetCredentialInfo(int32_t userId, AuthType authType, @@ -97,7 +97,7 @@ int32_t UserIdmProxy::GetCredentialInfo(int32_t userId, AuthType authType, return WRITE_PARCEL_ERROR; } - bool ret = SendRequest(UserIdmInterface::USER_IDM_GET_CRED_INFO, data, reply); + bool ret = SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_GET_CRED_INFO), data, reply); if (!ret) { return GENERAL_ERROR; } @@ -130,7 +130,7 @@ int32_t UserIdmProxy::GetSecInfo(int32_t userId, const sptr(UserIdmInterfaceCode::USER_IDM_GET_SEC_INFO), data, reply); if (!ret) { SecUserInfo secUserInfo = {}; callback->OnSecureUserInfo(secUserInfo); @@ -178,7 +178,7 @@ void UserIdmProxy::AddCredential(int32_t userId, const CredentialPara &credPara, return; } - SendRequest(UserIdmInterface::USER_IDM_ADD_CREDENTIAL, data, reply); + SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_ADD_CREDENTIAL), data, reply); } void UserIdmProxy::UpdateCredential(int32_t userId, const CredentialPara &credPara, @@ -216,7 +216,7 @@ void UserIdmProxy::UpdateCredential(int32_t userId, const CredentialPara &credPa return; } - bool ret = SendRequest(UserIdmInterface::USER_IDM_UPDATE_CREDENTIAL, data, reply); + bool ret = SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_UPDATE_CREDENTIAL), data, reply); if (!ret) { Attributes extraInfo; callback->OnResult(GENERAL_ERROR, extraInfo); @@ -237,7 +237,7 @@ int32_t UserIdmProxy::Cancel(int32_t userId) return WRITE_PARCEL_ERROR; } - bool ret = SendRequest(UserIdmInterface::USER_IDM_CANCEL, data, reply); + bool ret = SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_CANCEL), data, reply); if (!ret) { return GENERAL_ERROR; } @@ -270,7 +270,7 @@ int32_t UserIdmProxy::EnforceDelUser(int32_t userId, const sptr(UserIdmInterfaceCode::USER_IDM_ENFORCE_DEL_USER), data, reply); if (!ret) { Attributes attr; callback->OnResult(GENERAL_ERROR, attr); @@ -310,7 +310,7 @@ void UserIdmProxy::DelUser(int32_t userId, const std::vector authToken, return; } - SendRequest(UserIdmInterface::USER_IDM_DEL_USER, data, reply); + SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_DEL_USER), data, reply); } void UserIdmProxy::DelCredential(int32_t userId, uint64_t credentialId, @@ -344,7 +344,7 @@ void UserIdmProxy::DelCredential(int32_t userId, uint64_t credentialId, return; } - SendRequest(UserIdmInterface::USER_IDM_DEL_CRED, data, reply); + SendRequest(static_cast(UserIdmInterfaceCode::USER_IDM_DEL_CRED), data, reply); } bool UserIdmProxy::SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply) diff --git a/frameworks/native/ipc/src/user_idm_stub.cpp b/frameworks/native/ipc/src/user_idm_stub.cpp index c59822363..3c255d965 100644 --- a/frameworks/native/ipc/src/user_idm_stub.cpp +++ b/frameworks/native/ipc/src/user_idm_stub.cpp @@ -36,25 +36,25 @@ int32_t UserIdmStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Message } switch (code) { - case USER_IDM_OPEN_SESSION: + case static_cast(UserIdmInterfaceCode::USER_IDM_OPEN_SESSION): return OpenSessionStub(data, reply); - case USER_IDM_CLOSE_SESSION: + case static_cast(UserIdmInterfaceCode::USER_IDM_CLOSE_SESSION): return CloseSessionStub(data, reply); - case USER_IDM_GET_CRED_INFO: + case static_cast(UserIdmInterfaceCode::USER_IDM_GET_CRED_INFO): return GetCredentialInfoStub(data, reply); - case USER_IDM_GET_SEC_INFO: + case static_cast(UserIdmInterfaceCode::USER_IDM_GET_SEC_INFO): return GetSecInfoStub(data, reply); - case USER_IDM_ADD_CREDENTIAL: + case static_cast(UserIdmInterfaceCode::USER_IDM_ADD_CREDENTIAL): return AddCredentialStub(data, reply); - case USER_IDM_UPDATE_CREDENTIAL: + case static_cast(UserIdmInterfaceCode::USER_IDM_UPDATE_CREDENTIAL): return UpdateCredentialStub(data, reply); - case USER_IDM_CANCEL: + case static_cast(UserIdmInterfaceCode::USER_IDM_CANCEL): return CancelStub(data, reply); - case USER_IDM_ENFORCE_DEL_USER: + case static_cast(UserIdmInterfaceCode::USER_IDM_ENFORCE_DEL_USER): return EnforceDelUserStub(data, reply); - case USER_IDM_DEL_USER: + case static_cast(UserIdmInterfaceCode::USER_IDM_DEL_USER): return DelUserStub(data, reply); - case USER_IDM_DEL_CRED: + case static_cast(UserIdmInterfaceCode::USER_IDM_DEL_CRED): return DelCredentialStub(data, reply); default: return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/test/unittest/inner_api/src/executor_callback_proxy_test.cpp b/test/unittest/inner_api/src/executor_callback_proxy_test.cpp index 6704d208e..40ce5875f 100644 --- a/test/unittest/inner_api/src/executor_callback_proxy_test.cpp +++ b/test/unittest/inner_api/src/executor_callback_proxy_test.cpp @@ -63,7 +63,7 @@ HWTEST_F(ExecutorCallbackProxyTest, TestOnMessengerReady_002, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorCallbackInterface::ON_MESSENGER_READY); + EXPECT_EQ(code, static_cast(ExecutorCallbackInterfaceCode::ON_MESSENGER_READY)); return OHOS::NO_ERROR; } ); @@ -85,7 +85,7 @@ HWTEST_F(ExecutorCallbackProxyTest, TestOnBeginExecute_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorCallbackInterface::ON_BEGIN_EXECUTE); + EXPECT_EQ(code, static_cast(ExecutorCallbackInterfaceCode::ON_BEGIN_EXECUTE)); EXPECT_TRUE(reply.WriteInt32(SUCCESS)); return OHOS::NO_ERROR; } @@ -108,7 +108,7 @@ HWTEST_F(ExecutorCallbackProxyTest, TestOnEndExecute_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorCallbackInterface::ON_END_EXECUTE); + EXPECT_EQ(code, static_cast(ExecutorCallbackInterfaceCode::ON_END_EXECUTE)); EXPECT_TRUE(reply.WriteInt32(SUCCESS)); return OHOS::NO_ERROR; } @@ -129,7 +129,7 @@ HWTEST_F(ExecutorCallbackProxyTest, TestOnSetProperty_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorCallbackInterface::ON_SET_PROPERTY); + EXPECT_EQ(code, static_cast(ExecutorCallbackInterfaceCode::ON_SET_PROPERTY)); EXPECT_TRUE(reply.WriteInt32(SUCCESS)); return OHOS::NO_ERROR; } @@ -150,14 +150,14 @@ HWTEST_F(ExecutorCallbackProxyTest, TestOnGetProperty_001, TestSize.Level0) .Times(2) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorCallbackInterface::ON_GET_PROPERTY); + EXPECT_EQ(code, static_cast(ExecutorCallbackInterfaceCode::ON_GET_PROPERTY)); EXPECT_TRUE(reply.WriteInt32(SUCCESS)); return OHOS::NO_ERROR; } ) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorCallbackInterface::ON_GET_PROPERTY); + EXPECT_EQ(code, static_cast(ExecutorCallbackInterfaceCode::ON_GET_PROPERTY)); return GENERAL_ERROR; } ); diff --git a/test/unittest/inner_api/src/executor_callback_stub_test.cpp b/test/unittest/inner_api/src/executor_callback_stub_test.cpp index 959bf02d8..5b24cea6d 100644 --- a/test/unittest/inner_api/src/executor_callback_stub_test.cpp +++ b/test/unittest/inner_api/src/executor_callback_stub_test.cpp @@ -53,7 +53,7 @@ HWTEST_F(ExecutorCallbackStubTest, TestOnMessengerReadyStub_001, TestSize.Level0 MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorCallbackInterface::ON_MESSENGER_READY; + uint32_t code = static_cast(ExecutorCallbackInterfaceCode::ON_MESSENGER_READY); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteRemoteObject(messenger->AsObject())); @@ -76,7 +76,7 @@ HWTEST_F(ExecutorCallbackStubTest, TestOnBeginExecuteStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorCallbackInterface::ON_BEGIN_EXECUTE; + uint32_t code = static_cast(ExecutorCallbackInterfaceCode::ON_BEGIN_EXECUTE); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint64(scheduleId)); @@ -98,7 +98,7 @@ HWTEST_F(ExecutorCallbackStubTest, TestOnEndExecuteStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorCallbackInterface::ON_END_EXECUTE; + uint32_t code = static_cast(ExecutorCallbackInterfaceCode::ON_END_EXECUTE); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint64(scheduleId)); @@ -118,7 +118,7 @@ HWTEST_F(ExecutorCallbackStubTest, TestOnSetPropertyStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorCallbackInterface::ON_SET_PROPERTY; + uint32_t code = static_cast(ExecutorCallbackInterfaceCode::ON_SET_PROPERTY); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUInt8Vector(properties)); @@ -137,7 +137,7 @@ HWTEST_F(ExecutorCallbackStubTest, TestOnGetPropertyStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorCallbackInterface::ON_GET_PROPERTY; + uint32_t code = static_cast(ExecutorCallbackInterfaceCode::ON_GET_PROPERTY); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUInt8Vector(condition)); diff --git a/test/unittest/inner_api/src/executor_messenger_proxy_test.cpp b/test/unittest/inner_api/src/executor_messenger_proxy_test.cpp index 6e7e8c565..3250911b4 100644 --- a/test/unittest/inner_api/src/executor_messenger_proxy_test.cpp +++ b/test/unittest/inner_api/src/executor_messenger_proxy_test.cpp @@ -48,7 +48,7 @@ HWTEST_F(ExecutorMessengerProxyTest, TestSendData_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorMessengerInterface::CO_AUTH_SEND_DATA); + EXPECT_EQ(code, static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_SEND_DATA)); EXPECT_TRUE(reply.WriteInt32(SUCCESS)); return OHOS::NO_ERROR; } @@ -86,7 +86,7 @@ HWTEST_F(ExecutorMessengerProxyTest, TestFinish_002, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, ExecutorMessengerInterface::CO_AUTH_FINISH); + EXPECT_EQ(code, static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_FINISH)); EXPECT_TRUE(reply.WriteInt32(SUCCESS)); return OHOS::NO_ERROR; } diff --git a/test/unittest/inner_api/src/executor_messenger_stub_test.cpp b/test/unittest/inner_api/src/executor_messenger_stub_test.cpp index 3fb2bf36f..577563c59 100644 --- a/test/unittest/inner_api/src/executor_messenger_stub_test.cpp +++ b/test/unittest/inner_api/src/executor_messenger_stub_test.cpp @@ -53,7 +53,7 @@ HWTEST_F(ExecutorMessengerStubTest, TestSendDataStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorMessengerInterface::CO_AUTH_SEND_DATA; + uint32_t code = static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_SEND_DATA); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorMessengerInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint64(scheduleId)); @@ -79,7 +79,7 @@ HWTEST_F(ExecutorMessengerStubTest, TestFinishStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = ExecutorMessengerInterface::CO_AUTH_FINISH; + uint32_t code = static_cast(ExecutorMessengerInterfaceCode::CO_AUTH_FINISH); EXPECT_TRUE(data.WriteInterfaceToken(ExecutorMessengerInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint64(scheduleId)); diff --git a/test/unittest/inner_api/src/user_auth_callback_proxy_test.cpp b/test/unittest/inner_api/src/user_auth_callback_proxy_test.cpp index 624fed469..9d32a59f4 100644 --- a/test/unittest/inner_api/src/user_auth_callback_proxy_test.cpp +++ b/test/unittest/inner_api/src/user_auth_callback_proxy_test.cpp @@ -49,7 +49,7 @@ HWTEST_F(UserAuthCallbackProxyTest, TestOnResult_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, UserAuthInterface::USER_AUTH_ON_RESULT); + EXPECT_EQ(code, static_cast(UserAuthInterfaceCode::USER_AUTH_ON_RESULT)); return OHOS::NO_ERROR; } ); @@ -69,7 +69,7 @@ HWTEST_F(UserAuthCallbackProxyTest, TestOnAcquireInfo_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, UserAuthInterface::USER_AUTH_ACQUIRE_INFO); + EXPECT_EQ(code, static_cast(UserAuthInterfaceCode::USER_AUTH_ACQUIRE_INFO)); return OHOS::NO_ERROR; } ); @@ -90,7 +90,7 @@ HWTEST_F(UserAuthCallbackProxyTest, TestOnGetExecutorPropertyResult_001, TestSiz EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, UserAuthInterface::USER_AUTH_GET_EX_PROP); + EXPECT_EQ(code, static_cast(UserAuthInterfaceCode::USER_AUTH_GET_EX_PROP)); return OHOS::NO_ERROR; } ); @@ -110,7 +110,7 @@ HWTEST_F(UserAuthCallbackProxyTest, TestOnSetExecutorPropertyResult_001, TestSiz EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, UserAuthInterface::USER_AUTH_SET_EX_PROP); + EXPECT_EQ(code, static_cast(UserAuthInterfaceCode::USER_AUTH_SET_EX_PROP)); return OHOS::NO_ERROR; } ); diff --git a/test/unittest/inner_api/src/user_auth_callback_stub_test.cpp b/test/unittest/inner_api/src/user_auth_callback_stub_test.cpp index ce63837ed..e291457b7 100644 --- a/test/unittest/inner_api/src/user_auth_callback_stub_test.cpp +++ b/test/unittest/inner_api/src/user_auth_callback_stub_test.cpp @@ -51,7 +51,7 @@ HWTEST_F(UserAuthCallbackStubTest, TestOnResultStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_ON_RESULT; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_ON_RESULT); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(result)); @@ -73,7 +73,7 @@ HWTEST_F(UserAuthCallbackStubTest, TestOnAcquireInfoStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_ACQUIRE_INFO; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_ACQUIRE_INFO); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(module)); @@ -95,7 +95,7 @@ HWTEST_F(UserAuthCallbackStubTest, TestOnGetExecutorPropertyResultStub_001, Test MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_GET_EX_PROP; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_GET_EX_PROP); EXPECT_TRUE(data.WriteInterfaceToken(GetExecutorPropertyCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(result)); @@ -115,7 +115,7 @@ HWTEST_F(UserAuthCallbackStubTest, TestOnSetExecutorPropertyResultStub_001, Test MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_SET_EX_PROP; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_SET_EX_PROP); EXPECT_TRUE(data.WriteInterfaceToken(SetExecutorPropertyCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(result)); diff --git a/test/unittest/inner_api/src/user_idm_callback_proxy_test.cpp b/test/unittest/inner_api/src/user_idm_callback_proxy_test.cpp index 73ac674f5..ab9f96f6e 100644 --- a/test/unittest/inner_api/src/user_idm_callback_proxy_test.cpp +++ b/test/unittest/inner_api/src/user_idm_callback_proxy_test.cpp @@ -49,7 +49,7 @@ HWTEST_F(UserIdmCallbackProxyTest, TestOnResult_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, IdmCallbackInterface::IDM_CALLBACK_ON_RESULT); + EXPECT_EQ(code, static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_RESULT)); return OHOS::NO_ERROR; } ); @@ -69,7 +69,7 @@ HWTEST_F(UserIdmCallbackProxyTest, TestOnAcquireInfo_001, TestSize.Level0) EXPECT_CALL(*obj, SendRequest(_, _, _, _)) .WillOnce( [](uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - EXPECT_EQ(code, IdmCallbackInterface::IDM_CALLBACK_ON_ACQUIRE_INFO); + EXPECT_EQ(code, static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_ACQUIRE_INFO)); return OHOS::NO_ERROR; } ); diff --git a/test/unittest/inner_api/src/user_idm_callback_stub_test.cpp b/test/unittest/inner_api/src/user_idm_callback_stub_test.cpp index a93e6f76e..1bb405628 100644 --- a/test/unittest/inner_api/src/user_idm_callback_stub_test.cpp +++ b/test/unittest/inner_api/src/user_idm_callback_stub_test.cpp @@ -50,7 +50,7 @@ HWTEST_F(UserIdmCallbackStubTest, TestOnResultStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = IdmCallbackInterface::IDM_CALLBACK_ON_RESULT; + uint32_t code = static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_RESULT); EXPECT_TRUE(data.WriteInterfaceToken(IdmCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(result)); @@ -72,7 +72,7 @@ HWTEST_F(UserIdmCallbackStubTest, TestOnAcquireInfoStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = IdmCallbackInterface::IDM_CALLBACK_ON_ACQUIRE_INFO; + uint32_t code = static_cast(IdmCallbackInterfaceCode::IDM_CALLBACK_ON_ACQUIRE_INFO); EXPECT_TRUE(data.WriteInterfaceToken(IdmCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(module)); @@ -91,7 +91,7 @@ HWTEST_F(UserIdmCallbackStubTest, TestOnCredentialInfosStub_001, TestSize.Level0 MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = IdmGetCredInfoCallbackInterface::ON_GET_INFO; + uint32_t code = static_cast(IdmGetCredInfoCallbackInterfaceCode::ON_GET_INFO); EXPECT_TRUE(data.WriteInterfaceToken(IdmGetCredInfoCallbackInterface::GetDescriptor())); @@ -112,7 +112,7 @@ HWTEST_F(UserIdmCallbackStubTest, TestOnCredentialInfosStub_002, TestSize.Level0 MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = IdmGetCredInfoCallbackInterface::ON_GET_INFO; + uint32_t code = static_cast(IdmGetCredInfoCallbackInterfaceCode::ON_GET_INFO); EXPECT_TRUE(data.WriteInterfaceToken(IdmGetCredInfoCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint32(1000)); @@ -134,7 +134,7 @@ HWTEST_F(UserIdmCallbackStubTest, TestOnSecureUserInfoStub_001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = IdmGetSecureUserInfoCallbackInterface::ON_GET_SEC_INFO; + uint32_t code = static_cast(IdmGetSecureUserInfoCallbackInterfaceCode::ON_GET_SEC_INFO); EXPECT_TRUE(data.WriteInterfaceToken(IdmGetSecureUserInfoCallbackInterface::GetDescriptor())); auto service = Common::MakeShared(); @@ -155,7 +155,7 @@ HWTEST_F(UserIdmCallbackStubTest, TestOnSecureUserInfoStub_002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = IdmGetSecureUserInfoCallbackInterface::ON_GET_SEC_INFO; + uint32_t code = static_cast(IdmGetSecureUserInfoCallbackInterfaceCode::ON_GET_SEC_INFO); EXPECT_TRUE(data.WriteInterfaceToken(IdmGetSecureUserInfoCallbackInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint64(20)); diff --git a/test/unittest/services/src/co_auth_stub_test.cpp b/test/unittest/services/src/co_auth_stub_test.cpp index fec6bb50f..3dfcb62b1 100644 --- a/test/unittest/services/src/co_auth_stub_test.cpp +++ b/test/unittest/services/src/co_auth_stub_test.cpp @@ -82,7 +82,7 @@ HWTEST_F(CoAuthStubTest, CoAuthStubTestExecutorRegister001, TestSize.Level0) EXPECT_TRUE(data.WriteUInt8Vector(testInfo.publicKey)); EXPECT_NE(callback->AsObject(), nullptr); EXPECT_TRUE(data.WriteRemoteObject(callback->AsObject())); - uint32_t code = CoAuthInterface::CO_AUTH_EXECUTOR_REGISTER; + uint32_t code = static_cast(CoAuthInterfaceCode::CO_AUTH_EXECUTOR_REGISTER); MessageOption option(MessageOption::TF_SYNC); EXPECT_EQ(SUCCESS, service.OnRemoteRequest(code, data, reply, option)); @@ -96,7 +96,7 @@ HWTEST_F(CoAuthStubTest, CoAuthStubTestExecutorRegister002, TestSize.Level0) MessageParcel data; MessageParcel reply; - uint32_t code = CoAuthInterface::CO_AUTH_EXECUTOR_REGISTER; + uint32_t code = static_cast(CoAuthInterfaceCode::CO_AUTH_EXECUTOR_REGISTER); MessageOption option(MessageOption::TF_SYNC); MockCoAuthService service; @@ -109,7 +109,7 @@ HWTEST_F(CoAuthStubTest, CoAuthStubTestExecutorRegister003, TestSize.Level0) MessageParcel reply; EXPECT_TRUE(data.WriteInterfaceToken(CoAuthInterface::GetDescriptor())); - uint32_t code = CoAuthInterface::CO_AUTH_EXECUTOR_REGISTER; + uint32_t code = static_cast(CoAuthInterfaceCode::CO_AUTH_EXECUTOR_REGISTER); MessageOption option(MessageOption::TF_SYNC); MockCoAuthService service; diff --git a/test/unittest/services/src/user_auth_stub_test.cpp b/test/unittest/services/src/user_auth_stub_test.cpp index 9f18202ac..33587f68e 100644 --- a/test/unittest/services/src/user_auth_stub_test.cpp +++ b/test/unittest/services/src/user_auth_stub_test.cpp @@ -46,7 +46,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubGetAvailableStatusStub001, TestSize.Level MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_GET_AVAILABLE_STATUS; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_GET_AVAILABLE_STATUS); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -75,7 +75,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubGetAvailableStatusStub002, TestSize.Level MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_GET_AVAILABLE_STATUS; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_GET_AVAILABLE_STATUS); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testAuthType)); @@ -93,7 +93,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubGetPropertyStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_GET_PROPERTY; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_GET_PROPERTY); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -134,7 +134,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubGetPropertyStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_GET_PROPERTY; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_GET_PROPERTY); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -151,7 +151,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubSetPropertyStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_SET_PROPERTY; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_SET_PROPERTY); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -191,7 +191,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubSetPropertyStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_SET_PROPERTY; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_SET_PROPERTY); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -208,7 +208,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubAuthStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_AUTH; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -249,7 +249,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubAuthStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_AUTH; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUInt8Vector(testChallenge)); @@ -270,7 +270,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubAuthUserStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_AUTH_USER; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH_USER); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -311,7 +311,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubAuthUserStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_AUTH_USER; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_AUTH_USER); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -332,7 +332,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubIdentifyStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_IDENTIFY; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_IDENTIFY); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -368,7 +368,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubIdentifyStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_IDENTIFY; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_IDENTIFY); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUInt8Vector(testChallenge)); @@ -387,7 +387,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubCancelAuthOrIdentifyStub001, TestSize.Lev MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_CANCEL_AUTH; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_CANCEL_AUTH); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); @@ -412,7 +412,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubCancelAuthOrIdentifyStub002, TestSize.Lev MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_CANCEL_AUTH; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_CANCEL_AUTH); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); EXPECT_TRUE(data.WriteUint64(testContextId)); @@ -440,7 +440,7 @@ HWTEST_F(UserAuthStubTest, UserAuthStubGetVersionStub, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserAuthInterface::USER_AUTH_GET_VERSION; + uint32_t code = static_cast(UserAuthInterfaceCode::USER_AUTH_GET_VERSION); EXPECT_TRUE(data.WriteInterfaceToken(UserAuthInterface::GetDescriptor())); diff --git a/test/unittest/services/src/user_idm_stub_test.cpp b/test/unittest/services/src/user_idm_stub_test.cpp index 11e35e8c0..4b90e175d 100644 --- a/test/unittest/services/src/user_idm_stub_test.cpp +++ b/test/unittest/services/src/user_idm_stub_test.cpp @@ -52,7 +52,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubOpenSessionStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_OPEN_SESSION; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_OPEN_SESSION); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -79,7 +79,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubOpenSessionStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_OPEN_SESSION; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_OPEN_SESSION); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -96,7 +96,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubCloseSessionStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_CLOSE_SESSION; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_CLOSE_SESSION); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -121,7 +121,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubCloseSessionStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_CLOSE_SESSION; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_CLOSE_SESSION); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -134,7 +134,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubGetCredentialInfoStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_GET_CRED_INFO; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_GET_CRED_INFO); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -169,7 +169,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubGetCredentialInfoStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_GET_CRED_INFO; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_GET_CRED_INFO); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -189,7 +189,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubGetSecInfoStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_GET_SEC_INFO; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_GET_SEC_INFO); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -221,7 +221,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubGetSecInfoStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_GET_SEC_INFO; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_GET_SEC_INFO); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -240,7 +240,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubAddCredentialStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_ADD_CREDENTIAL; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_ADD_CREDENTIAL); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -279,7 +279,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubAddCredentialStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_ADD_CREDENTIAL; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_ADD_CREDENTIAL); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -297,7 +297,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubUpdateCredentialStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_UPDATE_CREDENTIAL; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_UPDATE_CREDENTIAL); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -336,7 +336,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubUpdateCredentialStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_UPDATE_CREDENTIAL; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_UPDATE_CREDENTIAL); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -354,7 +354,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubCancelStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_CANCEL; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_CANCEL); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -379,7 +379,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubCancelStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_CANCEL; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_CANCEL); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -396,7 +396,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubEnforceDelUserStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_ENFORCE_DEL_USER; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_ENFORCE_DEL_USER); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -428,7 +428,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubEnforceDelUserStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_ENFORCE_DEL_USER; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_ENFORCE_DEL_USER); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -447,7 +447,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubDelUserStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_DEL_USER; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_DEL_USER); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -481,7 +481,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubDelUserStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_DEL_USER; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_DEL_USER); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId)); @@ -497,7 +497,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubDelCredentialStub001, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_DEL_CRED; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_DEL_CRED); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); @@ -533,7 +533,7 @@ HWTEST_F(UserIdmStubTest, UserIdmStubDelCredentialStub002, TestSize.Level0) MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - uint32_t code = UserIdmInterface::USER_IDM_DEL_CRED; + uint32_t code = static_cast(UserIdmInterfaceCode::USER_IDM_DEL_CRED); EXPECT_TRUE(data.WriteInterfaceToken(UserIdmInterface::GetDescriptor())); EXPECT_TRUE(data.WriteInt32(testUserId));