mirror of
https://github.com/openharmony/applications_call.git
synced 2026-07-01 20:24:03 -04:00
@@ -16,7 +16,6 @@
|
||||
apiType: 'faMode',
|
||||
showInServiceCenter: false,
|
||||
buildOption: {
|
||||
arkEnable: true,
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = require('@ohos/hvigor-ohos-plugin'). legacyHapTasks
|
||||
module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks
|
||||
@@ -54,7 +54,7 @@ export default class CallManagerService {
|
||||
commonEvent.createSubscriber({
|
||||
events
|
||||
}, (err, data) => {
|
||||
HiLog.i(TAG, "addSubscriber %s")
|
||||
HiLog.i(TAG, "addSubscriber")
|
||||
resolve(data);
|
||||
});
|
||||
});
|
||||
@@ -77,7 +77,7 @@ export default class CallManagerService {
|
||||
}
|
||||
subscriber.finishCommonEvent()
|
||||
.then(() => {
|
||||
HiLog.i(TAG, "addSubscriber finishCommonEvent : %s")
|
||||
HiLog.i(TAG, "addSubscriber finishCommonEvent")
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -146,7 +146,7 @@ export default class CallManagerService {
|
||||
parameters: callData
|
||||
}
|
||||
}).then((data) => {
|
||||
HiLog.i(TAG, "callUI service PA.startAbility data : %s")
|
||||
HiLog.i(TAG, "callUI service PA.startAbility data : %s" + JSON.stringify(data))
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG, "callUI service PA.startAbility err : %s" + JSON.stringify(err))
|
||||
});
|
||||
@@ -184,7 +184,7 @@ export default class CallManagerService {
|
||||
isOrdered: false,
|
||||
data: JSON.stringify(callData)
|
||||
}, (res) => {
|
||||
HiLog.i(TAG, "callUI service commonEvent.publish callback res : %s")
|
||||
HiLog.i(TAG, "callUI service commonEvent.publish callback res")
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ export default class TelephonyApi {
|
||||
public registerCallStateCallback(callBack) {
|
||||
call.on('callDetailsChange', (data) => {
|
||||
if (!data) {
|
||||
HiLog.i(TAG,prefixLog + 'call.on registerCallStateCallback' + JSON.stringify(data))
|
||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback" + JSON.stringify(data))
|
||||
return;
|
||||
}
|
||||
HiLog.i(TAG,prefixLog + 'call.on registerCallStateCallback callState: ' + JSON.stringify(data.callState))
|
||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback callState :" + JSON.stringify(data.callState))
|
||||
callBack(data);
|
||||
});
|
||||
}
|
||||
@@ -47,10 +47,10 @@ export default class TelephonyApi {
|
||||
public unRegisterCallStateCallback() {
|
||||
call.off('callDetailsChange', (data) => {
|
||||
if (!data) {
|
||||
HiLog.i(TAG,prefixLog + 'call.off unRegisterCallStateCallback' + JSON.stringify(data))
|
||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback" + JSON.stringify(data))
|
||||
return;
|
||||
}
|
||||
HiLog.i(TAG,prefixLog + 'call.off unRegisterCallStateCallback')
|
||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export default class TelephonyApi {
|
||||
*/
|
||||
public acceptCall = function (callId) {
|
||||
call.answer(callId).then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "call.answer : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.answer")
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
|
||||
})
|
||||
@@ -79,7 +79,7 @@ export default class TelephonyApi {
|
||||
public rejectCall = function (callId, isSendSms = false, msg = '') {
|
||||
const rejectCallPromise = isSendSms ? call.reject(callId, {messageContent: msg}) : call.reject(callId);
|
||||
rejectCallPromise.then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:rejectCall : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:rejectCall")
|
||||
})
|
||||
.catch((err) => {
|
||||
HiLog.i(TAG, prefixLog + "catch:rejectCall : %s" + JSON.stringify(err))
|
||||
@@ -96,7 +96,7 @@ export default class TelephonyApi {
|
||||
public hangUpCall = (callId) => new Promise((resolve, reject) => {
|
||||
call.hangup(callId).then((res) => {
|
||||
resolve(res);
|
||||
HiLog.i(TAG, prefixLog + "then:hangUpCall : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
HiLog.i(TAG, prefixLog + "catch:hangUpCall : %s" + JSON.stringify(err))
|
||||
|
||||
@@ -30,7 +30,7 @@ export default struct BottomBtn {
|
||||
private imageList;
|
||||
|
||||
public aboutToAppear(callData, callList, callTimeList): void {
|
||||
HiLog.i(TAG, "aboutToAppear : ");
|
||||
HiLog.i(TAG, "aboutToAppear :");
|
||||
this.getImageList();
|
||||
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
||||
}
|
||||
@@ -60,7 +60,7 @@ export default struct BottomBtn {
|
||||
*/
|
||||
onHangUp() {
|
||||
this.mCallServiceProxy.hangUpCall(this.callData.callId);
|
||||
HiLog.i(TAG, "onHangUp this.callData.callId : ");
|
||||
HiLog.i(TAG, "onHangUp this.callData.callId :");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ export default struct DtmfBtn {
|
||||
*/
|
||||
onBtnTouchStart(obj) {
|
||||
this.mCallServiceProxy.startDTMF(this.callData.callId, String(obj.value));
|
||||
HiLog.i(TAG, "onBtnTouchStart : ");
|
||||
HiLog.i(TAG, "onBtnTouchStart :");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ export default struct DtmfBtn {
|
||||
*/
|
||||
onBtnTouchEnd() {
|
||||
this.mCallServiceProxy.stopDTMF(this.callData.callId);
|
||||
HiLog.i(TAG, "onBtnTouchEnd : ");
|
||||
HiLog.i(TAG, "onBtnTouchEnd :");
|
||||
}
|
||||
|
||||
build() {
|
||||
@@ -87,11 +87,13 @@ export default struct DtmfBtn {
|
||||
if (event.type === TouchType.Down) {
|
||||
this.color = "rgba(255, 255, 255, 0.4)"
|
||||
this.textInput = this.textInput + this.item.value
|
||||
if(this.textInput.length > 35) {
|
||||
this.subStr = this.textInput.substr(this.textInput.length-35,this.textInput.length-1)
|
||||
this.textInputValue = this.subStr
|
||||
} else {
|
||||
this.textInputValue = this.textInput
|
||||
if (this.textInput != null) {
|
||||
if(this.textInput.length > 35) {
|
||||
this.subStr = this.textInput.substr(this.textInput.length-35,this.textInput.length-1)
|
||||
this.textInputValue = this.subStr
|
||||
} else {
|
||||
this.textInputValue = this.textInput
|
||||
}
|
||||
}
|
||||
AppStorage.SetOrCreate("textInputValue",this.textInputValue)
|
||||
AppStorage.SetOrCreate("TextInput",this.textInput)
|
||||
|
||||
@@ -47,7 +47,7 @@ export default struct FuncBtn {
|
||||
* Button group change picture
|
||||
*/
|
||||
changeBtn(type) {
|
||||
HiLog.i(TAG, "changeBtn type : %s");
|
||||
HiLog.i(TAG, "changeBtn type : %s" + type);
|
||||
const BtnName = ['record', 'keep', 'video', 'mute'];
|
||||
if (Method.includes(BtnName, type)) {
|
||||
this.isActive = !this.isActive;
|
||||
@@ -73,12 +73,12 @@ export default struct FuncBtn {
|
||||
return '';
|
||||
}
|
||||
this.textColor = 'rgb(255, 255, 255)';
|
||||
HiLog.i(TAG, "iconClassName this.isDisable : " );
|
||||
HiLog.i(TAG, "iconClassName this.isDisable :");
|
||||
return 'default';
|
||||
}
|
||||
|
||||
private aboutToAppear(): void {
|
||||
HiLog.i(TAG, "aboutToAppear ");
|
||||
HiLog.i(TAG, "aboutToAppear");
|
||||
this.iconClassName();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ export default struct FuncBtnGroup {
|
||||
this.getBtnListCall()
|
||||
this.btnList = this.btnListCall
|
||||
this.updateBtnList()
|
||||
HiLog.i(TAG, "aboutToAppear : ");
|
||||
HiLog.i(TAG, "aboutToAppear :");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +78,7 @@ export default struct FuncBtnGroup {
|
||||
}else{
|
||||
this.btnList = this.btnListCall
|
||||
}
|
||||
HiLog.i(TAG, "upData BtnList : %s");
|
||||
HiLog.i(TAG, "upData BtnList");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ export default struct FuncBtnGroup {
|
||||
this.btnListDialing = this.mClone.clone(this.mBtnGroupConfig.btnGroupList);
|
||||
this.btnListDialing[1].isDisable = true
|
||||
this.btnListDialing[2].isDisable = true
|
||||
HiLog.i(TAG, "get btnListCall : %s");
|
||||
HiLog.i(TAG, "get btnListCall");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ export default struct FuncBtnGroup {
|
||||
* @param {Object} callData - call data
|
||||
*/
|
||||
onCallStateChange(newVal) {
|
||||
HiLog.i(TAG, "Calling status changed : %s");
|
||||
HiLog.i(TAG, "Calling status changed : %s" + JSON.stringify(newVal));
|
||||
const BtnName= ['video', 'record', 'add', 'mute', 'contact']
|
||||
if (this.callList.length >= 2 && this.callList.every((v) =>
|
||||
v.conferenceState !== ConferenceConst.TEL_CONFERENCE_ACTIVE)) {
|
||||
@@ -131,7 +131,7 @@ export default struct FuncBtnGroup {
|
||||
* @param {Object} obj - object
|
||||
*/
|
||||
btnClick(obj) {
|
||||
HiLog.i(TAG, "btnClick get icon type : %s");
|
||||
HiLog.i(TAG, "btnClick get icon type : %s" + JSON.stringify(obj));
|
||||
const BtnName= ['record', 'keep', 'video', 'mute']
|
||||
const type = obj.type;
|
||||
const { callId } = this.callData;
|
||||
@@ -202,7 +202,7 @@ export default struct FuncBtnGroup {
|
||||
*/
|
||||
keepHandle(type) {
|
||||
const awaitIsActive = this.btnList.find((v) => v.type === type).isActive;
|
||||
HiLog.i(TAG, "keep handle %s");
|
||||
HiLog.i(TAG, "keep handle");
|
||||
awaitIsActive ? this.mCallServiceProxy.holdCall(this.callData.callId) : this.mCallServiceProxy.unHoldCall(this.callData.callId);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ export default struct FuncBtnGroup {
|
||||
*/
|
||||
muteHandle(type) {
|
||||
const awaitIsActive = this.btnList.find((v) => v.type === type).isActive;
|
||||
HiLog.i(TAG, "mute Handle %s");
|
||||
HiLog.i(TAG, "mute Handle");
|
||||
awaitIsActive ? this.mCallServiceProxy.setMuted() : this.mCallServiceProxy.cancelMuted();
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ export default struct FuncBtnGroup {
|
||||
* Clear timer
|
||||
*/
|
||||
onDestroy() {
|
||||
HiLog.i(TAG, "onDestroy %s");
|
||||
HiLog.i(TAG, "onDestroy");
|
||||
this.timer && clearInterval(this.timer);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ export default struct InComDialog {
|
||||
.onClick(() => {
|
||||
this.controller.close();
|
||||
this.confirm(item)
|
||||
HiLog.i(TAG, "onClick and confirm : %s");
|
||||
HiLog.i(TAG, "onClick and confirm");
|
||||
})
|
||||
|
||||
if (item.id !== 4) {
|
||||
@@ -73,7 +73,7 @@ export default struct InComDialog {
|
||||
}
|
||||
.margin({ top: 8, bottom: 16 })
|
||||
.onClick(() => {
|
||||
HiLog.i(TAG, "onClick %s");
|
||||
HiLog.i(TAG, "onClick");
|
||||
this.controller.close();
|
||||
})
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ export default struct IncomingCom {
|
||||
cancel: () => {
|
||||
},
|
||||
confirm: (item) => {
|
||||
HiLog.i(TAG, "confirm : %s");
|
||||
this.msgItemClick(item);
|
||||
},
|
||||
cancelHandle: () => {
|
||||
@@ -93,7 +92,7 @@ export default struct IncomingCom {
|
||||
resourceManager.getResourceManager().then(result => {
|
||||
result.getString(obj.msg.id, (err, typeName) => {
|
||||
content = typeName
|
||||
HiLog.i(TAG, "sendMessage resourceManager.getResourceManager : ");
|
||||
HiLog.i(TAG, "sendMessage resourceManager.getResourceManager :");
|
||||
return new Promise(function (resolve, reject) {
|
||||
sms.sendMessage({
|
||||
slotId: slotId,
|
||||
@@ -172,7 +171,7 @@ export default struct IncomingCom {
|
||||
duration: 2000,
|
||||
});
|
||||
this.mCallServiceProxy.rejectCall(this.callData.callId, obj.msg);
|
||||
HiLog.i(TAG, "msgItemClick : ");
|
||||
HiLog.i(TAG, "msgItemClick :");
|
||||
})
|
||||
})
|
||||
} else {
|
||||
@@ -195,10 +194,10 @@ export default struct IncomingCom {
|
||||
const {callId, callState} = this.callData;
|
||||
if (callState !== CallStateConst.CALL_STATUS_WAITING) {
|
||||
this.mCallServiceProxy.rejectCall(callId);
|
||||
HiLog.i(TAG, "onReject this.mCallServiceProxy.rejectCall : ");
|
||||
HiLog.i(TAG, "onReject this.mCallServiceProxy.rejectCall :");
|
||||
} else {
|
||||
this.mCallServiceProxy.hangUpCall(callId);
|
||||
HiLog.i(TAG, "onReject this.mCallServiceProxy.hangUpCall : ");
|
||||
HiLog.i(TAG, "onReject this.mCallServiceProxy.hangUpCall :");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +205,7 @@ export default struct IncomingCom {
|
||||
* Enable the SMS reply pop-up
|
||||
*/
|
||||
private btnClick(type) {
|
||||
HiLog.i(TAG, "btnClick : %s");
|
||||
HiLog.i(TAG, "btnClick : %s" + JSON.stringify(type));
|
||||
if (type === 'msg') {
|
||||
this.msgDialogController.open();
|
||||
}
|
||||
@@ -216,7 +215,7 @@ export default struct IncomingCom {
|
||||
* Answer the phone interface
|
||||
*/
|
||||
private onAnswer() {
|
||||
HiLog.i(TAG, "onAnswer : ");
|
||||
HiLog.i(TAG, "onAnswer :");
|
||||
this.mCallServiceProxy.acceptCall(this.callData.callId);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class CallDataManager {
|
||||
public update(callData) {
|
||||
const { callState, callId } = callData;
|
||||
const targetObj = this.callList.find((v) => v.callId === callId);
|
||||
HiLog.i(TAG, "update : ")
|
||||
HiLog.i(TAG, "update :")
|
||||
if (targetObj) {
|
||||
Object.assign(targetObj, {
|
||||
...callData
|
||||
@@ -124,7 +124,7 @@ export default class CallDataManager {
|
||||
*/
|
||||
updateCallTimeList(callData) {
|
||||
const CallTimeObj = this.callTimeList.find((v) => v.callId === callData.callId);
|
||||
HiLog.i(TAG, "updateCallTimeList : %s")
|
||||
HiLog.i(TAG, "updateCallTimeList : %s" + JSON.stringify(CallTimeObj))
|
||||
if (!CallTimeObj && callData.callState === CallStateConst.CALL_STATUS_ACTIVE) {
|
||||
const obj = {
|
||||
callId: callData.callId,
|
||||
@@ -134,7 +134,7 @@ export default class CallDataManager {
|
||||
};
|
||||
this.callTimeList.push(obj);
|
||||
AppStorage.SetOrCreate("CallTimeList", this.callTimeList)
|
||||
HiLog.i(TAG, "updateCallTimeList : %s")
|
||||
HiLog.i(TAG, "updateCallTimeList : %s" + JSON.stringify(this.callTimeList))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export default class CallManager {
|
||||
featureAbility.getWant().then((want) => {
|
||||
if (want && want.parameters && ('callState' in want.parameters)) {
|
||||
this.update(want.parameters);
|
||||
HiLog.i(TAG, "initCallData featureAbility.getWant : %s")
|
||||
HiLog.i(TAG, "initCallData featureAbility.getWant :")
|
||||
} else {
|
||||
this.mCallServiceProxy.publish({
|
||||
key: 'getInitCallData',
|
||||
@@ -78,7 +78,7 @@ export default class CallManager {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
HiLog.i(TAG, "initCallData catch error : %s" + JSON.stringify(error))
|
||||
HiLog.i(TAG, "initCallData catch error : %s" + JSON.stringify(error))
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,14 +99,13 @@ export default class CallManager {
|
||||
commonEvent.subscribe(subscriber, (err, res) => {
|
||||
if (err.code === 0) {
|
||||
const callData = JSON.parse(res.data);
|
||||
this.callData = callData
|
||||
HiLog.i(TAG, "commonEvent subscribe : %s")
|
||||
HiLog.i(TAG, "commonEvent subscribe : %s" + JSON.stringify(subscriber))
|
||||
if (callData) {
|
||||
this.callData = callData
|
||||
this.update(callData);
|
||||
}
|
||||
HiLog.i(TAG, "commonEvent subscribe : %s")
|
||||
} else {
|
||||
HiLog.i(TAG, "commonEvent.subscribe err: %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, "commonEvent.subscribe err : %s" + JSON.stringify(err))
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -137,7 +136,7 @@ export default class CallManager {
|
||||
AppStorage.SetOrCreate("AccountNumber", data)
|
||||
}
|
||||
});
|
||||
HiLog.i(TAG, "update : ")
|
||||
HiLog.i(TAG, "update :")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@ export default class CallServiceProxy {
|
||||
* Make a phone call
|
||||
*/
|
||||
public dialCall(phoneNumber, accountId = 0, videoState = 0, dialScene = 0) {
|
||||
HiLog.i(TAG, "dialCall phoneNumber : ")
|
||||
HiLog.i(TAG, "dialCall phoneNumber :")
|
||||
return call.dial(phoneNumber, {
|
||||
accountId,
|
||||
videoState,
|
||||
@@ -68,7 +68,7 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public acceptCall = function (callId) {
|
||||
call.answer(callId).then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "call.answer : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.answer : %s" + JSON.stringify(callId))
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
|
||||
});
|
||||
@@ -86,7 +86,7 @@ export default class CallServiceProxy {
|
||||
public rejectCall = function (callId, isSendSms = false, msg = '') {
|
||||
const rejectCallPromise = isSendSms ? call.reject(callId, {messageContent: msg}) : call.reject(callId);
|
||||
rejectCallPromise.then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:rejectCall : %s")
|
||||
HiLog.i(TAG,prefixLog + "then:rejectCall")
|
||||
})
|
||||
.catch((err) => {
|
||||
HiLog.i(TAG, prefixLog + "catch:rejectCall : %s" + JSON.stringify(err))
|
||||
@@ -103,7 +103,7 @@ export default class CallServiceProxy {
|
||||
public hangUpCall = (callId) => new Promise((resolve, reject) => {
|
||||
call.hangup(callId).then((res) => {
|
||||
resolve(res);
|
||||
HiLog.i(TAG, prefixLog + "then:hangUpCall : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
HiLog.i(TAG, prefixLog + "catch:hangUpCall : %s" + JSON.stringify(err))
|
||||
@@ -120,11 +120,11 @@ export default class CallServiceProxy {
|
||||
public holdCall = (callId) => new Promise((resolve, reject) => {
|
||||
call.holdCall(callId).then((res) => {
|
||||
resolve(res);
|
||||
HiLog.i(TAG,prefixLog + "then:holdCall : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:holdCall : %s" + JSON.stringify(callId))
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
HiLog.i(TAG,prefixLog + "catch:holdCall : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:holdCall : %s" + JSON.stringify(err))
|
||||
});
|
||||
});
|
||||
|
||||
@@ -138,11 +138,11 @@ export default class CallServiceProxy {
|
||||
public unHoldCall = (callId) => new Promise((resolve, reject) => {
|
||||
call.unHoldCall(callId).then((res) => {
|
||||
resolve(res);
|
||||
HiLog.i(TAG,prefixLog + "then:unHoldCall : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:holdCall : %s" + JSON.stringify(callId))
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
HiLog.i(TAG,prefixLog + "catch:unHoldCall : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:unHoldCall : %s" + JSON.stringify(err))
|
||||
});
|
||||
});
|
||||
|
||||
@@ -156,11 +156,11 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public setAudioDevice = (device = 1) => new Promise((resolve, reject) => {
|
||||
call.setAudioDevice(device).then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:setAudioDevice : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:setAudioDevice : %s" + JSON.stringify(device))
|
||||
resolve(res);
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
HiLog.i(TAG,prefixLog + "catch:setAudioDevice : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:setAudioDevice : %s" + JSON.stringify(err))
|
||||
});
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public setMuted() {
|
||||
call.setMuted().then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:setMute : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:setMute")
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG,prefixLog + "catch:setMute : %s" + JSON.stringify(err))
|
||||
});
|
||||
@@ -180,9 +180,9 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public cancelMuted() {
|
||||
call.cancelMuted().then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:cancelMuted : %s")
|
||||
HiLog.i(TAG,prefixLog + "then:cancelMuted")
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG,prefixLog + "catch:cancelMuted : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:cancelMuted : %s" + JSON.stringify(err))
|
||||
});
|
||||
};
|
||||
|
||||
@@ -196,11 +196,11 @@ export default class CallServiceProxy {
|
||||
public switchCall = (callId) => new Promise((resolve, reject) => {
|
||||
call.switchCall(callId).then((res) => {
|
||||
resolve(res);
|
||||
HiLog.i(TAG,prefixLog + "then:switchCall : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:switchCall : %s" + JSON.stringify(callId))
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
HiLog.i(TAG,prefixLog + "catch:switchCall : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:switchCall : %s" + JSON.stringify(err))
|
||||
});
|
||||
});
|
||||
|
||||
@@ -212,10 +212,10 @@ export default class CallServiceProxy {
|
||||
public registerCallStateCallback(callBack) {
|
||||
call.on('callDetailsChange', (data) => {
|
||||
if (!data) {
|
||||
HiLog.i(TAG,prefixLog + "call.on registerCallStateCallback : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback")
|
||||
return;
|
||||
}
|
||||
HiLog.i(TAG,prefixLog + "call.on registerCallStateCallback callState : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback callState")
|
||||
callBack(data);
|
||||
});
|
||||
}
|
||||
@@ -226,10 +226,10 @@ export default class CallServiceProxy {
|
||||
public unRegisterCallStateCallback() {
|
||||
call.off('callDetailsChange', (data) => {
|
||||
if (!data) {
|
||||
HiLog.i(TAG,prefixLog + "call.off unRegisterCallStateCallback : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
||||
return;
|
||||
}
|
||||
HiLog.i(TAG,prefixLog + "call.off unRegisterCallStateCallback : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -239,9 +239,9 @@ export default class CallServiceProxy {
|
||||
public registerCallEventCallback() {
|
||||
call.on('callEventChange', (data) => {
|
||||
if (!data) {
|
||||
HiLog.i(TAG,prefixLog + "call.on callEventChange : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.on callEventChange")
|
||||
} else {
|
||||
HiLog.i(TAG,prefixLog + "call.on callEventChange : %s")
|
||||
HiLog.i(TAG, prefixLog + "call.on callEventChange")
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -268,9 +268,9 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public startDTMF = (callId, str) => {
|
||||
call.startDTMF(callId, str).then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:startDtmf : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:startDtmf : %s" + JSON.stringify(callId) + JSON.stringify(str))
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG,prefixLog + "catch:startDtmf : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:startDtmf : %s" + JSON.stringify(err))
|
||||
});
|
||||
};
|
||||
|
||||
@@ -281,9 +281,9 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public stopDTMF = (callId) => {
|
||||
call.stopDTMF(callId).then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:stopDtmf : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:stopDtmf : %s" + JSON.stringify(callId))
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG,prefixLog + "then:startDtmf : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "then:startDtmf : %s" + JSON.stringify(err))
|
||||
});
|
||||
};
|
||||
|
||||
@@ -294,22 +294,22 @@ export default class CallServiceProxy {
|
||||
*/
|
||||
public combineConference = (callId) => {
|
||||
call.combineConference(callId).then((res) => {
|
||||
HiLog.i(TAG,prefixLog + "then:combineConference : %s")
|
||||
HiLog.i(TAG, prefixLog + "then:combineConference : %s" + JSON.stringify(callId))
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG,prefixLog + "catch:combineConference : %s" + JSON.stringify(err))
|
||||
HiLog.i(TAG, prefixLog + "catch:combineConference : %s" + JSON.stringify(err))
|
||||
});
|
||||
};
|
||||
|
||||
public publish(data) {
|
||||
HiLog.i(TAG,prefixLog + "callui.event.callEvent publish : %s")
|
||||
HiLog.i(TAG, prefixLog + "callui.event.callEvent publish")
|
||||
commonEvent.publish('callui.event.callEvent', {
|
||||
bundleName: 'com.ohos.callui',
|
||||
isOrdered: false,
|
||||
data: JSON.stringify(data)
|
||||
}, (res) => {
|
||||
HiLog.i(TAG,prefixLog + "callui.event.callEvent success : %s")
|
||||
HiLog.i(TAG, prefixLog + "callui.event.callEvent success")
|
||||
});
|
||||
HiLog.i(TAG,prefixLog + "callui.event.callEvent publish end : %s")
|
||||
HiLog.i(TAG, prefixLog + "callui.event.callEvent publish end")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ export default class ContactManager {
|
||||
predicates.equalTo('detail_info', callData.accountNumber);
|
||||
const dataAbilityHelper = await featureAbility.acquireDataAbilityHelper(DBbaseUri);
|
||||
const resSet = await dataAbilityHelper.query(DBUri, columns, predicates);
|
||||
HiLog.i(TAG, "getContactInfo resSet : %s")
|
||||
HiLog.i(TAG, "getContactInfo resSet : %s" + JSON.stringify(resSet))
|
||||
if (resSet.rowCount > 0) {
|
||||
resSet.goToFirstRow();
|
||||
callData.contactName = resSet.getString(resSet.getColumnIndex('display_name'));
|
||||
|
||||
@@ -100,7 +100,7 @@ export default class NotificationManager {
|
||||
});
|
||||
}
|
||||
}
|
||||
HiLog.i(TAG, "sendNotification end : ")
|
||||
HiLog.i(TAG, "sendNotification end :")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,9 +157,9 @@ export default class NotificationManager {
|
||||
* Cancel notice
|
||||
*/
|
||||
cancelNotification() {
|
||||
HiLog.i(TAG, "cancelNotification : %s")
|
||||
HiLog.i(TAG, "cancelNotification")
|
||||
notification.cancel(ID).then((res) => {
|
||||
HiLog.i(TAG, "notify.cancel res data : %s")
|
||||
HiLog.i(TAG, "notify.cancel res data : %s" + JSON.stringify(res))
|
||||
}).catch((err) => {
|
||||
HiLog.i(TAG, "notify.cancel err data : %s" + JSON.stringify(err))
|
||||
});
|
||||
@@ -175,7 +175,7 @@ export default class NotificationManager {
|
||||
sendCapsuleNotification(callData, isBackground) {
|
||||
HiLog.i(TAG, "sendCapsuleNotification isBackground : %s" + JSON.stringify(isBackground))
|
||||
callData.startTime = (callData.startTime)
|
||||
HiLog.i(TAG, "sendCapsuleNotification callData.startTime : ")
|
||||
HiLog.i(TAG, "sendCapsuleNotification callData.startTime :")
|
||||
const {callState, startTime} = callData;
|
||||
commonEvent.publish('CAPSULE_EVENT_CALL_UI', {
|
||||
bundleName: 'com.ohos.callui',
|
||||
@@ -188,7 +188,7 @@ export default class NotificationManager {
|
||||
wantAbilityName: CALL_ABILITY_NAME
|
||||
})
|
||||
}, (res) => {
|
||||
HiLog.i(TAG, "callUI app commonEvent.publish CAPSULE_EVENT_CALL_UI callback res : %s")
|
||||
HiLog.i(TAG, "callUI app commonEvent.publish CAPSULE_EVENT_CALL_UI callback res : %s" + JSON.stringify(res))
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export default struct Index {
|
||||
* Dialing function
|
||||
*/
|
||||
public dialCall(phoneNumber, accountId = 0, videoState = 0, dialScene = 0) {
|
||||
HiLog.i(TAG, "dialCall phoneNumber : ")
|
||||
HiLog.i(TAG, "dialCall phoneNumber :")
|
||||
call.dial(phoneNumber, {
|
||||
accountId,
|
||||
videoState,
|
||||
@@ -120,7 +120,7 @@ export default struct Index {
|
||||
}
|
||||
this.notificationManager.sendNotification(text, this.callData);
|
||||
this.notificationManager.sendCapsuleNotification(this.callData, true);
|
||||
HiLog.i(TAG, "onPageHide end : ")
|
||||
HiLog.i(TAG, "onPageHide end : ")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
module.exports = require('@ohos/hvigor-ohos-plugin').appTasks
|
||||
module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks
|
||||
@@ -16,7 +16,6 @@
|
||||
apiType: 'faMode',
|
||||
showInServiceCenter: false,
|
||||
buildOption: {
|
||||
arkEnable: true,
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = require('@ohos/hvigor-ohos-plugin'). legacyHapTasks
|
||||
module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
"repository":{},
|
||||
"version":"1.0.0",
|
||||
"dependencies":{
|
||||
"@ohos/hvigor-ohos-plugin":"1.0.6",
|
||||
"@ohos/hvigor-ohos-plugin":"1.1.3",
|
||||
"hypium":"^1.0.0",
|
||||
"@ohos/hvigor":"1.0.6"
|
||||
"@ohos/hvigor":"1.1.3"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user