1 /*
2 * Copyright (C) 2024 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 "call_ability_connection.h"
17
18 #include "telephony_log_wrapper.h"
19
20 namespace OHOS {
21 namespace Telephony {
22 constexpr int32_t PARAM_NUM = 3;
23
OnAbilityConnectDone(const AppExecFwk::ElementName & element,const sptr<IRemoteObject> & remoteObject,int32_t resultCode)24 void CallAbilityConnection::OnAbilityConnectDone(const AppExecFwk::ElementName &element,
25 const sptr<IRemoteObject> &remoteObject, int32_t resultCode)
26 {
27 TELEPHONY_LOGI("OnAbilityConnectDone, resultCode = %{public}d", resultCode);
28 MessageParcel data;
29 MessageParcel reply;
30 MessageOption option;
31 data.WriteInt32(PARAM_NUM);
32 data.WriteString16(u"bundleName");
33 data.WriteString16(u"com.ohos.callui");
34 data.WriteString16(u"abilityName");
35 data.WriteString16(u"com.ohos.callui.CallFailedDialogAbility");
36 data.WriteString16(u"parameters");
37 data.WriteString16(Str8ToStr16(commandStr_));
38 int32_t sendRequestRet = remoteObject->SendRequest(AAFwk::IAbilityConnection::ON_ABILITY_CONNECT_DONE,
39 data, reply, option);
40 TELEPHONY_LOGI("OnAbilityConnectDone, sendRequestRet = %{public}d", sendRequestRet);
41 }
42
OnAbilityDisconnectDone(const AppExecFwk::ElementName & element,int32_t resultCode)43 void CallAbilityConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element,
44 int32_t resultCode)
45 {
46 TELEPHONY_LOGI("OnAbilityDisconnectDone, resultCode = %{public}d", resultCode);
47 }
48 } // namespace Telephony
49 } // namespace OHOS