• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "system_cmd_channel_service_impl.h"
17 
18 #include "global.h"
19 #include "ime_system_channel.h"
20 #include "ipc_object_stub.h"
21 #include "ipc_skeleton.h"
22 #include "ipc_types.h"
23 #include "itypes_util.h"
24 #include "message.h"
25 
26 namespace OHOS {
27 namespace MiscServices {
SystemCmdChannelServiceImpl()28 SystemCmdChannelServiceImpl::SystemCmdChannelServiceImpl() {}
29 
~SystemCmdChannelServiceImpl()30 SystemCmdChannelServiceImpl::~SystemCmdChannelServiceImpl() {}
31 
SendPrivateCommand(const Value & value)32 ErrCode SystemCmdChannelServiceImpl::SendPrivateCommand(const Value &value)
33 {
34     std::unordered_map<std::string, PrivateDataValue> privateCommand;
35     privateCommand = value.valueMap;
36     auto channel = ImeSystemCmdChannel::GetInstance();
37     if (channel == nullptr) {
38         return ErrorCode::ERROR_NULL_POINTER;
39     }
40     return channel->ReceivePrivateCommand(privateCommand);
41 }
42 
NotifyPanelStatus(const SysPanelStatus & sysPanelStatus)43 ErrCode SystemCmdChannelServiceImpl::NotifyPanelStatus(const SysPanelStatus &sysPanelStatus)
44 {
45     auto channel = ImeSystemCmdChannel::GetInstance();
46     if (channel == nullptr) {
47         return ErrorCode::ERROR_NULL_POINTER;
48     }
49     return channel->NotifyPanelStatus(sysPanelStatus);
50 }
51 } // namespace MiscServices
52 } // namespace OHOS