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 {
ConnectAbility(const Want & want,const CommonEventData & event,const sptr<IRemoteObject> & callerToken,const int32_t & userId)40 int AbilityManagerHelper::ConnectAbility(
41 const Want &want, const CommonEventData &event, const sptr<IRemoteObject> &callerToken, const int32_t &userId)
42 {
43 g_isConnectAbilityCalled = true;
44 return 0;
45 }
46
GetAbilityMgrProxy()47 bool AbilityManagerHelper::GetAbilityMgrProxy()
48 {
49 return true;
50 }
51
Clear()52 void AbilityManagerHelper::Clear()
53 {
54 g_isClearCalled = true;
55 }
56
DisconnectServiceAbilityDelay(const sptr<StaticSubscriberConnection> & connection)57 void AbilityManagerHelper::DisconnectServiceAbilityDelay(const sptr<StaticSubscriberConnection> &connection)
58 {
59 }
60 } // namespace EventFwk
61 } // namespace OHOS
62