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_common_log.h"
19
20 namespace OHOS {
21 namespace Security {
22 namespace AccessToken {
23
AccessEventHandler(const std::shared_ptr<AppExecFwk::EventRunner> & runner)24 AccessEventHandler::AccessEventHandler(
25 const std::shared_ptr<AppExecFwk::EventRunner>& runner)
26 : AppExecFwk::EventHandler(runner)
27 {
28 LOGI(ATM_DOMAIN, ATM_TAG, "Enter");
29 }
30 AccessEventHandler::~AccessEventHandler() = default;
31
ProxyPostTask(const Callback & callback,int64_t delayTime)32 bool AccessEventHandler::ProxyPostTask(const Callback &callback, int64_t delayTime)
33 {
34 LOGD(ATM_DOMAIN, ATM_TAG, "PostTask without name");
35 return AppExecFwk::EventHandler::PostTask(callback, delayTime);
36 }
37
ProxyPostTask(const Callback & callback,const std::string & name,int64_t delayTime)38 bool AccessEventHandler::ProxyPostTask(
39 const Callback &callback, const std::string &name, int64_t delayTime)
40 {
41 LOGD(ATM_DOMAIN, ATM_TAG, "PostTask with name");
42 return AppExecFwk::EventHandler::PostTask(callback, name, delayTime);
43 }
44
ProxyRemoveTask(const std::string & name)45 void AccessEventHandler::ProxyRemoveTask(const std::string &name)
46 {
47 AppExecFwk::EventHandler::RemoveTask(name);
48 }
49 } // namespace AccessToken
50 } // namespace Security
51 } // namespace OHOS