From b3f8edfd9609fe00afeb4924316fdc02344bcfba Mon Sep 17 00:00:00 2001 From: wenkaisong Date: Mon, 19 Jun 2023 22:00:51 +0800 Subject: [PATCH] fix: standardize ipc code Signed-off-by: wenkaisong --- CODEOWNERS | 18 ++++++++++ .../include/dslm_service_ipc_interface_code.h | 36 +++++++++++++++++++ common/include/idevice_security_level.h | 7 ++-- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 CODEOWNERS create mode 100644 common/include/dslm_service_ipc_interface_code.h diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..66a3225 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,18 @@ +/* + * 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 common/include/dslm_service_ipc_interface_code.h + # needs to be reviewed by @leonchan5 +common/include/dslm_service_ipc_interface_code.h @leonchan5 diff --git a/common/include/dslm_service_ipc_interface_code.h b/common/include/dslm_service_ipc_interface_code.h new file mode 100644 index 0000000..6da8541 --- /dev/null +++ b/common/include/dslm_service_ipc_interface_code.h @@ -0,0 +1,36 @@ +/* + * 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 DSLM_SERVICE_IPC_INTERFACE_CODE_H +#define DSLM_SERVICE_IPC_INTERFACE_CODE_H + +#include + +/* SAID: 3511 */ +namespace OHOS { +namespace Security { +namespace DeviceSecurityLevel { +enum class DeviceSecurityLevelInterfaceCode { + CMD_GET_DEVICE_SECURITY_LEVEL = 1, +}; + +enum class DeviceSecurityLevelCallbackInterfaceCode { + CMD_SET_DEVICE_SECURITY_LEVEL = 1, +}; +} // namespace DeviceSecurityLevel +} // namespace Security +} // namespace OHOS + +#endif // DSLM_SERVICE_IPC_INTERFACE_CODE_H diff --git a/common/include/idevice_security_level.h b/common/include/idevice_security_level.h index 0a84d08..209213a 100644 --- a/common/include/idevice_security_level.h +++ b/common/include/idevice_security_level.h @@ -19,6 +19,7 @@ #include #include +#include "dslm_service_ipc_interface_code.h" #include "iremote_broker.h" #include "message_parcel.h" @@ -29,17 +30,19 @@ constexpr int32_t DEVICE_SECURITY_LEVEL_MANAGER_SA_ID = 3511; class IDeviceSecurityLevel : public IRemoteBroker { public: + using InterfaceCode = DeviceSecurityLevelInterfaceCode; DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.DeviceSecurityLevel"); enum { - CMD_GET_DEVICE_SECURITY_LEVEL = 1, + CMD_GET_DEVICE_SECURITY_LEVEL = static_cast(InterfaceCode::CMD_GET_DEVICE_SECURITY_LEVEL), }; }; class IDeviceSecurityLevelCallback : public IRemoteBroker { public: + using InterfaceCode = DeviceSecurityLevelCallbackInterfaceCode; DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.DeviceSecurityLevel.Callback"); enum { - CMD_SET_DEVICE_SECURITY_LEVEL = 1, + CMD_SET_DEVICE_SECURITY_LEVEL = static_cast(InterfaceCode::CMD_SET_DEVICE_SECURITY_LEVEL), }; }; } // namespace DeviceSecurityLevel