1 /*
2  * Copyright (c) 2022 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 "access_event_handler.h"
17 
18 #include "accesstoken_log.h"
19 
20 namespace OHOS {
21 namespace Security {
22 namespace AccessToken {
23 namespace {
24 static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {
25     LOG_CORE, SECURITY_DOMAIN_ACCESSTOKEN, "AccessEventHandler"};
26 }
AccessEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> & runner)27 AccessEventHandler::AccessEventHandler(
28     const std::shared_ptr<AppExecFwk::EventRunner>& runner)
29     : AppExecFwk::EventHandler(runner)
30 {
31     ACCESSTOKEN_LOG_INFO(LABEL, "Enter");
32 }
33 AccessEventHandler::~AccessEventHandler() = default;
34 
ProxyPostTask(const Callback & callback,int64_t delayTime)35 bool AccessEventHandler::ProxyPostTask(const Callback &callback, int64_t delayTime)
36 {
37     ACCESSTOKEN_LOG_DEBUG(LABEL, "PostTask without name");
38     return AppExecFwk::EventHandler::PostTask(callback, delayTime);
39 }
40 
ProxyPostTask(const Callback & callback,const std::string & name,int64_t delayTime)41 bool AccessEventHandler::ProxyPostTask(
42     const Callback &callback, const std::string &name, int64_t delayTime)
43 {
44     ACCESSTOKEN_LOG_DEBUG(LABEL, "PostTask with name");
45     return AppExecFwk::EventHandler::PostTask(callback, name, delayTime);
46 }
47 
ProxyRemoveTask(const std::string & name)48 void AccessEventHandler::ProxyRemoveTask(const std::string &name)
49 {
50     AppExecFwk::EventHandler::RemoveTask(name);
51 }
52 }  // namespace AccessToken
53 }  // namespace Security
54 }  // namespace OHOS