1 /*
2 * Copyright (c) 2022-2023 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 "ability_manager_helper.h"
17
18 namespace {
19 bool g_isConnectAbilityCalled = false;
20 bool g_isClearCalled = false;
21 }
IsConnectAbilityCalled()22 bool IsConnectAbilityCalled()
23 {
24 return g_isConnectAbilityCalled;
25 }
26
IsClearCalled()27 bool IsClearCalled()
28 {
29 return g_isClearCalled;
30 }
31
ResetAbilityManagerHelperState()32 void ResetAbilityManagerHelperState()
33 {
34 g_isConnectAbilityCalled = false;
35 g_isClearCalled = false;
36 }
37
38 namespace OHOS {
39 namespace EventFwk {
AbilityManagerHelper()40 AbilityManagerHelper::AbilityManagerHelper() {}
ConnectAbility(const Want & want,const CommonEventData & event,const sptr<IRemoteObject> & callerToken,const int32_t & userId)41 int AbilityManagerHelper::ConnectAbility(
42 const Want &want, const CommonEventData &event, const sptr<IRemoteObject> &callerToken, const int32_t &userId)
43 {
44 g_isConnectAbilityCalled = true;
45 return 0;
46 }
47
GetAbilityMgrProxy()48 bool AbilityManagerHelper::GetAbilityMgrProxy()
49 {
50 return true;
51 }
52
Clear()53 void AbilityManagerHelper::Clear()
54 {
55 g_isClearCalled = true;
56 }
57
DisconnectServiceAbilityDelay(const sptr<StaticSubscriberConnection> & connection,const std::string & action)58 void AbilityManagerHelper::DisconnectServiceAbilityDelay(
59 const sptr<StaticSubscriberConnection> &connection, const std::string &action)
60 {}
61 } // namespace EventFwk
62 } // namespace OHOS
63