modify sdk interface

Signed-off-by: 18518779689 <litingting84@huawei.com>
This commit is contained in:
18518779689 2023-02-24 16:55:26 +08:00
parent d1c9eb0090
commit c18d1edea8
6 changed files with 36 additions and 12 deletions

View File

@ -60,10 +60,10 @@ export default class TelephonyApi {
* @param { number } callId - call id
*/
public acceptCall = function (callId) {
call.answer(callId).then((res) => {
LogUtils.i(TAG, prefixLog + "call.answer callId: " + JSON.stringify(callId))
call.answerCall(callId).then((res) => {
LogUtils.i(TAG, prefixLog + "call.answerCall callId: " + JSON.stringify(callId))
}).catch((err) => {
LogUtils.i(TAG, prefixLog + "call.answer catch : " + JSON.stringify(err))
LogUtils.i(TAG, prefixLog + "call.answerCall catch : " + JSON.stringify(err))
})
}
@ -77,9 +77,9 @@ export default class TelephonyApi {
* @param { string } msg - message string
*/
public rejectCall = function (callId, isSendSms = false, msg = '') {
const rejectCallPromise = isSendSms ? call.reject(callId, {
const rejectCallPromise = isSendSms ? call.rejectCall(callId, {
messageContent: msg
}) : call.reject(callId);
}) : call.rejectCall(callId);
rejectCallPromise.then((res) => {
LogUtils.i(TAG, prefixLog + "then:rejectCall")
})
@ -96,7 +96,7 @@ export default class TelephonyApi {
* @return { Object } promise object
*/
public hangUpCall = (callId) => new Promise((resolve, reject) => {
call.hangup(callId).then((res) => {
call.hangUpCall(callId).then((res) => {
resolve(res);
LogUtils.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
}).catch((err) => {

View File

@ -63,10 +63,10 @@ export default class CallServiceProxy {
* @param { number } callId - call id
*/
public acceptCall = function (callId) {
call.answer(callId).then((res) => {
LogUtils.i(TAG, prefixLog + "call.answer : %s" + JSON.stringify(callId))
call.answerCall(callId).then((res) => {
LogUtils.i(TAG, prefixLog + "call.answerCall : %s" + JSON.stringify(callId))
}).catch((err) => {
LogUtils.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
LogUtils.i(TAG, prefixLog + "call.answerCall catch : %s" + JSON.stringify(err))
});
};
@ -80,9 +80,9 @@ export default class CallServiceProxy {
* @param { string } msg - message string
*/
public rejectCall = function (callId, isSendSms = false, msg = '') {
const rejectCallPromise = isSendSms ? call.reject(callId, {
const rejectCallPromise = isSendSms ? call.rejectCall(callId, {
messageContent: msg
}) : call.reject(callId);
}) : call.rejectCall(callId);
rejectCallPromise.then((res) => {
LogUtils.i(TAG, prefixLog + "then:rejectCall")
})
@ -99,7 +99,7 @@ export default class CallServiceProxy {
* @return { Object } promise object
*/
public hangUpCall = (callId) => new Promise((resolve, reject) => {
call.hangup(callId).then((res) => {
call.hangUpCall(callId).then((res) => {
resolve(res);
LogUtils.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
}).catch((err) => {

View File

@ -12,6 +12,12 @@
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"uiSyntax": "ets",
"abilities": [
{

View File

@ -27,6 +27,12 @@
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"uiSyntax": "ets",
"abilities": [
{

View File

@ -12,6 +12,12 @@
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [
{
"name": "com.ohos.mobiledatasettings.MainAbility",

View File

@ -27,6 +27,12 @@
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [
{
"name": "com.ohos.mobiledatasettings.MainAbility",