• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2025 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 #ifndef CONCURRENT_TASK_SERVICES_CONCURRENTSEVICE_INCLUDE_CONCURRENT_TASK_SEVICE_H
17 #define CONCURRENT_TASK_SERVICES_CONCURRENTSEVICE_INCLUDE_CONCURRENT_TASK_SEVICE_H
18 
19 #include <unordered_map>
20 #include "concurrent_task_type.h"
21 #include "concurrent_task_idl_types.h"
22 #include "concurrent_task_service_stub.h"
23 
24 namespace OHOS {
25 namespace ConcurrentTask {
26 class ConcurrentTaskService : public ConcurrentTaskServiceStub {
27 public:
ConcurrentTaskService()28     ConcurrentTaskService() {}
29     ~ConcurrentTaskService() override = default;
30 
31     ErrCode ReportData(uint32_t resType, int64_t value,
32                        const std::unordered_map<std::string, std::string>& payload) override;
33     ErrCode ReportSceneInfo(uint32_t type, const std::unordered_map<std::string, std::string>& payload) override;
34     ErrCode QueryInterval(int queryItem, IpcIntervalReply& IpcQueryRs) override;
35     ErrCode QueryDeadline(int queryItem, const IpcDeadlineReply& IpcDdlReply,
36                           const std::unordered_map<std::string, std::string>& payload) override;
37     ErrCode SetAudioDeadline(int queryItem, int tid, int grpId, IpcIntervalReply& IpcQueryRs) override;
38     ErrCode RequestAuth(const std::unordered_map<std::string, std::string>& payload) override;
39 
40     IntervalReply IpcToQueryRs(const IpcIntervalReply& IpcQueryRs);
41     IpcIntervalReply QueryRsToIpc(const IntervalReply& queryRs);
42     DeadlineReply IpcToDdlReply(const IpcDeadlineReply& IpcDdlReply);
43 private:
44     DISALLOW_COPY_AND_MOVE(ConcurrentTaskService);
45 };
46 } // namespace ConcurrentTask
47 } // namespace OHOS
48 
49 #endif // CONCURRENT_TASK_SERVICES_CONCURRENTSEVICE_INCLUDE_CONCURRENT_TASK_SEVICE_H
50