@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"app": {
|
||||||
|
"bundleName": "com.ohos.callui",
|
||||||
|
"vendor": "example",
|
||||||
|
"versionCode": 1000000,
|
||||||
|
"versionName": "1.0.0",
|
||||||
|
"icon": "$media:app_icon",
|
||||||
|
"label": "$string:app_name",
|
||||||
|
"distributedNotificationEnabled": true,
|
||||||
|
"singleton": true,
|
||||||
|
"keepAlive": true
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"name": "app_name",
|
||||||
|
"value": "通话"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 19 KiB |
@@ -16,7 +16,7 @@
|
|||||||
"app": {
|
"app": {
|
||||||
"signingConfigs": [
|
"signingConfigs": [
|
||||||
{
|
{
|
||||||
"name": "default",
|
"name": "release",
|
||||||
"material": {
|
"material": {
|
||||||
"storePassword": "",
|
"storePassword": "",
|
||||||
"certpath": "signature/OpenHarmony.cer",
|
"certpath": "signature/OpenHarmony.cer",
|
||||||
@@ -28,19 +28,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"compileSdkVersion": 8,
|
"compileSdkVersion": 9,
|
||||||
"compatibleSdkVersion": 8,
|
"compatibleSdkVersion": 9,
|
||||||
"products": [
|
"products": [
|
||||||
{
|
{
|
||||||
"name": "default",
|
"name": "default",
|
||||||
"signingConfig": "default",
|
"signingConfig": "release",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"modules": [
|
"modules": [
|
||||||
{
|
{
|
||||||
"name": "callui",
|
"name": "com.ohos.callui",
|
||||||
"srcPath": "./callui",
|
"srcPath": "./entry",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"name": "default",
|
"name": "default",
|
||||||
@@ -51,7 +51,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mobiledatasettings",
|
"name": "common",
|
||||||
|
"srcPath": "./common"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "com.ohos.mobiledatasettings",
|
||||||
"srcPath": "./mobiledatasettings",
|
"srcPath": "./mobiledatasettings",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
apiType: 'faMode',
|
|
||||||
showInServiceCenter: false,
|
|
||||||
buildOption: {
|
|
||||||
},
|
|
||||||
"targets": [
|
|
||||||
{
|
|
||||||
"name": "default",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
{
|
|
||||||
"app": {
|
|
||||||
"bundleName": "com.ohos.callui",
|
|
||||||
"vendor": "ohos",
|
|
||||||
"singleton": true,
|
|
||||||
"version": {
|
|
||||||
"code": 1000000,
|
|
||||||
"name": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"deviceConfig": {
|
|
||||||
"default": {
|
|
||||||
"keepAlive": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"module": {
|
|
||||||
"package": "com.ohos.callui",
|
|
||||||
"name": ".MyApplication",
|
|
||||||
"mainAbility": ".ServiceAbility",
|
|
||||||
"srcPath": "",
|
|
||||||
"deviceType": [
|
|
||||||
"phone",
|
|
||||||
"tablet"
|
|
||||||
],
|
|
||||||
"distro": {
|
|
||||||
"deliveryWithInstall": true,
|
|
||||||
"moduleName": "callui",
|
|
||||||
"moduleType": "entry",
|
|
||||||
"installationFree": false
|
|
||||||
},
|
|
||||||
"abilities": [
|
|
||||||
{
|
|
||||||
"skills": [
|
|
||||||
{
|
|
||||||
"entities": [
|
|
||||||
"entity.system.home"
|
|
||||||
],
|
|
||||||
"actions": [
|
|
||||||
"action.system.home"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"orientation": "unspecified",
|
|
||||||
"visible": true,
|
|
||||||
"srcPath": "default",
|
|
||||||
"name": ".MainAbility",
|
|
||||||
"srcLanguage": "ets",
|
|
||||||
"icon": "$media:icon",
|
|
||||||
"description": "JS_Empty Ability",
|
|
||||||
"formsEnabled": false,
|
|
||||||
"label": "$string:entry_MainAbility",
|
|
||||||
"type": "page",
|
|
||||||
"launchType": "singleton"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": ".ServiceAbility",
|
|
||||||
"icon": "$media:icon",
|
|
||||||
"description": "service",
|
|
||||||
"type": "service",
|
|
||||||
"srcPath": "ServiceAbility",
|
|
||||||
"srcLanguage": "ets",
|
|
||||||
"visible": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"js": [
|
|
||||||
{
|
|
||||||
"mode": {
|
|
||||||
"syntax": "ets",
|
|
||||||
"type": "pageAbility"
|
|
||||||
},
|
|
||||||
"pages": [
|
|
||||||
"pages/index"
|
|
||||||
],
|
|
||||||
"name": ".MainAbility",
|
|
||||||
"window": {
|
|
||||||
"designWidth": 720,
|
|
||||||
"autoDesignWidth": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"reqPermissions" : [
|
|
||||||
{
|
|
||||||
"name" : "ohos.permission.READ_CONTACTS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name" : "ohos.permission.SEND_MESSAGES"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file: service entry
|
|
||||||
*/
|
|
||||||
|
|
||||||
import CallManagerService from './CallManagerService';
|
|
||||||
import HiLog from '../default/common/utils/Hilog';
|
|
||||||
|
|
||||||
const TAG = "Service";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* onStart
|
|
||||||
*/
|
|
||||||
onStart() {
|
|
||||||
HiLog.i(TAG, "onStart callUI service")
|
|
||||||
this.callManagerService = new CallManagerService();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* onStop
|
|
||||||
*/
|
|
||||||
onStop() {
|
|
||||||
HiLog.i(TAG, "onStop callUI service")
|
|
||||||
this.callManagerService.unsubscribe();
|
|
||||||
this.callManagerService.removeRegisterListener();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import CallManager from './model/CallManager';
|
|
||||||
import CallStateConst from './common/constant/CallStateConst';
|
|
||||||
import HiLog from './common/utils/Hilog';
|
|
||||||
import deviceInfo from '@ohos.deviceInfo';
|
|
||||||
|
|
||||||
const TAG = "App";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data:{
|
|
||||||
callData: {
|
|
||||||
...CallStateConst.defaultCallData
|
|
||||||
},
|
|
||||||
callList: [],
|
|
||||||
callTimeList: [],
|
|
||||||
appInactiveState: false,
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* onCreate
|
|
||||||
*/
|
|
||||||
onCreate() {
|
|
||||||
globalThis.deviceTypeInfo = deviceInfo.deviceType;
|
|
||||||
HiLog.i(TAG, "callui app Application onCreate")
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* onDestroy
|
|
||||||
*/
|
|
||||||
onDestroy() {
|
|
||||||
HiLog.i(TAG, "callui app Application onDestroy")
|
|
||||||
globalThis.callManager.clearTimer();
|
|
||||||
globalThis.callManager.unsubscribe();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_add_filled_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M15.9375,26.5625 C15.9375,27.080267 15.517767,27.5 15,27.5 C14.482233,27.5 14.0625,27.080267 14.0625,26.5625 L14.062,15.937 L3.4375,15.9375 C2.91973305,15.9375 2.5,15.517767 2.5,15 C2.5,14.482233 2.91973305,14.0625 3.4375,14.0625 L14.062,14.062 L14.0625,3.4375 C14.0625,2.91973305 14.482233,2.5 15,2.5 C15.517767,2.5 15.9375,2.91973305 15.9375,3.4375 L15.9375,26.5625 Z M26.5625,14.0625 C27.080267,14.0625 27.5,14.482233 27.5,15 C27.5,15.517767 27.080267,15.9375 26.5625,15.9375 L17.187,15.9375 L17.187,14.0625 L26.5625,14.0625 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_add_filled_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_recording_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M15,3.75 C15.6903559,3.75 16.25,4.36424348 16.25,5.12195122 L16.25,5.12195122 L16.25,24.8780488 C16.25,25.6357565 15.6903559,26.25 15,26.25 C14.3096441,26.25 13.75,25.6357565 13.75,24.8780488 L13.75,24.8780488 L13.75,5.12195122 C13.75,4.36424348 14.3096441,3.75 15,3.75 Z M8.75,8.14024396 C9.44035592,8.14024396 10,8.75448741 10,9.51219512 L10,9.51219512 L10,22.1341463 C10,22.8918541 9.44035594,23.5060976 8.75,23.5060976 C8.05964406,23.5060976 7.5,22.8918541 7.5,22.1341463 L7.5,22.1341463 L7.5,9.51219512 C7.5,8.75448741 8.05964408,8.14024396 8.75,8.14024396 Z M21.25,9.78658537 C21.9403559,9.78658537 22.5,10.4008288 22.5,11.1585366 L22.5,11.1585366 L22.5,19.3902439 C22.5,20.1479516 21.9403559,20.7621951 21.25,20.7621951 C20.5596441,20.7621951 20,20.1479516 20,19.3902439 L20,19.3902439 L20,11.1585366 C20,10.4008288 20.5596441,9.78658537 21.25,9.78658537 L21.25,9.78658537 Z M2.5,13.0792683 C3.19035594,13.0792683 3.75,13.6935118 3.75,14.4512195 L3.75,14.4512195 L3.75,17.195122 C3.75,17.9528297 3.19035594,18.5670732 2.5,18.5670732 C1.80964406,18.5670732 1.25,17.9528297 1.25,17.195122 L1.25,17.195122 L1.25,14.4512195 C1.25,13.6935118 1.80964406,13.0792683 2.5,13.0792683 Z M27.5,12.5304878 C28.1903559,12.5304878 28.75,13.1447313 28.75,13.902439 L28.75,13.902439 L28.75,17.195122 C28.75,17.9528297 28.1903559,18.5670732 27.5,18.5670732 C26.8096441,18.5670732 26.25,17.9528297 26.25,17.195122 L26.25,17.195122 L26.25,13.902439 C26.25,13.1447313 26.8096441,12.5304878 27.5,12.5304878 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_recording_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" fill-rule="nonzero" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_video_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M23.125,20.3125 C23.125,22.7287458 21.1662458,24.6875 18.75,24.6875 L4.375,24.6875 C1.95875422,24.6875 0,22.7287458 0,20.3125 L0,9.6875 C0,7.27125422 1.95875422,5.3125 4.375,5.3125 L18.75,5.3125 C21.1638993,5.3125 23.1211951,7.26745161 23.1249945,9.68046173 L23.125,20.3125 Z M18.75,7.1875 L4.375,7.1875 C3.02033929,7.1875 1.91733035,8.2649493 1.87618963,9.60963146 L1.875,9.6875 L1.875,20.3125 C1.875,21.6671607 2.9524493,22.7701696 4.29713146,22.8113104 L4.375,22.8125 L18.75,22.8125 C20.1046607,22.8125 21.2076696,21.7350507 21.2488104,20.3903685 L21.25,20.3125 L21.25,9.6875 C21.25,8.33283929 20.1725507,7.22983035 18.8278685,7.18868963 L18.75,7.1875 Z M26.7956758,8.56873671 C27.8653453,8.00716024 29.1877314,8.419051 29.7493079,9.48872047 C29.9139707,9.80236381 30,10.1513046 30,10.5055446 L30,10.5055446 L30,19.4944554 C30,20.7025783 29.0206229,21.6819554 27.8125,21.6819554 C27.45826,21.6819554 27.1093192,21.595926 26.7956758,21.4312633 L26.7956758,21.4312633 L24.375,20.1595 L24.375,18.0415 L27.6672394,19.7711422 C27.6840417,19.7799634 27.7015532,19.787205 27.7195477,19.7928111 L27.7747546,19.8046675 L27.8125,19.8069554 C27.985089,19.8069554 28.125,19.6670444 28.125,19.4944554 L28.125,19.4944554 L28.125,10.5055446 C28.125,10.4549389 28.1127101,10.4050902 28.0891868,10.360284 L28.0891868,10.360284 L28.0703849,10.3289938 C27.9821584,10.1997777 27.8091343,10.1543629 27.6672394,10.2288578 L27.6672394,10.2288578 L24.375,11.9565 L24.375,9.8395 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_video_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" fill-rule="nonzero" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_voice_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M23.4375,13.125 C23.955267,13.125 24.375,13.544733 24.375,14.0625 C24.375,18.9236084 20.6752266,22.9205885 15.9379544,23.3911656 L15.9375,26.5625 C15.9375,27.080267 15.517767,27.5 15,27.5 C14.5007247,27.5 14.092606,27.1097125 14.0640915,26.6175852 L14.0625,26.5625 L14.0620456,23.3911656 C9.32477337,22.9205885 5.625,18.9236084 5.625,14.0625 C5.625,13.544733 6.04473305,13.125 6.5625,13.125 C7.08026695,13.125 7.5,13.544733 7.5,14.0625 C7.5,18.2046356 10.8578644,21.5625 15,21.5625 C19.1421356,21.5625 22.5,18.2046356 22.5,14.0625 C22.5,13.544733 22.919733,13.125 23.4375,13.125 Z M15,2.5 C17.7614237,2.5 20,4.73857625 20,7.5 L20,7.5 L20,14.0625 C20,16.8239237 17.7614237,19.0625 15,19.0625 C12.2385763,19.0625 10,16.8239237 10,14.0625 L10,14.0625 L10,7.5 C10,4.73857625 12.2385763,2.5 15,2.5 Z M15,4.375 C13.2741102,4.375 11.875,5.77411016 11.875,7.5 L11.875,7.5 L11.875,14.0625 C11.875,15.7883898 13.2741102,17.1875 15,17.1875 C16.7258898,17.1875 18.125,15.7883898 18.125,14.0625 L18.125,14.0625 L18.125,7.5 C18.125,5.77411016 16.7258898,4.375 15,4.375 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_voice_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" fill-rule="nonzero" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,55 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file: Contact management
|
|
||||||
*/
|
|
||||||
|
|
||||||
import featureAbility from '@ohos.ability.featureAbility';
|
|
||||||
import dataAbility from '@ohos.data.dataAbility';
|
|
||||||
import HiLog from '../common/utils/Hilog';
|
|
||||||
|
|
||||||
const TAG = "ContactManager";
|
|
||||||
const DBbaseUri = 'dataability:///com.ohos.contactsdataability';
|
|
||||||
const DBUri = DBbaseUri + '/contacts/contact_data';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class ContactManager
|
|
||||||
*/
|
|
||||||
export default class ContactManager {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get contact info
|
|
||||||
*
|
|
||||||
* @param { Object } callData -Object
|
|
||||||
*/
|
|
||||||
async getContactInfo(callData) {
|
|
||||||
try {
|
|
||||||
const columns = ['id', 'display_name', 'detail_info'];
|
|
||||||
const predicates = new dataAbility.DataAbilityPredicates();
|
|
||||||
predicates.equalTo('detail_info', callData.accountNumber);
|
|
||||||
predicates.equalTo('is_deleted', 0);
|
|
||||||
const dataAbilityHelper = await featureAbility.acquireDataAbilityHelper(DBbaseUri);
|
|
||||||
const resSet = await dataAbilityHelper.query(DBUri, columns, predicates);
|
|
||||||
HiLog.i(TAG, "getContactInfo resSet : %s" + JSON.stringify(resSet))
|
|
||||||
if (resSet.rowCount > 0) {
|
|
||||||
resSet.goToFirstRow();
|
|
||||||
callData.contactName = resSet.getString(resSet.getColumnIndex('display_name'));
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
HiLog.i(TAG, "getContactInfo catch err : %s" + JSON.stringify(err))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_add_filled_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M15.9375,26.5625 C15.9375,27.080267 15.517767,27.5 15,27.5 C14.482233,27.5 14.0625,27.080267 14.0625,26.5625 L14.062,15.937 L3.4375,15.9375 C2.91973305,15.9375 2.5,15.517767 2.5,15 C2.5,14.482233 2.91973305,14.0625 3.4375,14.0625 L14.062,14.062 L14.0625,3.4375 C14.0625,2.91973305 14.482233,2.5 15,2.5 C15.517767,2.5 15.9375,2.91973305 15.9375,3.4375 L15.9375,26.5625 Z M26.5625,14.0625 C27.080267,14.0625 27.5,14.482233 27.5,15 C27.5,15.517767 27.080267,15.9375 26.5625,15.9375 L17.187,15.9375 L17.187,14.0625 L26.5625,14.0625 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_add_filled_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_pause_置灰</title>
|
|
||||||
<g id="ic_public_pause_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.4">
|
|
||||||
<path d="M10,4.375 C10.6903559,4.375 11.25,4.93464406 11.25,5.625 L11.25,24.375 C11.25,25.0653559 10.6903559,25.625 10,25.625 C9.30964406,25.625 8.75,25.0653559 8.75,24.375 L8.75,5.625 C8.75,4.93464406 9.30964406,4.375 10,4.375 Z M20,4.375 C20.6903559,4.375 21.25,4.93464406 21.25,5.625 L21.25,24.375 C21.25,25.0653559 20.6903559,25.625 20,25.625 C19.3096441,25.625 18.75,25.0653559 18.75,24.375 L18.75,5.625 C18.75,4.93464406 19.3096441,4.375 20,4.375 Z" id="ic/pause/ic_pause" fill="#FFFFFF"></path>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 864 B |
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_recording_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M15,3.75 C15.6903559,3.75 16.25,4.36424348 16.25,5.12195122 L16.25,5.12195122 L16.25,24.8780488 C16.25,25.6357565 15.6903559,26.25 15,26.25 C14.3096441,26.25 13.75,25.6357565 13.75,24.8780488 L13.75,24.8780488 L13.75,5.12195122 C13.75,4.36424348 14.3096441,3.75 15,3.75 Z M8.75,8.14024396 C9.44035592,8.14024396 10,8.75448741 10,9.51219512 L10,9.51219512 L10,22.1341463 C10,22.8918541 9.44035594,23.5060976 8.75,23.5060976 C8.05964406,23.5060976 7.5,22.8918541 7.5,22.1341463 L7.5,22.1341463 L7.5,9.51219512 C7.5,8.75448741 8.05964408,8.14024396 8.75,8.14024396 Z M21.25,9.78658537 C21.9403559,9.78658537 22.5,10.4008288 22.5,11.1585366 L22.5,11.1585366 L22.5,19.3902439 C22.5,20.1479516 21.9403559,20.7621951 21.25,20.7621951 C20.5596441,20.7621951 20,20.1479516 20,19.3902439 L20,19.3902439 L20,11.1585366 C20,10.4008288 20.5596441,9.78658537 21.25,9.78658537 L21.25,9.78658537 Z M2.5,13.0792683 C3.19035594,13.0792683 3.75,13.6935118 3.75,14.4512195 L3.75,14.4512195 L3.75,17.195122 C3.75,17.9528297 3.19035594,18.5670732 2.5,18.5670732 C1.80964406,18.5670732 1.25,17.9528297 1.25,17.195122 L1.25,17.195122 L1.25,14.4512195 C1.25,13.6935118 1.80964406,13.0792683 2.5,13.0792683 Z M27.5,12.5304878 C28.1903559,12.5304878 28.75,13.1447313 28.75,13.902439 L28.75,13.902439 L28.75,17.195122 C28.75,17.9528297 28.1903559,18.5670732 27.5,18.5670732 C26.8096441,18.5670732 26.25,17.9528297 26.25,17.195122 L26.25,17.195122 L26.25,13.902439 C26.25,13.1447313 26.8096441,12.5304878 27.5,12.5304878 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_recording_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" fill-rule="nonzero" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_video_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M23.125,20.3125 C23.125,22.7287458 21.1662458,24.6875 18.75,24.6875 L4.375,24.6875 C1.95875422,24.6875 0,22.7287458 0,20.3125 L0,9.6875 C0,7.27125422 1.95875422,5.3125 4.375,5.3125 L18.75,5.3125 C21.1638993,5.3125 23.1211951,7.26745161 23.1249945,9.68046173 L23.125,20.3125 Z M18.75,7.1875 L4.375,7.1875 C3.02033929,7.1875 1.91733035,8.2649493 1.87618963,9.60963146 L1.875,9.6875 L1.875,20.3125 C1.875,21.6671607 2.9524493,22.7701696 4.29713146,22.8113104 L4.375,22.8125 L18.75,22.8125 C20.1046607,22.8125 21.2076696,21.7350507 21.2488104,20.3903685 L21.25,20.3125 L21.25,9.6875 C21.25,8.33283929 20.1725507,7.22983035 18.8278685,7.18868963 L18.75,7.1875 Z M26.7956758,8.56873671 C27.8653453,8.00716024 29.1877314,8.419051 29.7493079,9.48872047 C29.9139707,9.80236381 30,10.1513046 30,10.5055446 L30,10.5055446 L30,19.4944554 C30,20.7025783 29.0206229,21.6819554 27.8125,21.6819554 C27.45826,21.6819554 27.1093192,21.595926 26.7956758,21.4312633 L26.7956758,21.4312633 L24.375,20.1595 L24.375,18.0415 L27.6672394,19.7711422 C27.6840417,19.7799634 27.7015532,19.787205 27.7195477,19.7928111 L27.7747546,19.8046675 L27.8125,19.8069554 C27.985089,19.8069554 28.125,19.6670444 28.125,19.4944554 L28.125,19.4944554 L28.125,10.5055446 C28.125,10.4549389 28.1127101,10.4050902 28.0891868,10.360284 L28.0891868,10.360284 L28.0703849,10.3289938 C27.9821584,10.1997777 27.8091343,10.1543629 27.6672394,10.2288578 L27.6672394,10.2288578 L24.375,11.9565 L24.375,9.8395 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_video_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" fill-rule="nonzero" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>ic_public_voice_置灰</title>
|
|
||||||
<defs>
|
|
||||||
<path d="M23.4375,13.125 C23.955267,13.125 24.375,13.544733 24.375,14.0625 C24.375,18.9236084 20.6752266,22.9205885 15.9379544,23.3911656 L15.9375,26.5625 C15.9375,27.080267 15.517767,27.5 15,27.5 C14.5007247,27.5 14.092606,27.1097125 14.0640915,26.6175852 L14.0625,26.5625 L14.0620456,23.3911656 C9.32477337,22.9205885 5.625,18.9236084 5.625,14.0625 C5.625,13.544733 6.04473305,13.125 6.5625,13.125 C7.08026695,13.125 7.5,13.544733 7.5,14.0625 C7.5,18.2046356 10.8578644,21.5625 15,21.5625 C19.1421356,21.5625 22.5,18.2046356 22.5,14.0625 C22.5,13.544733 22.919733,13.125 23.4375,13.125 Z M15,2.5 C17.7614237,2.5 20,4.73857625 20,7.5 L20,7.5 L20,14.0625 C20,16.8239237 17.7614237,19.0625 15,19.0625 C12.2385763,19.0625 10,16.8239237 10,14.0625 L10,14.0625 L10,7.5 C10,4.73857625 12.2385763,2.5 15,2.5 Z M15,4.375 C13.2741102,4.375 11.875,5.77411016 11.875,7.5 L11.875,7.5 L11.875,14.0625 C11.875,15.7883898 13.2741102,17.1875 15,17.1875 C16.7258898,17.1875 18.125,15.7883898 18.125,14.0625 L18.125,14.0625 L18.125,7.5 C18.125,5.77411016 16.7258898,4.375 15,4.375 Z" id="path-1"></path>
|
|
||||||
</defs>
|
|
||||||
<g id="ic_public_voice_置灰" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<mask id="mask-2" fill="white">
|
|
||||||
<use xlink:href="#path-1"></use>
|
|
||||||
</mask>
|
|
||||||
<use id="形状结合" fill="#FFFFFF" fill-rule="nonzero" opacity="0.4" xlink:href="#path-1"></use>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
/node_modules
|
||||||
|
/.preview
|
||||||
|
/build
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"apiType": "stageMode",
|
||||||
|
"buildOption": {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
||||||
|
module.exports = require('@ohos/hvigor-ohos-plugin').harTasks
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { MainPage } from './src/main/ets/components/MainPage/MainPage'
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"license":"ISC",
|
||||||
|
"types":"",
|
||||||
|
"devDependencies":{},
|
||||||
|
"name":"@ohos/common",
|
||||||
|
"description":"a npm package which contains arkUI2.0 page",
|
||||||
|
"ohos":{
|
||||||
|
"org":""
|
||||||
|
},
|
||||||
|
"main":"index.ets",
|
||||||
|
"repository":{},
|
||||||
|
"version":"1.0.0",
|
||||||
|
"dependencies":{}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
@Component
|
||||||
|
export struct MainPage {
|
||||||
|
@State message: string = 'Hello World'
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Text(this.message)
|
||||||
|
.fontSize(50)
|
||||||
|
.fontWeight(FontWeight.Bold)
|
||||||
|
}
|
||||||
|
.width('100%')
|
||||||
|
}
|
||||||
|
.height('100%')
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"module": {
|
||||||
|
"name": "common",
|
||||||
|
"type": "har",
|
||||||
|
"deviceTypes": [
|
||||||
|
"default",
|
||||||
|
"tablet"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"name": "page_show",
|
||||||
|
"value": "page from npm package"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -105,7 +105,7 @@ import dataStorage from '@ohos.data.storage';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
(2)选择 Project → Signing Configs,添加StorePassword:123456abcdef,KeyPassword:123456,
|
(2)选择 Project → Signing Configs,添加StorePassword:123456abc,KeyPassword:123456abc,
|
||||||
依次填入下图中,完成后点击Apply,再点击OK
|
依次填入下图中,完成后点击Apply,再点击OK
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
/build
|
/node_modules
|
||||||
/node_modules
|
/.preview
|
||||||
|
/build
|
||||||
|
/.cxx
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"apiType": 'stageMode',
|
||||||
|
"buildOption": {
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"name": "default"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohosTest",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
||||||
|
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"license":"ISC",
|
||||||
|
"devDependencies":{},
|
||||||
|
"name":"entry",
|
||||||
|
"ohos":{
|
||||||
|
"org":"huawei",
|
||||||
|
"directoryLevel":"module",
|
||||||
|
"buildTool":"hvigor"
|
||||||
|
},
|
||||||
|
"description":"example description",
|
||||||
|
"repository":{},
|
||||||
|
"version":"1.0.0",
|
||||||
|
"dependencies":{}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import AbilityStage from "@ohos.application.AbilityStage"
|
||||||
|
import deviceInfo from '@ohos.deviceInfo';
|
||||||
|
import backgroundTaskManager from '@ohos.backgroundTaskManager';
|
||||||
|
import LogUtils from '../common/utils/LogUtils'
|
||||||
|
|
||||||
|
const TAG = "MyAbilityStage";
|
||||||
|
|
||||||
|
export default class MyAbilityStage extends AbilityStage {
|
||||||
|
onCreate() {
|
||||||
|
globalThis.deviceTypeInfo = deviceInfo.deviceType;
|
||||||
|
this.applyEfficiencyResources();
|
||||||
|
LogUtils.i(TAG, "MyAbilityStage onCreate")
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroy() {
|
||||||
|
LogUtils.i(TAG, "MyAbilityStage onDestroy")
|
||||||
|
backgroundTaskManager.resetAllEfficiencyResources();
|
||||||
|
}
|
||||||
|
|
||||||
|
private applyEfficiencyResources() {
|
||||||
|
let request: backgroundTaskManager.EfficiencyResourcesRequest = {
|
||||||
|
resourceTypes: backgroundTaskManager.ResourceType.COMMON_EVENT,
|
||||||
|
isApply: true,
|
||||||
|
timeOut: 0,
|
||||||
|
reason: "apply",
|
||||||
|
isPersist: true,
|
||||||
|
isProcess: false,
|
||||||
|
}
|
||||||
|
let res = backgroundTaskManager.applyEfficiencyResources(request);
|
||||||
|
LogUtils.i(TAG, "result of applyEfficiencyResources is:" + res)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import featureAbility from '@ohos.ability.featureAbility';
|
||||||
|
import Ability from '@ohos.application.Ability'
|
||||||
|
import LogUtils from '../common/utils/LogUtils'
|
||||||
|
|
||||||
|
const TAG = "MainAbility";
|
||||||
|
|
||||||
|
export default class MainAbility extends Ability {
|
||||||
|
onCreate(want, launchParam) {
|
||||||
|
LogUtils.i(TAG, "onCreate")
|
||||||
|
globalThis.abilityWant = want;
|
||||||
|
globalThis.calluiAbilityContext = this.context;
|
||||||
|
}
|
||||||
|
|
||||||
|
onWindowStageCreate(windowStage) {
|
||||||
|
// Main window is created, set main page for this ability
|
||||||
|
LogUtils.i(TAG, "onWindowStageCreate")
|
||||||
|
windowStage.loadContent("pages/index", (err, data) => {
|
||||||
|
if (err.code) {
|
||||||
|
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onWindowStageDestroy() {
|
||||||
|
// Main window is destroyed, release UI related resources
|
||||||
|
LogUtils.i(TAG, "onWindowStageDestroy")
|
||||||
|
}
|
||||||
|
|
||||||
|
onForeground() {
|
||||||
|
// Ability has brought to foreground
|
||||||
|
LogUtils.i(TAG, "onForeground")
|
||||||
|
}
|
||||||
|
|
||||||
|
onBackground() {
|
||||||
|
// Ability has back to background
|
||||||
|
LogUtils.i(TAG, "onBackground")
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroy() {
|
||||||
|
LogUtils.i(TAG, "onDestroy")
|
||||||
|
globalThis.callManager.clearTimer();
|
||||||
|
globalThis.callManager.unsubscribe();
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
import PA from '@ohos.ability.particleAbility';
|
import PA from '@ohos.ability.particleAbility';
|
||||||
import TelephonyCall from './TelephonyApi';
|
import TelephonyCall from './TelephonyApi';
|
||||||
import commonEvent from '@ohos.commonEvent';
|
import commonEvent from '@ohos.commonEvent';
|
||||||
import HiLog from '../default/common/utils/Hilog';
|
import LogUtils from "../common/utils/LogUtils"
|
||||||
|
|
||||||
let subscriber;
|
let subscriber;
|
||||||
const TAG = "CallManagerService";
|
const TAG = "CallManagerService";
|
||||||
@@ -39,22 +39,24 @@ export default class CallManagerService {
|
|||||||
private mTelephonyCall: TelephonyCall ;
|
private mTelephonyCall: TelephonyCall ;
|
||||||
private callData = null;
|
private callData = null;
|
||||||
private callList = [];
|
private callList = [];
|
||||||
|
private context: any;
|
||||||
|
|
||||||
public constructor() {
|
public constructor(context: any) {
|
||||||
this.mTelephonyCall = new TelephonyCall;
|
this.mTelephonyCall = new TelephonyCall;
|
||||||
this.addRegisterListener();
|
this.addRegisterListener();
|
||||||
this.addSubscriber();
|
this.addSubscriber();
|
||||||
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add callui app subscriber
|
* add callui app subscriber
|
||||||
*/
|
*/
|
||||||
async addSubscriber() {
|
async addSubscriber() {
|
||||||
|
LogUtils.i(TAG, "addSubscriber")
|
||||||
subscriber = await new Promise((resolve) => {
|
subscriber = await new Promise((resolve) => {
|
||||||
commonEvent.createSubscriber({
|
commonEvent.createSubscriber({
|
||||||
events
|
events
|
||||||
}, (err, data) => {
|
}, (err, data) => {
|
||||||
HiLog.i(TAG, "addSubscriber")
|
|
||||||
resolve(data);
|
resolve(data);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -73,11 +75,11 @@ export default class CallManagerService {
|
|||||||
this.btnclickAgent(callId, btnType)
|
this.btnclickAgent(callId, btnType)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HiLog.i(TAG, "callui service commonEvent.subscribe failed err : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "addSubscriber commonEvent.subscribe failed err :" + JSON.stringify(err))
|
||||||
}
|
}
|
||||||
subscriber.finishCommonEvent()
|
subscriber.finishCommonEvent()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
HiLog.i(TAG, "addSubscriber finishCommonEvent")
|
LogUtils.i(TAG, "addSubscriber finishCommonEvent")
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -89,7 +91,7 @@ export default class CallManagerService {
|
|||||||
* @param { string } btnType - button type
|
* @param { string } btnType - button type
|
||||||
*/
|
*/
|
||||||
btnclickAgent(callId, btnType) {
|
btnclickAgent(callId, btnType) {
|
||||||
HiLog.i(TAG, "btnType : %s" + btnType)
|
LogUtils.i(TAG, "btnclickAgent btnType :" + btnType)
|
||||||
this.getMapObj(btnType, callId)
|
this.getMapObj(btnType, callId)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,16 +141,14 @@ export default class CallManagerService {
|
|||||||
* @param { Object } callData - Object
|
* @param { Object } callData - Object
|
||||||
*/
|
*/
|
||||||
startAbility(callData) {
|
startAbility(callData) {
|
||||||
PA.startAbility({
|
this.context.startAbility({
|
||||||
want: {
|
|
||||||
bundleName: CALL_BUNDLE_NAME,
|
bundleName: CALL_BUNDLE_NAME,
|
||||||
abilityName: ABILITY_NAME,
|
abilityName: ABILITY_NAME,
|
||||||
parameters: callData
|
parameters: callData
|
||||||
}
|
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
HiLog.i(TAG, "callUI service PA.startAbility data : %s" + JSON.stringify(data))
|
LogUtils.i(TAG, "callUI service startAbility data :" + JSON.stringify(data))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, "callUI service PA.startAbility err : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "callUI service startAbility err :" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,12 +179,12 @@ export default class CallManagerService {
|
|||||||
* @param { Object } callData - Object
|
* @param { Object } callData - Object
|
||||||
*/
|
*/
|
||||||
publishData(callData) {
|
publishData(callData) {
|
||||||
commonEvent.publish('callui.event.callDetailsChange', {
|
commonEvent.publish('callui.event.callDetailsChange', {
|
||||||
bundleName: CALL_BUNDLE_NAME,
|
bundleName: 'com.ohos.callui',
|
||||||
isOrdered: false,
|
isOrdered: false,
|
||||||
data: JSON.stringify(callData)
|
data: JSON.stringify(callData)
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
HiLog.i(TAG, "callUI service commonEvent.publish callback res")
|
LogUtils.i(TAG, "publishData commonEvent.publish callback res: callui.event.callDetailsChange")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ export default class CallManagerService {
|
|||||||
unsubscribe() {
|
unsubscribe() {
|
||||||
commonEvent.unsubscribe(subscriber, (err) => {
|
commonEvent.unsubscribe(subscriber, (err) => {
|
||||||
if (err.code !== 0) {
|
if (err.code !== 0) {
|
||||||
HiLog.i(TAG, "callUI service commonEvent.unsubscribe err: %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "unsubscribe commonEvent.unsubscribe err:" + JSON.stringify(err))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import Want from '@ohos.application.Want';
|
||||||
|
import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
|
||||||
|
import CallManagerService from './CallManagerService';
|
||||||
|
import rpc from '@ohos.rpc';
|
||||||
|
import LogUtils from "../common/utils/LogUtils"
|
||||||
|
|
||||||
|
const TAG = "ServiceAbility";
|
||||||
|
export default class ServiceAbility extends ServiceExtension {
|
||||||
|
callManagerService: CallManagerService
|
||||||
|
onCreate(want) {
|
||||||
|
LogUtils.i(TAG, "onCreate callUI service");
|
||||||
|
this.callManagerService = new CallManagerService(this.context);
|
||||||
|
}
|
||||||
|
|
||||||
|
onConnect(want:Want) {
|
||||||
|
LogUtils.i(TAG, "onConnect callUI service want:" + JSON.stringify(want));
|
||||||
|
let callData:any = {};
|
||||||
|
callData.accountNumber = want.parameters.accountNumber;
|
||||||
|
callData.videoState = want.parameters.videoState;
|
||||||
|
callData.callType = want.parameters.callType;
|
||||||
|
callData.callState = want.parameters.callState;
|
||||||
|
callData.conferenceState = want.parameters.conferenceState;
|
||||||
|
this.callManagerService.getCallData(callData);
|
||||||
|
return new Stub("ServiceAbility");
|
||||||
|
}
|
||||||
|
|
||||||
|
onRequest(want:Want, startId:number) {
|
||||||
|
LogUtils.i(TAG, "onRequest callUI service");
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroy() {
|
||||||
|
LogUtils.i(TAG, "onDestroy callUI service");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Stub extends rpc.RemoteObject {
|
||||||
|
constructor(descriptor) {
|
||||||
|
super(descriptor);
|
||||||
|
}
|
||||||
|
onRemoteRequest(code, date, reply, option) {
|
||||||
|
try {
|
||||||
|
LogUtils.i(TAG, "Stub onRemoteRequest code:" + code)
|
||||||
|
return true;
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import call from '@ohos.telephony.call';
|
import call from '@ohos.telephony.call';
|
||||||
import HiLog from '../default/common/utils/Hilog';
|
import LogUtils from "../common/utils/LogUtils"
|
||||||
|
|
||||||
const prefixLog = 'callui service:@ohos.telephony.call:';
|
const prefixLog = 'callui service:@ohos.telephony.call:';
|
||||||
const TAG = "TelephonyApi";
|
const TAG = "TelephonyApi";
|
||||||
@@ -33,10 +33,10 @@ export default class TelephonyApi {
|
|||||||
public registerCallStateCallback(callBack) {
|
public registerCallStateCallback(callBack) {
|
||||||
call.on('callDetailsChange', (data) => {
|
call.on('callDetailsChange', (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback" + JSON.stringify(data))
|
LogUtils.i(TAG, prefixLog + "call.on registerCallStateCallback: " + JSON.stringify(data))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback callState :" + JSON.stringify(data.callState))
|
LogUtils.i(TAG, prefixLog + "call.on registerCallStateCallback callState: " + JSON.stringify(data.callState))
|
||||||
callBack(data);
|
callBack(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -47,10 +47,10 @@ export default class TelephonyApi {
|
|||||||
public unRegisterCallStateCallback() {
|
public unRegisterCallStateCallback() {
|
||||||
call.off('callDetailsChange', (data) => {
|
call.off('callDetailsChange', (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback" + JSON.stringify(data))
|
LogUtils.i(TAG, prefixLog + "call.off unRegisterCallStateCallback" + JSON.stringify(data))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
LogUtils.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,9 +61,9 @@ export default class TelephonyApi {
|
|||||||
*/
|
*/
|
||||||
public acceptCall = function (callId) {
|
public acceptCall = function (callId) {
|
||||||
call.answer(callId).then((res) => {
|
call.answer(callId).then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "call.answer")
|
LogUtils.i(TAG, prefixLog + "call.answer")
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,12 +77,14 @@ export default class TelephonyApi {
|
|||||||
* @param { string } msg - message string
|
* @param { string } msg - message string
|
||||||
*/
|
*/
|
||||||
public rejectCall = function (callId, isSendSms = false, msg = '') {
|
public rejectCall = function (callId, isSendSms = false, msg = '') {
|
||||||
const rejectCallPromise = isSendSms ? call.reject(callId, {messageContent: msg}) : call.reject(callId);
|
const rejectCallPromise = isSendSms ? call.reject(callId, {
|
||||||
|
messageContent: msg
|
||||||
|
}) : call.reject(callId);
|
||||||
rejectCallPromise.then((res) => {
|
rejectCallPromise.then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:rejectCall")
|
LogUtils.i(TAG, prefixLog + "then:rejectCall")
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "catch:rejectCall : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:rejectCall : " + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,10 +98,10 @@ export default class TelephonyApi {
|
|||||||
public hangUpCall = (callId) => new Promise((resolve, reject) => {
|
public hangUpCall = (callId) => new Promise((resolve, reject) => {
|
||||||
call.hangup(callId).then((res) => {
|
call.hangup(callId).then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
HiLog.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, prefixLog + "catch:hangUpCall : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:hangUpCall : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 789 B |
|
Before Width: | Height: | Size: 756 B After Width: | Height: | Size: 756 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="30px"
|
||||||
|
height="30px"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>ic_public_add_filled_置灰</title>
|
||||||
|
<defs>
|
||||||
|
<path
|
||||||
|
d="M15.9375,26.5625 C15.9375,27.080267 15.517767,27.5 15,27.5 C14.482233,27.5 14.0625,27.080267 14.0625,26.5625 L14.062,15.937 L3.4375,15.9375 C2.91973305,15.9375 2.5,15.517767 2.5,15 C2.5,14.482233 2.91973305,14.0625 3.4375,14.0625 L14.062,14.062 L14.0625,3.4375 C14.0625,2.91973305 14.482233,2.5 15,2.5 C15.517767,2.5 15.9375,2.91973305 15.9375,3.4375 L15.9375,26.5625 Z M26.5625,14.0625 C27.080267,14.0625 27.5,14.482233 27.5,15 C27.5,15.517767 27.080267,15.9375 26.5625,15.9375 L17.187,15.9375 L17.187,14.0625 L26.5625,14.0625 Z"
|
||||||
|
id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g
|
||||||
|
id="ic_public_add_filled_置灰"
|
||||||
|
stroke="none"
|
||||||
|
stroke-width="1"
|
||||||
|
fill="none"
|
||||||
|
fill-rule="evenodd">
|
||||||
|
<mask
|
||||||
|
id="mask-2"
|
||||||
|
fill="#8c8c8c">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use
|
||||||
|
id="形状结合"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
opacity="0.4"
|
||||||
|
xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 836 B |
|
Before Width: | Height: | Size: 850 B After Width: | Height: | Size: 850 B |
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="30px"
|
||||||
|
height="30px"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>ic_public_pause_置灰</title>
|
||||||
|
<g
|
||||||
|
id="ic_public_pause_置灰"
|
||||||
|
stroke="none"
|
||||||
|
stroke-width="1"
|
||||||
|
fill="none"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
opacity="0.4">
|
||||||
|
<path
|
||||||
|
d="M10,4.375 C10.6903559,4.375 11.25,4.93464406 11.25,5.625 L11.25,24.375 C11.25,25.0653559 10.6903559,25.625 10,25.625 C9.30964406,25.625 8.75,25.0653559 8.75,24.375 L8.75,5.625 C8.75,4.93464406 9.30964406,4.375 10,4.375 Z M20,4.375 C20.6903559,4.375 21.25,4.93464406 21.25,5.625 L21.25,24.375 C21.25,25.0653559 20.6903559,25.625 20,25.625 C19.3096441,25.625 18.75,25.0653559 18.75,24.375 L18.75,5.625 C18.75,4.93464406 19.3096441,4.375 20,4.375 Z"
|
||||||
|
id="ic/pause/ic_pause"
|
||||||
|
fill="#FFFFFF"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 973 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="30px"
|
||||||
|
height="30px"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>ic_public_recording_置灰</title>
|
||||||
|
<defs>
|
||||||
|
<path
|
||||||
|
d="M15,3.75 C15.6903559,3.75 16.25,4.36424348 16.25,5.12195122 L16.25,5.12195122 L16.25,24.8780488 C16.25,25.6357565 15.6903559,26.25 15,26.25 C14.3096441,26.25 13.75,25.6357565 13.75,24.8780488 L13.75,24.8780488 L13.75,5.12195122 C13.75,4.36424348 14.3096441,3.75 15,3.75 Z M8.75,8.14024396 C9.44035592,8.14024396 10,8.75448741 10,9.51219512 L10,9.51219512 L10,22.1341463 C10,22.8918541 9.44035594,23.5060976 8.75,23.5060976 C8.05964406,23.5060976 7.5,22.8918541 7.5,22.1341463 L7.5,22.1341463 L7.5,9.51219512 C7.5,8.75448741 8.05964408,8.14024396 8.75,8.14024396 Z M21.25,9.78658537 C21.9403559,9.78658537 22.5,10.4008288 22.5,11.1585366 L22.5,11.1585366 L22.5,19.3902439 C22.5,20.1479516 21.9403559,20.7621951 21.25,20.7621951 C20.5596441,20.7621951 20,20.1479516 20,19.3902439 L20,19.3902439 L20,11.1585366 C20,10.4008288 20.5596441,9.78658537 21.25,9.78658537 L21.25,9.78658537 Z M2.5,13.0792683 C3.19035594,13.0792683 3.75,13.6935118 3.75,14.4512195 L3.75,14.4512195 L3.75,17.195122 C3.75,17.9528297 3.19035594,18.5670732 2.5,18.5670732 C1.80964406,18.5670732 1.25,17.9528297 1.25,17.195122 L1.25,17.195122 L1.25,14.4512195 C1.25,13.6935118 1.80964406,13.0792683 2.5,13.0792683 Z M27.5,12.5304878 C28.1903559,12.5304878 28.75,13.1447313 28.75,13.902439 L28.75,13.902439 L28.75,17.195122 C28.75,17.9528297 28.1903559,18.5670732 27.5,18.5670732 C26.8096441,18.5670732 26.25,17.9528297 26.25,17.195122 L26.25,17.195122 L26.25,13.902439 C26.25,13.1447313 26.8096441,12.5304878 27.5,12.5304878 Z"
|
||||||
|
id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g
|
||||||
|
id="ic_public_recording_置灰"
|
||||||
|
stroke="none"
|
||||||
|
stroke-width="1"
|
||||||
|
fill="none"
|
||||||
|
fill-rule="evenodd">
|
||||||
|
<mask
|
||||||
|
id="mask-2"
|
||||||
|
fill="#8c8c8c">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use
|
||||||
|
id="形状结合"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
fill-rule="nonzero"
|
||||||
|
opacity="0.4"
|
||||||
|
xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="30px"
|
||||||
|
height="30px"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>ic_public_video_置灰</title>
|
||||||
|
<defs>
|
||||||
|
<path
|
||||||
|
d="M23.125,20.3125 C23.125,22.7287458 21.1662458,24.6875 18.75,24.6875 L4.375,24.6875 C1.95875422,24.6875 0,22.7287458 0,20.3125 L0,9.6875 C0,7.27125422 1.95875422,5.3125 4.375,5.3125 L18.75,5.3125 C21.1638993,5.3125 23.1211951,7.26745161 23.1249945,9.68046173 L23.125,20.3125 Z M18.75,7.1875 L4.375,7.1875 C3.02033929,7.1875 1.91733035,8.2649493 1.87618963,9.60963146 L1.875,9.6875 L1.875,20.3125 C1.875,21.6671607 2.9524493,22.7701696 4.29713146,22.8113104 L4.375,22.8125 L18.75,22.8125 C20.1046607,22.8125 21.2076696,21.7350507 21.2488104,20.3903685 L21.25,20.3125 L21.25,9.6875 C21.25,8.33283929 20.1725507,7.22983035 18.8278685,7.18868963 L18.75,7.1875 Z M26.7956758,8.56873671 C27.8653453,8.00716024 29.1877314,8.419051 29.7493079,9.48872047 C29.9139707,9.80236381 30,10.1513046 30,10.5055446 L30,10.5055446 L30,19.4944554 C30,20.7025783 29.0206229,21.6819554 27.8125,21.6819554 C27.45826,21.6819554 27.1093192,21.595926 26.7956758,21.4312633 L26.7956758,21.4312633 L24.375,20.1595 L24.375,18.0415 L27.6672394,19.7711422 C27.6840417,19.7799634 27.7015532,19.787205 27.7195477,19.7928111 L27.7747546,19.8046675 L27.8125,19.8069554 C27.985089,19.8069554 28.125,19.6670444 28.125,19.4944554 L28.125,19.4944554 L28.125,10.5055446 C28.125,10.4549389 28.1127101,10.4050902 28.0891868,10.360284 L28.0891868,10.360284 L28.0703849,10.3289938 C27.9821584,10.1997777 27.8091343,10.1543629 27.6672394,10.2288578 L27.6672394,10.2288578 L24.375,11.9565 L24.375,9.8395 Z"
|
||||||
|
id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g
|
||||||
|
id="ic_public_video_置灰"
|
||||||
|
stroke="none"
|
||||||
|
stroke-width="1"
|
||||||
|
fill="none"
|
||||||
|
fill-rule="evenodd">
|
||||||
|
<mask
|
||||||
|
id="mask-2"
|
||||||
|
fill="#8c8c8c">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use
|
||||||
|
id="形状结合"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
fill-rule="nonzero"
|
||||||
|
opacity="0.4"
|
||||||
|
xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="30px"
|
||||||
|
height="30px"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>ic_public_voice_置灰</title>
|
||||||
|
<defs>
|
||||||
|
<path
|
||||||
|
d="M23.4375,13.125 C23.955267,13.125 24.375,13.544733 24.375,14.0625 C24.375,18.9236084 20.6752266,22.9205885 15.9379544,23.3911656 L15.9375,26.5625 C15.9375,27.080267 15.517767,27.5 15,27.5 C14.5007247,27.5 14.092606,27.1097125 14.0640915,26.6175852 L14.0625,26.5625 L14.0620456,23.3911656 C9.32477337,22.9205885 5.625,18.9236084 5.625,14.0625 C5.625,13.544733 6.04473305,13.125 6.5625,13.125 C7.08026695,13.125 7.5,13.544733 7.5,14.0625 C7.5,18.2046356 10.8578644,21.5625 15,21.5625 C19.1421356,21.5625 22.5,18.2046356 22.5,14.0625 C22.5,13.544733 22.919733,13.125 23.4375,13.125 Z M15,2.5 C17.7614237,2.5 20,4.73857625 20,7.5 L20,7.5 L20,14.0625 C20,16.8239237 17.7614237,19.0625 15,19.0625 C12.2385763,19.0625 10,16.8239237 10,14.0625 L10,14.0625 L10,7.5 C10,4.73857625 12.2385763,2.5 15,2.5 Z M15,4.375 C13.2741102,4.375 11.875,5.77411016 11.875,7.5 L11.875,7.5 L11.875,14.0625 C11.875,15.7883898 13.2741102,17.1875 15,17.1875 C16.7258898,17.1875 18.125,15.7883898 18.125,14.0625 L18.125,14.0625 L18.125,7.5 C18.125,5.77411016 16.7258898,4.375 15,4.375 Z"
|
||||||
|
id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g
|
||||||
|
id="ic_public_voice_置灰"
|
||||||
|
stroke="none"
|
||||||
|
stroke-width="1"
|
||||||
|
fill="none"
|
||||||
|
fill-rule="evenodd">
|
||||||
|
<mask
|
||||||
|
id="mask-2"
|
||||||
|
fill="#8c8c8c">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use
|
||||||
|
id="形状结合"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
fill-rule="nonzero"
|
||||||
|
opacity="0.4"
|
||||||
|
xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
@@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import CallServiceProxy from '../../model/CallServiceProxy';
|
import CallServiceProxy from '../../model/CallServiceProxy';
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "BottomBtn";
|
const TAG = "BottomBtn";
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ export default struct BottomBtn {
|
|||||||
private mCallServiceProxy: CallServiceProxy;
|
private mCallServiceProxy: CallServiceProxy;
|
||||||
private imageList;
|
private imageList;
|
||||||
|
|
||||||
public aboutToAppear(callData, callList, callTimeList): void {
|
public aboutToAppear() {
|
||||||
HiLog.i(TAG, "aboutToAppear :");
|
LogUtils.i(TAG, "aboutToAppear :");
|
||||||
this.getImageList();
|
this.getImageList();
|
||||||
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ export default struct BottomBtn {
|
|||||||
*/
|
*/
|
||||||
onHangUp() {
|
onHangUp() {
|
||||||
this.mCallServiceProxy.hangUpCall(this.callData.callId);
|
this.mCallServiceProxy.hangUpCall(this.callData.callId);
|
||||||
HiLog.i(TAG, "onHangUp this.callData.callId : %s", this.callData.callId);
|
LogUtils.i(TAG, "onHangUp this.callData.callId : " + this.callData.callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,21 +17,23 @@
|
|||||||
* @file: Header information display component
|
* @file: Header information display component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import callList from '../components/CallList';
|
|
||||||
import Utils from '../utils/utils';
|
import LogUtils from '../utils/LogUtils';
|
||||||
import callStateConst from '../constant/CallStateConst';
|
import callStateConst from '../constant/CallStateConst';
|
||||||
import HiLog from '../utils/Hilog';
|
import Utils from '../utils/utils'
|
||||||
|
|
||||||
const TAG = "contactCard";
|
const TAG = "contactCard";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* call global variable
|
* call global variable 会黑屏
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
let callTimeList;
|
let callTimeList;
|
||||||
let defaultTemp = globalThis.exports.default;
|
let defaultTemp = globalThis.exports.default;
|
||||||
if (defaultTemp != undefined) {
|
if (defaultTemp != undefined) {
|
||||||
callTimeList = defaultTemp.data.callTimeList;
|
callTimeList = defaultTemp.data.callTimeList;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default struct ContactCard {
|
export default struct ContactCard {
|
||||||
@@ -40,29 +42,40 @@ export default struct ContactCard {
|
|||||||
@Prop isShowKeyboard: boolean;
|
@Prop isShowKeyboard: boolean;
|
||||||
@Link callList: Array<any>;
|
@Link callList: Array<any>;
|
||||||
@Link callData: any;
|
@Link callData: any;
|
||||||
|
@StorageLink("TextInput") textInput: string = '';
|
||||||
|
@StorageLink("TextInputValue") textInputValue: string = '';
|
||||||
|
@StorageLink("CallTimeList") callTimeList: any = [];
|
||||||
|
@StorageLink("AccountNumber") accountNumber: string = '';
|
||||||
|
@StorageLink("IsEmergencyPhoneNumber") isEmergencyPhoneNumber: boolean = false;
|
||||||
private mUtils: Utils;
|
private mUtils: Utils;
|
||||||
private timer;
|
private timer;
|
||||||
private emergency = $r('app.string.emergency');
|
private emergency = $r('app.string.emergency');
|
||||||
@StorageLink("CallTimeList") callTimeList: any = [];
|
|
||||||
@StorageLink("TextInput") textInput: string = '';
|
|
||||||
@StorageLink("TextInputValue") textInputValue: string = '';
|
|
||||||
@StorageLink("AccountNumber") accountNumber: string = '';
|
|
||||||
@StorageLink("IsEmergencyPhoneNumber") isEmergencyPhoneNumber: boolean = false;
|
|
||||||
|
|
||||||
public aboutToAppear(callData, callList, callTimeList): void {
|
public aboutToAppear(): void {
|
||||||
HiLog.i(TAG, "aboutToAppear");
|
LogUtils.i(TAG, "aboutToAppear");
|
||||||
this.mUtils = Utils.getInstance();
|
this.mUtils = Utils.getInstance();
|
||||||
|
this.callTimeList = [];
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
if (this.dialing === '...') {
|
if (this.dialing === '...') {
|
||||||
this.dialing = '';
|
this.dialing = '';
|
||||||
}
|
}
|
||||||
this.dialing += '.';
|
this.dialing += '.';
|
||||||
},500)
|
}, 500)
|
||||||
if (this.callData.callState === 3) {
|
if (this.callData.callState === 3) {
|
||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether to display the call list or the input box
|
||||||
|
*
|
||||||
|
* @return {boolean} - return success true fail false
|
||||||
|
*/
|
||||||
|
private isShowCard() {
|
||||||
|
return this.callList.length === 1 || (this.callList.length > 1 && this.callList.some((v) =>
|
||||||
|
v.callState === callStateConst.CALL_STATUS_WAITING));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call status
|
* Call status
|
||||||
*
|
*
|
||||||
@@ -81,16 +94,6 @@ export default struct ContactCard {
|
|||||||
return this.callState() === callStateConst.CALL_STATUS_ACTIVE && this.callList.length === 1;
|
return this.callState() === callStateConst.CALL_STATUS_ACTIVE && this.callList.length === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether to display the call list or the input box
|
|
||||||
*
|
|
||||||
* @return {boolean} - return success true fail false
|
|
||||||
*/
|
|
||||||
private isShowCard() {
|
|
||||||
return this.callList.length === 1 || (this.callList.length > 1 && this.callList.some((v) =>
|
|
||||||
v.callState === callStateConst.CALL_STATUS_WAITING));
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
GridContainer({ gutter: 24, margin: 24 }) {
|
GridContainer({ gutter: 24, margin: 24 }) {
|
||||||
Column() {
|
Column() {
|
||||||
@@ -195,6 +198,7 @@ export default struct ContactCard {
|
|||||||
if (this.isShowTime()) {
|
if (this.isShowTime()) {
|
||||||
Column() {
|
Column() {
|
||||||
Text(this.callTimeList[0].callTime)
|
Text(this.callTimeList[0].callTime)
|
||||||
|
// Text('00:56 ')
|
||||||
.fontSize(14)
|
.fontSize(14)
|
||||||
.height(19)
|
.height(19)
|
||||||
.lineHeight(19)
|
.lineHeight(19)
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import CallServiceProxy from "../../model/CallServiceProxy";
|
import CallServiceProxy from "../../model/CallServiceProxy";
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "DtmfBtn";
|
const TAG = "DtmfBtn";
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ export default struct DtmfBtn {
|
|||||||
|
|
||||||
public aboutToAppear(): void {
|
public aboutToAppear(): void {
|
||||||
this.textInput = "";
|
this.textInput = "";
|
||||||
HiLog.i(TAG, "aboutToAppear");
|
LogUtils.i(TAG, "aboutToAppear");
|
||||||
this.mCallServiceProxy = new CallServiceProxy();
|
this.mCallServiceProxy = new CallServiceProxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ export default struct DtmfBtn {
|
|||||||
*/
|
*/
|
||||||
onBtnTouchStart(obj) {
|
onBtnTouchStart(obj) {
|
||||||
this.mCallServiceProxy.startDTMF(this.callData.callId, String(obj.value));
|
this.mCallServiceProxy.startDTMF(this.callData.callId, String(obj.value));
|
||||||
HiLog.i(TAG, "onBtnTouchStart :");
|
LogUtils.i(TAG, "onBtnTouchStart :");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +52,7 @@ export default struct DtmfBtn {
|
|||||||
*/
|
*/
|
||||||
onBtnTouchEnd() {
|
onBtnTouchEnd() {
|
||||||
this.mCallServiceProxy.stopDTMF(this.callData.callId);
|
this.mCallServiceProxy.stopDTMF(this.callData.callId);
|
||||||
HiLog.i(TAG, "onBtnTouchEnd :");
|
LogUtils.i(TAG, "onBtnTouchEnd :");
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
@@ -90,7 +90,7 @@ export default struct DtmfBtn {
|
|||||||
}
|
}
|
||||||
AppStorage.SetOrCreate("textInputValue", this.textInputValue)
|
AppStorage.SetOrCreate("textInputValue", this.textInputValue)
|
||||||
AppStorage.SetOrCreate("TextInput", this.textInput)
|
AppStorage.SetOrCreate("TextInput", this.textInput)
|
||||||
HiLog.i(TAG, "textInputValue + TextInput : %s" + JSON.stringify(AppStorage.Get("textInputValue")) + JSON.stringify(AppStorage.Get("TextInput")));
|
LogUtils.i(TAG, "textInputValue + TextInput : %s" + JSON.stringify(AppStorage.Get("textInputValue")) + JSON.stringify(AppStorage.Get("TextInput")));
|
||||||
this.onBtnTouchStart(this.item)
|
this.onBtnTouchStart(this.item)
|
||||||
}
|
}
|
||||||
if (event.type === TouchType.Up) {
|
if (event.type === TouchType.Up) {
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Method from '../utils/Method';
|
import Method from '../utils/Method';
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "FuncBtn";
|
const TAG = "FuncBtn";
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export default struct FuncBtn {
|
|||||||
*/
|
*/
|
||||||
iconUrl() {
|
iconUrl() {
|
||||||
if (this.isDisable && this.iconDisableUrl) {
|
if (this.isDisable && this.iconDisableUrl) {
|
||||||
HiLog.i(TAG, "iconUrl this.isDisable : %s" + this.isDisable);
|
LogUtils.i(TAG, "iconUrl this.isDisable : " + this.isDisable);
|
||||||
return this.iconDisableUrl;
|
return this.iconDisableUrl;
|
||||||
}
|
}
|
||||||
return this.isActive && this.iconDefaultUrl ? this.iconActiveUrl : this.iconDefaultUrl;
|
return this.isActive && this.iconDefaultUrl ? this.iconActiveUrl : this.iconDefaultUrl;
|
||||||
@@ -47,7 +47,7 @@ export default struct FuncBtn {
|
|||||||
* Button group change picture
|
* Button group change picture
|
||||||
*/
|
*/
|
||||||
changeBtn(type) {
|
changeBtn(type) {
|
||||||
HiLog.i(TAG, "changeBtn type : %s" + type);
|
LogUtils.i(TAG, "changeBtn type : " + type);
|
||||||
const BtnName = ['record', 'video', 'mute'];
|
const BtnName = ['record', 'video', 'mute'];
|
||||||
if (Method.includes(BtnName, type)) {
|
if (Method.includes(BtnName, type)) {
|
||||||
this.isActive = !this.isActive;
|
this.isActive = !this.isActive;
|
||||||
@@ -73,12 +73,12 @@ export default struct FuncBtn {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
this.textColor = 'rgb(255, 255, 255)';
|
this.textColor = 'rgb(255, 255, 255)';
|
||||||
HiLog.i(TAG, "iconClassName this.isDisable :");
|
LogUtils.i(TAG, "iconClassName this.isDisable :");
|
||||||
return 'default';
|
return 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
private aboutToAppear(): void {
|
aboutToAppear() {
|
||||||
HiLog.i(TAG, "aboutToAppear");
|
LogUtils.i(TAG, "aboutToAppear");
|
||||||
this.iconClassName();
|
this.iconClassName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,13 +15,12 @@
|
|||||||
|
|
||||||
import Method from '../utils/Method';
|
import Method from '../utils/Method';
|
||||||
import FuncBtn from './FuncBtn';
|
import FuncBtn from './FuncBtn';
|
||||||
import FA from '@ohos.ability.featureAbility';
|
|
||||||
import CallStateConst from '../constant/CallStateConst';
|
import CallStateConst from '../constant/CallStateConst';
|
||||||
import CallServiceProxy from '../../model/CallServiceProxy';
|
import CallServiceProxy from '../../model/CallServiceProxy';
|
||||||
import Clone from '../utils/clone';
|
import Clone from '../utils/clone';
|
||||||
import ConferenceConst from '../constant/ConferenceConst';
|
import ConferenceConst from '../constant/ConferenceConst';
|
||||||
import BtnGroupConfig from '../configs/BtnGroupConfig';
|
import BtnGroupConfig from '../configs/BtnGroupConfig';
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = 'FuncBtnGroup';
|
const TAG = 'FuncBtnGroup';
|
||||||
const textMap =
|
const textMap =
|
||||||
@@ -53,7 +52,7 @@ export default struct FuncBtnGroup {
|
|||||||
private btnListCall;
|
private btnListCall;
|
||||||
private btnListDialing;
|
private btnListDialing;
|
||||||
|
|
||||||
private aboutToAppear(): void {
|
aboutToAppear() {
|
||||||
this.mClone = Clone.getInstance()
|
this.mClone = Clone.getInstance()
|
||||||
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
||||||
this.mBtnGroupConfig.btnGroupList.forEach((v) => {
|
this.mBtnGroupConfig.btnGroupList.forEach((v) => {
|
||||||
@@ -66,20 +65,20 @@ export default struct FuncBtnGroup {
|
|||||||
this.getBtnListCall()
|
this.getBtnListCall()
|
||||||
this.btnList = this.btnListCall
|
this.btnList = this.btnListCall
|
||||||
this.updateBtnList()
|
this.updateBtnList()
|
||||||
HiLog.i(TAG, "aboutToAppear :");
|
LogUtils.i(TAG, "aboutToAppear :");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switching BtnList Based on CallStatus
|
* Switching BtnList Based on CallStatus
|
||||||
*/
|
*/
|
||||||
updateBtnList() {
|
updateBtnList() {
|
||||||
if (this.callData.callState === CallStateConst.CALL_STATUS_DIALING|| this.callData.callState === CallStateConst.CALL_STATUS_ALERTING) {
|
if (this.callData.callState === CallStateConst.CALL_STATUS_DIALING || this.callData.callState === CallStateConst.CALL_STATUS_ALERTING) {
|
||||||
this.btnList = this.btnListDialing
|
this.btnList = this.btnListDialing
|
||||||
}else{
|
} else {
|
||||||
this.btnList = this.btnListCall
|
this.btnList = this.btnListCall
|
||||||
}
|
}
|
||||||
this.onCallStateChange(this.callData.callState)
|
this.onCallStateChange(this.callData.callState)
|
||||||
HiLog.i(TAG, "upData BtnList");
|
LogUtils.i(TAG, "upData BtnList");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,7 +88,6 @@ export default struct FuncBtnGroup {
|
|||||||
this.btnListDialing = this.mClone.clone(this.mBtnGroupConfig.btnGroupList);
|
this.btnListDialing = this.mClone.clone(this.mBtnGroupConfig.btnGroupList);
|
||||||
this.btnListDialing[1].isDisable = true
|
this.btnListDialing[1].isDisable = true
|
||||||
this.btnListDialing[2].isDisable = true
|
this.btnListDialing[2].isDisable = true
|
||||||
HiLog.i(TAG, "get btnListCall");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,7 +96,7 @@ export default struct FuncBtnGroup {
|
|||||||
* @param {Object} callData - call data
|
* @param {Object} callData - call data
|
||||||
*/
|
*/
|
||||||
onCallStateChange(newVal) {
|
onCallStateChange(newVal) {
|
||||||
HiLog.i(TAG, "Calling status changed : %s" + JSON.stringify(newVal));
|
LogUtils.i(TAG, "Calling status changed newState : " + JSON.stringify(newVal));
|
||||||
const BtnName= ['video', 'record', 'add', 'contact']
|
const BtnName= ['video', 'record', 'add', 'contact']
|
||||||
if (newVal === CallStateConst.CALL_STATUS_ACTIVE || newVal === CallStateConst.CALL_STATUS_HOLDING) {
|
if (newVal === CallStateConst.CALL_STATUS_ACTIVE || newVal === CallStateConst.CALL_STATUS_HOLDING) {
|
||||||
this.btnList.forEach((item) => {
|
this.btnList.forEach((item) => {
|
||||||
@@ -114,7 +112,7 @@ export default struct FuncBtnGroup {
|
|||||||
} else {
|
} else {
|
||||||
this.btnList.forEach((item) => {
|
this.btnList.forEach((item) => {
|
||||||
if (item.type === 'contact') {
|
if (item.type === 'contact') {
|
||||||
item.isDisable = true;
|
item.isDisable = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -126,7 +124,7 @@ export default struct FuncBtnGroup {
|
|||||||
* @param {Object} obj - object
|
* @param {Object} obj - object
|
||||||
*/
|
*/
|
||||||
btnClick(obj) {
|
btnClick(obj) {
|
||||||
HiLog.i(TAG, "btnClick get icon type : %s" + JSON.stringify(obj));
|
LogUtils.i(TAG, "btnClick get icon type : " + JSON.stringify(obj));
|
||||||
const BtnName= ['record', 'video', 'mute']
|
const BtnName= ['record', 'video', 'mute']
|
||||||
const type = obj.type;
|
const type = obj.type;
|
||||||
const { callId } = this.callData;
|
const { callId } = this.callData;
|
||||||
@@ -156,14 +154,12 @@ export default struct FuncBtnGroup {
|
|||||||
this.mCallServiceProxy.switchCall(callId);
|
this.mCallServiceProxy.switchCall(callId);
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case 'add':
|
||||||
FA.startAbility({
|
globalThis.calluiAbilityContext.startAbility({
|
||||||
want: {
|
|
||||||
bundleName: 'com.ohos.contacts',
|
bundleName: 'com.ohos.contacts',
|
||||||
abilityName: 'com.ohos.contacts.MainAbility',
|
abilityName: 'com.ohos.contacts.MainAbility',
|
||||||
parameters: {
|
parameters: {
|
||||||
pageFlag : 'page_flag_dialer'
|
pageFlag : 'page_flag_dialer'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'video':
|
case 'video':
|
||||||
@@ -172,14 +168,12 @@ export default struct FuncBtnGroup {
|
|||||||
this.muteHandle('mute');
|
this.muteHandle('mute');
|
||||||
break;
|
break;
|
||||||
case 'contact':
|
case 'contact':
|
||||||
FA.startAbility({
|
globalThis.calluiAbilityContext.startAbility({
|
||||||
want: {
|
|
||||||
bundleName: 'com.ohos.contacts',
|
bundleName: 'com.ohos.contacts',
|
||||||
abilityName: 'com.ohos.contacts.MainAbility',
|
abilityName: 'com.ohos.contacts.MainAbility',
|
||||||
parameters: {
|
parameters: {
|
||||||
pageFlag: "page_flag_choose_contacts"
|
pageFlag: "page_flag_choose_contacts"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'merge':
|
case 'merge':
|
||||||
@@ -197,7 +191,7 @@ export default struct FuncBtnGroup {
|
|||||||
*/
|
*/
|
||||||
keepHandle(type) {
|
keepHandle(type) {
|
||||||
const awaitIsActive = this.btnList.find((v) => v.type === type).isActive;
|
const awaitIsActive = this.btnList.find((v) => v.type === type).isActive;
|
||||||
HiLog.i(TAG, "keep handle");
|
LogUtils.i(TAG, "keep handle awaitIsActive : " + !awaitIsActive);
|
||||||
!awaitIsActive ? this.mCallServiceProxy.holdCall(this.callData.callId) : this.mCallServiceProxy.unHoldCall(this.callData.callId);
|
!awaitIsActive ? this.mCallServiceProxy.holdCall(this.callData.callId) : this.mCallServiceProxy.unHoldCall(this.callData.callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +202,7 @@ export default struct FuncBtnGroup {
|
|||||||
*/
|
*/
|
||||||
muteHandle(type) {
|
muteHandle(type) {
|
||||||
const awaitIsActive = this.btnList.find((v) => v.type === type).isActive;
|
const awaitIsActive = this.btnList.find((v) => v.type === type).isActive;
|
||||||
HiLog.i(TAG, "mute Handle");
|
LogUtils.i(TAG, "mute Handle awaitIsActive : " + awaitIsActive);
|
||||||
awaitIsActive ? this.mCallServiceProxy.setMuted() : this.mCallServiceProxy.cancelMuted();
|
awaitIsActive ? this.mCallServiceProxy.setMuted() : this.mCallServiceProxy.cancelMuted();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +210,7 @@ export default struct FuncBtnGroup {
|
|||||||
* Clear timer
|
* Clear timer
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
HiLog.i(TAG, "onDestroy");
|
LogUtils.i(TAG, "onDestroy");
|
||||||
this.timer && clearInterval(this.timer);
|
this.timer && clearInterval(this.timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = 'InComDialog';
|
const TAG = 'InComDialog';
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ export default struct InComDialog {
|
|||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.controller.close();
|
this.controller.close();
|
||||||
this.confirm(item)
|
this.confirm(item)
|
||||||
HiLog.i(TAG, "onClick and confirm");
|
LogUtils.i(TAG, "onClick and confirm");
|
||||||
})
|
})
|
||||||
|
|
||||||
if (item.id !== 4) {
|
if (item.id !== 4) {
|
||||||
@@ -73,7 +73,7 @@ export default struct InComDialog {
|
|||||||
}
|
}
|
||||||
.margin({ top: 8, bottom: 16 })
|
.margin({ top: 8, bottom: 16 })
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
HiLog.i(TAG, "onClick");
|
LogUtils.i(TAG, "onClick");
|
||||||
this.controller.close();
|
this.controller.close();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ import CallServiceProxy from '../../model/CallServiceProxy';
|
|||||||
import sms from '@ohos.telephony.sms';
|
import sms from '@ohos.telephony.sms';
|
||||||
import resourceManager from '@ohos.resourceManager';
|
import resourceManager from '@ohos.resourceManager';
|
||||||
import prompt from '@system.prompt';
|
import prompt from '@system.prompt';
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "IncomingCom";
|
const TAG = "IncomingCom";
|
||||||
const SMS_REJECTION = `${ImagePathConst.BASE_URL}ic_public_message.svg`;
|
const SMS_REJECTION = `${ImagePathConst.BASE_URL}ic_public_message.svg`;
|
||||||
@@ -51,10 +51,10 @@ const SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3;
|
|||||||
export default struct IncomingCom {
|
export default struct IncomingCom {
|
||||||
@State SendResult: any = {};
|
@State SendResult: any = {};
|
||||||
@Link callData: any;
|
@Link callData: any;
|
||||||
private btnList= [];
|
private btnList = [];
|
||||||
private msgList = [];
|
private msgList = [];
|
||||||
private remindList= [];
|
private remindList = [];
|
||||||
mCallServiceProxy: CallServiceProxy= null;
|
mCallServiceProxy: CallServiceProxy = null;
|
||||||
msgDialogController: CustomDialogController = new CustomDialogController
|
msgDialogController: CustomDialogController = new CustomDialogController
|
||||||
({
|
({
|
||||||
builder: InComDialog({
|
builder: InComDialog({
|
||||||
@@ -74,7 +74,7 @@ export default struct IncomingCom {
|
|||||||
alignment: (globalThis.deviceTypeInfo === "phone" || globalThis.deviceTypeInfo === "default") ? DialogAlignment.Bottom : DialogAlignment.Default
|
alignment: (globalThis.deviceTypeInfo === "phone" || globalThis.deviceTypeInfo === "default") ? DialogAlignment.Bottom : DialogAlignment.Default
|
||||||
});
|
});
|
||||||
|
|
||||||
private aboutToAppear(): void {
|
aboutToAppear() {
|
||||||
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
||||||
this.getMsgList();
|
this.getMsgList();
|
||||||
this.getBtnList();
|
this.getBtnList();
|
||||||
@@ -92,7 +92,7 @@ export default struct IncomingCom {
|
|||||||
resourceManager.getResourceManager().then(result => {
|
resourceManager.getResourceManager().then(result => {
|
||||||
result.getString(obj.msg.id, (err, typeName) => {
|
result.getString(obj.msg.id, (err, typeName) => {
|
||||||
content = typeName
|
content = typeName
|
||||||
HiLog.i(TAG, "sendMessage resourceManager.getResourceManager :");
|
LogUtils.i(TAG, "sendMessage resourceManager.getResourceManager :");
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
sms.sendMessage({
|
sms.sendMessage({
|
||||||
slotId: slotId,
|
slotId: slotId,
|
||||||
@@ -164,14 +164,14 @@ export default struct IncomingCom {
|
|||||||
if (this.SendResult) {
|
if (this.SendResult) {
|
||||||
resourceManager.getResourceManager().then(result => {
|
resourceManager.getResourceManager().then(result => {
|
||||||
result.getString($r("app.string.SMS_Sent")
|
result.getString($r("app.string.SMS_Sent")
|
||||||
.id, (err, typeName) => {
|
.id, (err, typeName) => {
|
||||||
Content = typeName
|
Content = typeName
|
||||||
prompt.showToast({
|
prompt.showToast({
|
||||||
message: this.callData.contactName ? Content + `${this.callData.contactName}` : Content + `${this.callData.accountNumber}`,
|
message: this.callData.contactName ? Content + `${this.callData.contactName}` : Content + `${this.callData.accountNumber}`,
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
this.mCallServiceProxy.rejectCall(this.callData.callId, obj.msg);
|
this.mCallServiceProxy.rejectCall(this.callData.callId, obj.msg);
|
||||||
HiLog.i(TAG, "msgItemClick :");
|
LogUtils.i(TAG, "msgItemClick :");
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -194,10 +194,10 @@ export default struct IncomingCom {
|
|||||||
const {callId, callState} = this.callData;
|
const {callId, callState} = this.callData;
|
||||||
if (callState !== CallStateConst.CALL_STATUS_WAITING) {
|
if (callState !== CallStateConst.CALL_STATUS_WAITING) {
|
||||||
this.mCallServiceProxy.rejectCall(callId);
|
this.mCallServiceProxy.rejectCall(callId);
|
||||||
HiLog.i(TAG, "onReject this.mCallServiceProxy.rejectCall :");
|
LogUtils.i(TAG, "onReject this.mCallServiceProxy.rejectCall :");
|
||||||
} else {
|
} else {
|
||||||
this.mCallServiceProxy.hangUpCall(callId);
|
this.mCallServiceProxy.hangUpCall(callId);
|
||||||
HiLog.i(TAG, "onReject this.mCallServiceProxy.hangUpCall :");
|
LogUtils.i(TAG, "onReject this.mCallServiceProxy.hangUpCall :");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ export default struct IncomingCom {
|
|||||||
* Enable the SMS reply pop-up
|
* Enable the SMS reply pop-up
|
||||||
*/
|
*/
|
||||||
private btnClick(type) {
|
private btnClick(type) {
|
||||||
HiLog.i(TAG, "btnClick : %s" + JSON.stringify(type));
|
LogUtils.i(TAG, "btnClick : %s" + JSON.stringify(type));
|
||||||
if (type === 'msg') {
|
if (type === 'msg') {
|
||||||
this.msgDialogController.open();
|
this.msgDialogController.open();
|
||||||
}
|
}
|
||||||
@@ -215,7 +215,7 @@ export default struct IncomingCom {
|
|||||||
* Answer the phone interface
|
* Answer the phone interface
|
||||||
*/
|
*/
|
||||||
private onAnswer() {
|
private onAnswer() {
|
||||||
HiLog.i(TAG, "onAnswer :");
|
LogUtils.i(TAG, "onAnswer :");
|
||||||
this.mCallServiceProxy.acceptCall(this.callData.callId);
|
this.mCallServiceProxy.acceptCall(this.callData.callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
import CallStateConst from '../constant/CallStateConst';
|
import CallStateConst from '../constant/CallStateConst';
|
||||||
import CallServiceProxy from '../../model/CallServiceProxy';
|
import CallServiceProxy from '../../model/CallServiceProxy';
|
||||||
import app from '@system.app';
|
import app from '@system.app';
|
||||||
import HiLog from '../utils/Hilog';
|
import LogUtils from '../utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "CallList";
|
const TAG = "CallList";
|
||||||
const font_color = "rgba(255, 255, 255, 0.60)";
|
const font_color = "rgba(255, 255, 255, 0.60)";
|
||||||
@@ -36,7 +36,7 @@ export default struct callList {
|
|||||||
private mCallServiceProxy: CallServiceProxy;
|
private mCallServiceProxy: CallServiceProxy;
|
||||||
|
|
||||||
public aboutToAppear(): void {
|
public aboutToAppear(): void {
|
||||||
HiLog.i(TAG, "aboutToAppear");
|
LogUtils.i(TAG, "aboutToAppear");
|
||||||
this.mCallStateConst = new CallStateConst();
|
this.mCallStateConst = new CallStateConst();
|
||||||
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
this.mCallServiceProxy = CallServiceProxy.getInstance();
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,9 @@ export default struct callList {
|
|||||||
public onHangUp(callId) {
|
public onHangUp(callId) {
|
||||||
this.mCallServiceProxy.hangUpCall(callId);
|
this.mCallServiceProxy.hangUpCall(callId);
|
||||||
if (this.callList.length === 1) {
|
if (this.callList.length === 1) {
|
||||||
app.terminate();
|
globalThis.calluiAbilityContext.terminateSelf().then((data) => {
|
||||||
|
LogUtils.i(TAG, "onHangUp terminateSelfCallBack");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ const deepType = [mapType, setType, arrayType, objectType, argsType];
|
|||||||
export default class Getclone {
|
export default class Getclone {
|
||||||
private static getclone: Getclone = new Getclone();
|
private static getclone: Getclone = new Getclone();
|
||||||
|
|
||||||
public static getInstance(): Getclone{
|
public static getInstance(): Getclone {
|
||||||
return this.getclone;
|
return this.getclone;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,36 +24,29 @@
|
|||||||
* 5. the function execute many times can not print.
|
* 5. the function execute many times can not print.
|
||||||
* 6. uniqueness.
|
* 6. uniqueness.
|
||||||
*/
|
*/
|
||||||
export default class HiLog {
|
|
||||||
private static readonly IS_DEBUG_ON: boolean = false;
|
|
||||||
private static readonly CALLUI: string = "callui";
|
|
||||||
private static readonly SLASH: string = "/";
|
|
||||||
private static readonly COLON: string = ": ";
|
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private static prefix(tag: string) {
|
/**
|
||||||
return this.CALLUI + this.SLASH + tag + this.COLON;
|
* log package tool class
|
||||||
}
|
*/
|
||||||
|
export class LogUtils {
|
||||||
static d(tag: string, msg: string, ...args: any[]) {
|
d(TAG, msg): void {
|
||||||
if (this.IS_DEBUG_ON) {
|
console.debug("[callui:]" + TAG + ":" + msg);
|
||||||
console.info(this.prefix(tag) + msg, args);
|
|
||||||
} else {
|
|
||||||
console.debug(this.prefix(tag) + msg, args);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static i(tag: string, msg: string, ...args: any[]) {
|
i(TAG, msg): void {
|
||||||
console.info(this.prefix(tag) + msg, args);
|
console.info("[callui:]" + TAG + ":" + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static w(tag: string, msg: string, ...args: any[]) {
|
w(TAG, msg): void {
|
||||||
console.warn(this.prefix(tag) + msg, args);
|
console.warn("[callui:]" + TAG + ":" + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static e(tag: string, msg: string, ...args: any[]) {
|
e(TAG, msg): void {
|
||||||
console.error(this.prefix(tag) + msg, args);
|
console.error("[callui:]" + TAG + ":" + msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mLogUtil = new LogUtils();
|
||||||
|
|
||||||
|
export default mLogUtil as LogUtils;
|
||||||
|
|
||||||
@@ -18,9 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
import CallStateManager from './CallStateManager';
|
import CallStateManager from './CallStateManager';
|
||||||
import CallStateConst from '../common/constant/CallStateConst';
|
import CallStateConst from '../common/constant/CallStateConst';
|
||||||
import app from '@system.app';
|
|
||||||
import NotificationManager from '../model/NotificationManager';
|
import NotificationManager from '../model/NotificationManager';
|
||||||
import HiLog from '../common/utils/Hilog';
|
import LogUtils from '../common/utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "CallDataManager";
|
const TAG = "CallDataManager";
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ const TAG = "CallDataManager";
|
|||||||
* class CallDataManager
|
* class CallDataManager
|
||||||
*/
|
*/
|
||||||
export default class CallDataManager {
|
export default class CallDataManager {
|
||||||
callData: any= {};
|
callData: any = {};
|
||||||
callList: any = [];
|
callList: any = [];
|
||||||
callTimeList: any = [];
|
callTimeList: any = [];
|
||||||
private callStateChange: any;
|
private callStateChange: any;
|
||||||
@@ -47,17 +46,22 @@ export default class CallDataManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* update callList and callData callTimeList
|
* update callList and callData callTimeList
|
||||||
|
*`
|
||||||
*
|
*
|
||||||
* @param { object } callData
|
* @param { object } callData
|
||||||
*/
|
*/
|
||||||
public update(callData) {
|
public update(callData) {
|
||||||
const { callState, callId } = callData;
|
const { callState, callId } = callData;
|
||||||
const targetObj = this.callList.find((v) => v.callId === callId);
|
const targetObj = this.callList.find((v) => v.callId === callId);
|
||||||
HiLog.i(TAG, "update :")
|
LogUtils.i(TAG, "update :")
|
||||||
if (targetObj) {
|
if (targetObj) {
|
||||||
|
const { oldCallState } = targetObj;
|
||||||
Object.assign(targetObj, {
|
Object.assign(targetObj, {
|
||||||
...callData
|
...callData
|
||||||
});
|
});
|
||||||
|
if (oldCallState != callState) {
|
||||||
|
AppStorage.Get<NotificationManager>('notificationManager').sendCapsuleNotification(callData, globalThis.appInactiveState);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.addCallList({
|
this.addCallList({
|
||||||
...callData
|
...callData
|
||||||
@@ -80,7 +84,10 @@ export default class CallDataManager {
|
|||||||
if (this.callList.length === 1) {
|
if (this.callList.length === 1) {
|
||||||
this.NotificationManager.cancelNotification();
|
this.NotificationManager.cancelNotification();
|
||||||
AppStorage.Get<NotificationManager>('notificationManager').sendCapsuleNotification(callData, true);
|
AppStorage.Get<NotificationManager>('notificationManager').sendCapsuleNotification(callData, true);
|
||||||
app.terminate();
|
AppStorage.Delete("CallTimeList");
|
||||||
|
globalThis.calluiAbilityContext.terminateSelf().then((data) => {
|
||||||
|
LogUtils.i(TAG, "calluiAbility terminateSelf");
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.removeCallById(callId);
|
this.removeCallById(callId);
|
||||||
const activeCallData = this.callList.find((v) => v.callState === CallStateConst.CALL_STATUS_ACTIVE);
|
const activeCallData = this.callList.find((v) => v.callState === CallStateConst.CALL_STATUS_ACTIVE);
|
||||||
@@ -124,7 +131,7 @@ export default class CallDataManager {
|
|||||||
*/
|
*/
|
||||||
updateCallTimeList(callData) {
|
updateCallTimeList(callData) {
|
||||||
const CallTimeObj = this.callTimeList.find((v) => v.callId === callData.callId);
|
const CallTimeObj = this.callTimeList.find((v) => v.callId === callData.callId);
|
||||||
HiLog.i(TAG, "updateCallTimeList : %s" + JSON.stringify(CallTimeObj))
|
LogUtils.i(TAG, "updateCallTimeList : " + JSON.stringify(CallTimeObj))
|
||||||
if (!CallTimeObj && callData.callState === CallStateConst.CALL_STATUS_ACTIVE) {
|
if (!CallTimeObj && callData.callState === CallStateConst.CALL_STATUS_ACTIVE) {
|
||||||
const obj = {
|
const obj = {
|
||||||
callId: callData.callId,
|
callId: callData.callId,
|
||||||
@@ -134,7 +141,7 @@ export default class CallDataManager {
|
|||||||
};
|
};
|
||||||
this.callTimeList.push(obj);
|
this.callTimeList.push(obj);
|
||||||
AppStorage.SetOrCreate("CallTimeList", this.callTimeList)
|
AppStorage.SetOrCreate("CallTimeList", this.callTimeList)
|
||||||
HiLog.i(TAG, "updateCallTimeList : %s" + JSON.stringify(this.callTimeList))
|
LogUtils.i(TAG, "updateCallTimeList : " + JSON.stringify(this.callTimeList))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,10 +19,9 @@
|
|||||||
import CallDataManager from './CallDataManager';
|
import CallDataManager from './CallDataManager';
|
||||||
import Utils from '../common/utils/utils';
|
import Utils from '../common/utils/utils';
|
||||||
import commonEvent from '@ohos.commonEvent';
|
import commonEvent from '@ohos.commonEvent';
|
||||||
import featureAbility from '@ohos.ability.featureAbility';
|
|
||||||
import CallServiceProxy from './CallServiceProxy';
|
import CallServiceProxy from './CallServiceProxy';
|
||||||
import ContactManager from './ContactManager';
|
import ContactManager from './ContactManager';
|
||||||
import HiLog from '../common/utils/Hilog';
|
import LogUtils from '../common/utils/LogUtils'
|
||||||
import call from '@ohos.telephony.call';
|
import call from '@ohos.telephony.call';
|
||||||
import CallStateConst from '../common/constant/CallStateConst';
|
import CallStateConst from '../common/constant/CallStateConst';
|
||||||
|
|
||||||
@@ -66,20 +65,15 @@ export default class CallManager {
|
|||||||
* init CallData
|
* init CallData
|
||||||
*/
|
*/
|
||||||
private initCallData() {
|
private initCallData() {
|
||||||
featureAbility.getWant().then((want) => {
|
if (globalThis.abilityWant && globalThis.abilityWant.parameters && ('callState' in globalThis.abilityWant.parameters)) {
|
||||||
if (want && want.parameters && ('callState' in want.parameters)) {
|
this.update(globalThis.abilityWant.parameters);
|
||||||
this.update(want.parameters);
|
LogUtils.i(TAG, "initCallData featureAbility.getWant :")
|
||||||
HiLog.i(TAG, "initCallData featureAbility.getWant :")
|
} else {
|
||||||
} else {
|
this.mCallServiceProxy.publish({
|
||||||
this.mCallServiceProxy.publish({
|
key: 'getInitCallData',
|
||||||
key: 'getInitCallData',
|
params: []
|
||||||
params: []
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
HiLog.i(TAG, "initCallData catch error : %s" + JSON.stringify(error))
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -99,13 +93,13 @@ export default class CallManager {
|
|||||||
commonEvent.subscribe(subscriber, (err, res) => {
|
commonEvent.subscribe(subscriber, (err, res) => {
|
||||||
if (err.code === 0) {
|
if (err.code === 0) {
|
||||||
const callData = JSON.parse(res.data);
|
const callData = JSON.parse(res.data);
|
||||||
HiLog.i(TAG, "commonEvent subscribe : %s" + JSON.stringify(subscriber))
|
LogUtils.i(TAG, "commonEvent subscribe : %s" + JSON.stringify(subscriber))
|
||||||
if (callData) {
|
if (callData) {
|
||||||
this.callData = callData
|
this.callData = callData
|
||||||
this.update(callData);
|
this.update(callData);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HiLog.i(TAG, "commonEvent.subscribe err : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "commonEvent.subscribe err : %s" + JSON.stringify(err))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -116,7 +110,7 @@ export default class CallManager {
|
|||||||
private unsubscribe() {
|
private unsubscribe() {
|
||||||
commonEvent.unsubscribe(subscriber, (err) => {
|
commonEvent.unsubscribe(subscriber, (err) => {
|
||||||
if (err.code !== 0) {
|
if (err.code !== 0) {
|
||||||
HiLog.i(TAG, "commonEvent.unsubscribe err: %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "commonEvent.unsubscribe err: %s" + JSON.stringify(err))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -137,7 +131,7 @@ export default class CallManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.isEmergencyPhoneNumber(callData.accountNumber)
|
this.isEmergencyPhoneNumber(callData.accountNumber)
|
||||||
HiLog.i(TAG, "update :")
|
LogUtils.i(TAG, "update :")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -148,13 +142,15 @@ export default class CallManager {
|
|||||||
* @return { boolean } - return success true fail false
|
* @return { boolean } - return success true fail false
|
||||||
*/
|
*/
|
||||||
private isEmergencyPhoneNumber = (phoneNumber) => new Promise((resolve, reject) => {
|
private isEmergencyPhoneNumber = (phoneNumber) => new Promise((resolve, reject) => {
|
||||||
call.isEmergencyPhoneNumber(phoneNumber, {slotId: 0}).then((res) => {
|
call.isEmergencyPhoneNumber(phoneNumber, {
|
||||||
|
slotId: 0
|
||||||
|
}).then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
AppStorage.SetOrCreate("IsEmergencyPhoneNumber", res)
|
AppStorage.SetOrCreate("IsEmergencyPhoneNumber", res)
|
||||||
HiLog.i(TAG, "then:isEmergencyPhoneNumber : %s" + JSON.stringify(res))
|
LogUtils.i(TAG, "then:isEmergencyPhoneNumber : %s" + JSON.stringify(res))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, "catch:isEmergencyPhoneNumber : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "catch:isEmergencyPhoneNumber : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
import commonEvent from '@ohos.commonEvent';
|
import commonEvent from '@ohos.commonEvent';
|
||||||
import call from '@ohos.telephony.call';
|
import call from '@ohos.telephony.call';
|
||||||
import app from '@system.app';
|
import app from '@system.app';
|
||||||
import HiLog from '../common/utils/Hilog';
|
import LogUtils from '../common/utils/LogUtils';
|
||||||
|
|
||||||
const TAG = "CallServiceProxy";
|
const TAG = "CallServiceProxy";
|
||||||
const prefixLog = 'callUI app:@ohos.telephony.call:';
|
const prefixLog = 'callUI app:@ohos.telephony.call:';
|
||||||
@@ -46,7 +46,7 @@ export default class CallServiceProxy {
|
|||||||
* Make a phone call
|
* Make a phone call
|
||||||
*/
|
*/
|
||||||
public dialCall(phoneNumber, accountId = 0, videoState = 0, dialScene = 0) {
|
public dialCall(phoneNumber, accountId = 0, videoState = 0, dialScene = 0) {
|
||||||
HiLog.i(TAG, "dialCall phoneNumber :")
|
LogUtils.i(TAG, "dialCall phoneNumber :")
|
||||||
return call.dial(phoneNumber, {
|
return call.dial(phoneNumber, {
|
||||||
accountId,
|
accountId,
|
||||||
videoState,
|
videoState,
|
||||||
@@ -68,9 +68,9 @@ export default class CallServiceProxy {
|
|||||||
*/
|
*/
|
||||||
public acceptCall = function (callId) {
|
public acceptCall = function (callId) {
|
||||||
call.answer(callId).then((res) => {
|
call.answer(callId).then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "call.answer : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "call.answer : %s" + JSON.stringify(callId))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "call.answer catch : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -86,10 +86,10 @@ export default class CallServiceProxy {
|
|||||||
public rejectCall = function (callId, isSendSms = false, msg = '') {
|
public rejectCall = function (callId, isSendSms = false, msg = '') {
|
||||||
const rejectCallPromise = isSendSms ? call.reject(callId, {messageContent: msg}) : call.reject(callId);
|
const rejectCallPromise = isSendSms ? call.reject(callId, {messageContent: msg}) : call.reject(callId);
|
||||||
rejectCallPromise.then((res) => {
|
rejectCallPromise.then((res) => {
|
||||||
HiLog.i(TAG,prefixLog + "then:rejectCall")
|
LogUtils.i(TAG,prefixLog + "then:rejectCall")
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "catch:rejectCall : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:rejectCall : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -103,10 +103,10 @@ export default class CallServiceProxy {
|
|||||||
public hangUpCall = (callId) => new Promise((resolve, reject) => {
|
public hangUpCall = (callId) => new Promise((resolve, reject) => {
|
||||||
call.hangup(callId).then((res) => {
|
call.hangup(callId).then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
HiLog.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:hangUpCall : %s" + JSON.stringify(callId))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, prefixLog + "catch:hangUpCall : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:hangUpCall : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -120,11 +120,11 @@ export default class CallServiceProxy {
|
|||||||
public holdCall = (callId) => new Promise((resolve, reject) => {
|
public holdCall = (callId) => new Promise((resolve, reject) => {
|
||||||
call.holdCall(callId).then((res) => {
|
call.holdCall(callId).then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
HiLog.i(TAG, prefixLog + "then:holdCall : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:holdCall : %s" + JSON.stringify(callId))
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, prefixLog + "catch:holdCall : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:holdCall : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -138,11 +138,11 @@ export default class CallServiceProxy {
|
|||||||
public unHoldCall = (callId) => new Promise((resolve, reject) => {
|
public unHoldCall = (callId) => new Promise((resolve, reject) => {
|
||||||
call.unHoldCall(callId).then((res) => {
|
call.unHoldCall(callId).then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
HiLog.i(TAG, prefixLog + "then:unholdCall : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:unholdCall : %s" + JSON.stringify(callId))
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, prefixLog + "catch:unHoldCall : %s" + JSON.stringify(err))
|
LogUtils.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) => {
|
public setAudioDevice = (device = 1) => new Promise((resolve, reject) => {
|
||||||
call.setAudioDevice(device).then((res) => {
|
call.setAudioDevice(device).then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:setAudioDevice : %s" + JSON.stringify(device))
|
LogUtils.i(TAG, prefixLog + "then:setAudioDevice : %s" + JSON.stringify(device))
|
||||||
resolve(res);
|
resolve(res);
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, prefixLog + "catch:setAudioDevice : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:setAudioDevice : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -169,9 +169,9 @@ export default class CallServiceProxy {
|
|||||||
*/
|
*/
|
||||||
public setMuted() {
|
public setMuted() {
|
||||||
call.setMuted().then((res) => {
|
call.setMuted().then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:setMute")
|
LogUtils.i(TAG, prefixLog + "then:setMute")
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG,prefixLog + "catch:setMute : %s" + JSON.stringify(err))
|
LogUtils.i(TAG,prefixLog + "catch:setMute : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -180,9 +180,9 @@ export default class CallServiceProxy {
|
|||||||
*/
|
*/
|
||||||
public cancelMuted() {
|
public cancelMuted() {
|
||||||
call.cancelMuted().then((res) => {
|
call.cancelMuted().then((res) => {
|
||||||
HiLog.i(TAG,prefixLog + "then:cancelMuted")
|
LogUtils.i(TAG,prefixLog + "then:cancelMuted")
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "catch:cancelMuted : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:cancelMuted : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -196,11 +196,11 @@ export default class CallServiceProxy {
|
|||||||
public switchCall = (callId) => new Promise((resolve, reject) => {
|
public switchCall = (callId) => new Promise((resolve, reject) => {
|
||||||
call.switchCall(callId).then((res) => {
|
call.switchCall(callId).then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
HiLog.i(TAG, prefixLog + "then:switchCall : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:switchCall : %s" + JSON.stringify(callId))
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
HiLog.i(TAG, prefixLog + "catch:switchCall : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:switchCall : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -212,10 +212,10 @@ export default class CallServiceProxy {
|
|||||||
public registerCallStateCallback(callBack) {
|
public registerCallStateCallback(callBack) {
|
||||||
call.on('callDetailsChange', (data) => {
|
call.on('callDetailsChange', (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback")
|
LogUtils.i(TAG, prefixLog + "call.on registerCallStateCallback")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HiLog.i(TAG, prefixLog + "call.on registerCallStateCallback callState")
|
LogUtils.i(TAG, prefixLog + "call.on registerCallStateCallback callState")
|
||||||
callBack(data);
|
callBack(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -226,10 +226,10 @@ export default class CallServiceProxy {
|
|||||||
public unRegisterCallStateCallback() {
|
public unRegisterCallStateCallback() {
|
||||||
call.off('callDetailsChange', (data) => {
|
call.off('callDetailsChange', (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
LogUtils.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HiLog.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
LogUtils.i(TAG, prefixLog + "call.off unRegisterCallStateCallback")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,9 +239,9 @@ export default class CallServiceProxy {
|
|||||||
public registerCallEventCallback() {
|
public registerCallEventCallback() {
|
||||||
call.on('callEventChange', (data) => {
|
call.on('callEventChange', (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
HiLog.i(TAG, prefixLog + "call.on callEventChange")
|
LogUtils.i(TAG, prefixLog + "call.on callEventChange")
|
||||||
} else {
|
} else {
|
||||||
HiLog.i(TAG, prefixLog + "call.on callEventChange")
|
LogUtils.i(TAG, prefixLog + "call.on callEventChange")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -252,9 +252,9 @@ export default class CallServiceProxy {
|
|||||||
public unRegisterCallEventCallback() {
|
public unRegisterCallEventCallback() {
|
||||||
call.off('callEventChange', (data) => {
|
call.off('callEventChange', (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
HiLog.i(TAG,prefixLog + "call.off unRegisterCallEventCallback : %s")
|
LogUtils.i(TAG,prefixLog + "call.off unRegisterCallEventCallback : %s")
|
||||||
} else {
|
} else {
|
||||||
HiLog.i(TAG,prefixLog + "call.off unRegisterCallEventCallback : %s")
|
LogUtils.i(TAG,prefixLog + "call.off unRegisterCallEventCallback : %s")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -268,9 +268,9 @@ export default class CallServiceProxy {
|
|||||||
*/
|
*/
|
||||||
public startDTMF = (callId, str) => {
|
public startDTMF = (callId, str) => {
|
||||||
call.startDTMF(callId, str).then((res) => {
|
call.startDTMF(callId, str).then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:startDtmf : %s" + JSON.stringify(callId) + JSON.stringify(str))
|
LogUtils.i(TAG, prefixLog + "then:startDtmf : %s" + JSON.stringify(callId) + JSON.stringify(str))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "catch:startDtmf : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:startDtmf : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -281,9 +281,9 @@ export default class CallServiceProxy {
|
|||||||
*/
|
*/
|
||||||
public stopDTMF = (callId) => {
|
public stopDTMF = (callId) => {
|
||||||
call.stopDTMF(callId).then((res) => {
|
call.stopDTMF(callId).then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:stopDtmf : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:stopDtmf : %s" + JSON.stringify(callId))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:startDtmf : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "then:startDtmf : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -294,22 +294,22 @@ export default class CallServiceProxy {
|
|||||||
*/
|
*/
|
||||||
public combineConference = (callId) => {
|
public combineConference = (callId) => {
|
||||||
call.combineConference(callId).then((res) => {
|
call.combineConference(callId).then((res) => {
|
||||||
HiLog.i(TAG, prefixLog + "then:combineConference : %s" + JSON.stringify(callId))
|
LogUtils.i(TAG, prefixLog + "then:combineConference : %s" + JSON.stringify(callId))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, prefixLog + "catch:combineConference : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, prefixLog + "catch:combineConference : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public publish(data) {
|
public publish(data) {
|
||||||
HiLog.i(TAG, prefixLog + "callui.event.callEvent publish")
|
LogUtils.i(TAG, prefixLog + "callui.event.callEvent publish")
|
||||||
commonEvent.publish('callui.event.callEvent', {
|
commonEvent.publish('callui.event.callEvent', {
|
||||||
bundleName: 'com.ohos.callui',
|
bundleName: 'com.ohos.callui',
|
||||||
isOrdered: false,
|
isOrdered: false,
|
||||||
data: JSON.stringify(data)
|
data: JSON.stringify(data)
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
HiLog.i(TAG, prefixLog + "callui.event.callEvent success")
|
LogUtils.i(TAG, prefixLog + "callui.event.callEvent success")
|
||||||
});
|
});
|
||||||
HiLog.i(TAG, prefixLog + "callui.event.callEvent publish end")
|
LogUtils.i(TAG, prefixLog + "callui.event.callEvent publish end")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ export default class CallStateManager {
|
|||||||
*
|
*
|
||||||
* @param { Object } data - callData
|
* @param { Object } data - callData
|
||||||
*/
|
*/
|
||||||
public static getInstance():CallStateManager{
|
public static getInstance(): CallStateManager {
|
||||||
return CallStateManager.sCallStateManager;
|
return CallStateManager.sCallStateManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file: Contact management
|
||||||
|
*/
|
||||||
|
import featureAbility from '@ohos.ability.featureAbility';
|
||||||
|
import dataAbility from '@ohos.data.dataAbility';
|
||||||
|
import LogUtils from '../common/utils/LogUtils';
|
||||||
|
|
||||||
|
const TAG = "ContactManager";
|
||||||
|
const DBbaseUri = 'dataability:///com.ohos.contactsdataability';
|
||||||
|
const DBUri = DBbaseUri + '/contacts/contact_data';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class ContactManager
|
||||||
|
*/
|
||||||
|
export default class ContactManager {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get contact info
|
||||||
|
*
|
||||||
|
* @param { Object } callData -Object
|
||||||
|
*/
|
||||||
|
async getContactInfo(callData) {
|
||||||
|
try {
|
||||||
|
const columns = ['id', 'display_name', 'detail_info'];
|
||||||
|
const predicates = new dataAbility.DataAbilityPredicates();
|
||||||
|
predicates.equalTo('detail_info', callData.accountNumber);
|
||||||
|
predicates.equalTo('is_deleted', 0);
|
||||||
|
const dataAbilityHelper = await featureAbility.acquireDataAbilityHelper(globalThis.calluiAbilityContext, DBbaseUri);
|
||||||
|
const resSet = await dataAbilityHelper.query(DBUri, columns, predicates);
|
||||||
|
LogUtils.i(TAG, "getContactInfo resSet : " + JSON.stringify(resSet))
|
||||||
|
if (resSet.rowCount > 0) {
|
||||||
|
resSet.goToFirstRow();
|
||||||
|
callData.contactName = resSet.getString(resSet.getColumnIndex('display_name'));
|
||||||
|
LogUtils.i(TAG, "getContactInfo callData.contactName:" + callData.contactName);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
LogUtils.i(TAG, "getContactInfo catch err : %s" + JSON.stringify(err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ import wantAgent from '@ohos.wantAgent';
|
|||||||
import notification from '@ohos.notification';
|
import notification from '@ohos.notification';
|
||||||
import commonEvent from '@ohos.commonEvent';
|
import commonEvent from '@ohos.commonEvent';
|
||||||
import callStateConst from '../common/constant/CallStateConst';
|
import callStateConst from '../common/constant/CallStateConst';
|
||||||
import HiLog from '../common/utils/Hilog';
|
import LogUtils from '../common/utils/LogUtils';
|
||||||
import resourceManager from '@ohos.resourceManager';
|
import resourceManager from '@ohos.resourceManager';
|
||||||
|
|
||||||
const TAG = "NotificationManager";
|
const TAG = "NotificationManager";
|
||||||
@@ -79,28 +79,29 @@ export default class NotificationManager {
|
|||||||
callId, btnType: key
|
callId, btnType: key
|
||||||
};
|
};
|
||||||
const wantAgentObj = await this.getWantAgent(data, SEND_COMMON_EVENT);
|
const wantAgentObj = await this.getWantAgent(data, SEND_COMMON_EVENT);
|
||||||
resourceManager.getResourceManager((error, mgr) => {
|
globalThis.calluiAbilityContext.resourceManager.getString(textMap[key].id, (error, value) => {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
return;
|
LogUtils.i(TAG, "sendNotification getResourceManager getString err")
|
||||||
|
} else {
|
||||||
|
LogUtils.i(TAG, "sendNotification getResourceManager getString value" + value)
|
||||||
|
notificationRequest.actionButtons.push({
|
||||||
|
title: value,
|
||||||
|
wantAgent: wantAgentObj
|
||||||
|
});
|
||||||
|
Object.assign(notificationRequest.content.longText, {
|
||||||
|
title: text,
|
||||||
|
expandedTitle: text
|
||||||
|
});
|
||||||
|
notification.publish(notificationRequest).then((data) => {
|
||||||
|
LogUtils.i(TAG, "sendNotification publish success")
|
||||||
|
}).catch((err) => {
|
||||||
|
LogUtils.i(TAG, "sendNotification public err" + JSON.stringify(err))
|
||||||
|
});
|
||||||
}
|
}
|
||||||
mgr.getString(textMap[key].id, (error, value) => {
|
|
||||||
if (error != null) {
|
|
||||||
} else {
|
|
||||||
notificationRequest.actionButtons.push({
|
|
||||||
title: value,
|
|
||||||
wantAgent: wantAgentObj
|
|
||||||
});
|
|
||||||
Object.assign(notificationRequest.content.longText, {
|
|
||||||
title: text,
|
|
||||||
expandedTitle: text
|
|
||||||
});
|
|
||||||
notification.publish(notificationRequest);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HiLog.i(TAG, "sendNotification end :")
|
LogUtils.i(TAG, "sendNotification end :")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,22 +109,22 @@ export default class NotificationManager {
|
|||||||
* @param callState
|
* @param callState
|
||||||
*/
|
*/
|
||||||
getMapObj(callState) {
|
getMapObj(callState) {
|
||||||
if (callState===callStateConst.CALL_STATUS_INCOMING) {
|
if (callState === callStateConst.CALL_STATUS_INCOMING) {
|
||||||
return ['answer', 'reject']
|
return ['answer', 'reject']
|
||||||
}
|
}
|
||||||
if (callState===callStateConst.CALL_STATUS_ACTIVE) {
|
if (callState === callStateConst.CALL_STATUS_ACTIVE) {
|
||||||
return ['hangUp']
|
return ['hangUp']
|
||||||
}
|
}
|
||||||
if (callState===callStateConst.CALL_STATUS_HOLDING) {
|
if (callState === callStateConst.CALL_STATUS_HOLDING) {
|
||||||
return ['hangUp']
|
return ['hangUp']
|
||||||
}
|
}
|
||||||
if (callState===callStateConst.CALL_STATUS_ALERTING) {
|
if (callState === callStateConst.CALL_STATUS_ALERTING) {
|
||||||
return ['hangUp']
|
return ['hangUp']
|
||||||
}
|
}
|
||||||
if (callState===callStateConst.CALL_STATUS_DIALING) {
|
if (callState === callStateConst.CALL_STATUS_DIALING) {
|
||||||
return ['hangUp']
|
return ['hangUp']
|
||||||
}
|
}
|
||||||
if (callState===callStateConst.CALL_STATUS_WAITING) {
|
if (callState === callStateConst.CALL_STATUS_WAITING) {
|
||||||
return ['answer', 'reject']
|
return ['answer', 'reject']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,11 +158,11 @@ export default class NotificationManager {
|
|||||||
* Cancel notice
|
* Cancel notice
|
||||||
*/
|
*/
|
||||||
cancelNotification() {
|
cancelNotification() {
|
||||||
HiLog.i(TAG, "cancelNotification")
|
LogUtils.i(TAG, "cancelNotification")
|
||||||
notification.cancel(ID).then((res) => {
|
notification.cancel(ID).then((res) => {
|
||||||
HiLog.i(TAG, "notify.cancel res data : %s" + JSON.stringify(res))
|
LogUtils.i(TAG, "notify.cancel res data : %s" + JSON.stringify(res))
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
HiLog.i(TAG, "notify.cancel err data : %s" + JSON.stringify(err))
|
LogUtils.i(TAG, "notify.cancel err data : %s" + JSON.stringify(err))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,22 +174,28 @@ export default class NotificationManager {
|
|||||||
* @param {boolean} isBackground - is background
|
* @param {boolean} isBackground - is background
|
||||||
*/
|
*/
|
||||||
sendCapsuleNotification(callData, isBackground) {
|
sendCapsuleNotification(callData, isBackground) {
|
||||||
HiLog.i(TAG, "sendCapsuleNotification isBackground : %s" + JSON.stringify(isBackground))
|
LogUtils.i(TAG, "sendCapsuleNotification isBackground : " + JSON.stringify(isBackground))
|
||||||
callData.startTime = (callData.startTime)
|
callData.startTime = (callData.startTime)
|
||||||
HiLog.i(TAG, "sendCapsuleNotification callData.startTime :")
|
LogUtils.i(TAG, "sendCapsuleNotification callData.startTime :")
|
||||||
const {callState, startTime} = callData;
|
const {callState, startTime} = callData;
|
||||||
commonEvent.publish('CAPSULE_EVENT_CALL_UI', {
|
let commonEventPublishData = {
|
||||||
bundleName: 'com.ohos.callui',
|
bundleName: 'com.ohos.systemui',
|
||||||
isOrdered: false,
|
isOrdered: false,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
callState,
|
callState,
|
||||||
startTime: startTime*1000,
|
startTime: startTime * 1000,
|
||||||
isBackground,
|
isBackground,
|
||||||
wantBundleName: CALL_BUNDLE_NAME,
|
wantBundleName: CALL_BUNDLE_NAME,
|
||||||
wantAbilityName: CALL_ABILITY_NAME
|
wantAbilityName: CALL_ABILITY_NAME
|
||||||
})
|
})
|
||||||
}, (res) => {
|
}
|
||||||
HiLog.i(TAG, "callUI app commonEvent.publish CAPSULE_EVENT_CALL_UI callback res : %s" + JSON.stringify(res))
|
|
||||||
});
|
commonEvent.publish('CAPSULE_EVENT_CALL_UI', commonEventPublishData, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
LogUtils.i(TAG, "sendCapsuleNotification publish launcher err:" + JSON.stringify(err))
|
||||||
|
} else {
|
||||||
|
LogUtils.i(TAG, "sendCapsuleNotification publish launcher success:" + JSON.stringify(data))
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,189 +1,164 @@
|
|||||||
/**
|
import ContactCard from '../common/components/ContactCard';
|
||||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
import FuncBtnGroup from '../common/components/FuncBtnGroup';
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
import BottomBtn from '../common/components/BottomBtn';
|
||||||
* you may not use this file except in compliance with the License.
|
import Keyboard from '../common/components/Keyboard';
|
||||||
* You may obtain a copy of the License at
|
import IncomingCom from '../common/components/IncomingCom';
|
||||||
*
|
import CallStateConst from '../common/constant/CallStateConst';
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
import LogUtils from '../common/utils/LogUtils';
|
||||||
*
|
import byTrace from "@ohos.bytrace"
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
import NotificationManager from '../model/NotificationManager';
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
import call from '@ohos.telephony.call';
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
import CallManager from '../model/CallManager';
|
||||||
* See the License for the specific language governing permissions and
|
import notification from '@ohos.notification';
|
||||||
* limitations under the License.
|
|
||||||
*/
|
const TAG = "MainAbility Index";
|
||||||
|
const SIM_CARD_DELAYED_DISPLAY = 100;
|
||||||
/**
|
|
||||||
* @file: Main interface
|
/**
|
||||||
*/
|
* @file: Main interface
|
||||||
|
*/
|
||||||
import ContactCard from '../common/components/ContactCard';
|
@Entry
|
||||||
import FuncBtnGroup from '../common/components/FuncBtnGroup';
|
@Component
|
||||||
import Keyboard from '../common/components/Keyboard';
|
struct Index {
|
||||||
import BottomBtn from '../common/components/BottomBtn';
|
@State message: string = 'Hello World'
|
||||||
import IncomingCom from '../common/components/IncomingCom';
|
@StorageLink("InputNum") inputNum: any = [];
|
||||||
import CallStateConst from '../common/constant/CallStateConst';
|
@State callData: any = CallStateConst.defaultCallData;
|
||||||
import NotificationManager from '../model/NotificationManager';
|
@State isShowKeyboard: boolean = false;
|
||||||
import call from '@ohos.telephony.call';
|
@State callList: Array<any> = [];
|
||||||
import CallManager from '../model/CallManager';
|
private consoleTxt: '';
|
||||||
import HiLog from '../common/utils/Hilog';
|
private callStateConst;
|
||||||
import bundle from '@ohos.bundle';
|
private notificationManager: NotificationManager;
|
||||||
import abilityAccessCtrl from "@ohos.abilityAccessCtrl";
|
|
||||||
import featureAbility from "@ohos.ability.featureAbility"
|
aboutToAppear(): void {
|
||||||
import byTrace from "@ohos.bytrace"
|
LogUtils.i(TAG, "aboutToAppear :")
|
||||||
|
byTrace.startTrace('aboutToAppear', 0);
|
||||||
const TAG = "Index";
|
this.callStateConst = new CallStateConst();
|
||||||
const prefixLog = 'callUI app:@ohos.telephony.call:';
|
this.notificationManager = new NotificationManager();
|
||||||
const SIM_CARD_DELAYED_DISPLAY = 100;
|
globalThis.callManager = new CallManager(this)
|
||||||
const textMap =
|
AppStorage.SetOrCreate<NotificationManager>('notificationManager', this.notificationManager);
|
||||||
{
|
let delayMethod = setTimeout(() => {
|
||||||
'answer': $r('app.string.answer'),
|
clearTimeout(delayMethod);
|
||||||
'reject': $r('app.string.reject'),
|
}, SIM_CARD_DELAYED_DISPLAY);
|
||||||
'hangUp': $r('app.string.hangUp'),
|
byTrace.finishTrace('aboutToAppear', 0);
|
||||||
'mute': $r('app.string.mute'),
|
}
|
||||||
'callHold': $r('app.string.callHold'),
|
|
||||||
};
|
onPageShow() {
|
||||||
|
LogUtils.i(TAG, "onPageShow : ")
|
||||||
/**
|
byTrace.startTrace('onPageShow', 1);
|
||||||
* @file: Main interface
|
globalThis.appInactiveState = false;
|
||||||
*/
|
this.notificationManager.cancelNotification();
|
||||||
@Entry
|
this.notificationManager.sendCapsuleNotification(this.callData, false);
|
||||||
@Component
|
byTrace.finishTrace('onPageShow', 1);
|
||||||
export default struct Index {
|
LogUtils.i(TAG, "onPageShow end : ")
|
||||||
@StorageLink("InputNum") inputNum: any = [];
|
}
|
||||||
@State callData: any = CallStateConst.defaultCallData;
|
|
||||||
@State isShowKeyboard: boolean = false;
|
onPageHide() {
|
||||||
private appInactiveState = false
|
LogUtils.i(TAG, "onPageHide :")
|
||||||
@State callList: Array<any> = [];
|
globalThis.appInactiveState = true;
|
||||||
private consoleTxt: '';
|
const {callState, accountNumber, contactName, callId} = this.callData;
|
||||||
private callStateConst;
|
let fool = (callState !== CallStateConst.callStateObj.CALL_STATUS_DISCONNECTED && callId)
|
||||||
private notificationManager: NotificationManager;
|
if (callState !== CallStateConst.callStateObj.CALL_STATUS_DISCONNECTED && callId) {
|
||||||
|
let text = contactName + ' ' + accountNumber + ' ';
|
||||||
/**
|
if (!contactName) {
|
||||||
* Call status
|
text = accountNumber + ' ';
|
||||||
*
|
}
|
||||||
* @return {number} - callState
|
this.notificationManager.sendNotification(text, this.callData);
|
||||||
*/
|
this.notificationManager.sendCapsuleNotification(this.callData, true);
|
||||||
private callState() {
|
LogUtils.i(TAG, "onPageHide end : ")
|
||||||
return this.callData.callState;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* method to control the display of DTMF keyboard
|
* method to control the display of DTMF keyboard
|
||||||
*
|
*
|
||||||
* parent component pass by value child component
|
* parent component pass by value child component
|
||||||
*/
|
*/
|
||||||
public showKeyboard() {
|
public showKeyboard() {
|
||||||
this.isShowKeyboard = !this.isShowKeyboard;
|
this.isShowKeyboard = !this.isShowKeyboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialing function
|
* Call status
|
||||||
*/
|
*
|
||||||
public dialCall(phoneNumber, accountId = 0, videoState = 0, dialScene = 0) {
|
* @return {number} - callState
|
||||||
HiLog.i(TAG, "dialCall phoneNumber :")
|
*/
|
||||||
call.dial(phoneNumber, {
|
private callState() {
|
||||||
accountId,
|
LogUtils.i(TAG, "callState : " + this.callData.callState)
|
||||||
videoState,
|
return this.callData.callState;
|
||||||
dialScene
|
}
|
||||||
});
|
|
||||||
}
|
/**
|
||||||
|
* Dialing function
|
||||||
aboutToAppear(): void {
|
*/
|
||||||
HiLog.i(TAG, "aboutToAppear :")
|
public dialCall(phoneNumber, accountId = 0, videoState = 0, dialScene = 0) {
|
||||||
byTrace.startTrace('aboutToAppear', 0);
|
LogUtils.i(TAG, "dialCall phoneNumber :")
|
||||||
this.callStateConst = new CallStateConst();
|
call.dial(phoneNumber, {
|
||||||
this.notificationManager = new NotificationManager();
|
accountId,
|
||||||
globalThis.callManager = new CallManager(this)
|
videoState,
|
||||||
AppStorage.SetOrCreate<NotificationManager>('notificationManager', this.notificationManager);
|
dialScene
|
||||||
let delayMethod = setTimeout(() => {
|
});
|
||||||
clearTimeout(delayMethod);
|
}
|
||||||
}, SIM_CARD_DELAYED_DISPLAY);
|
|
||||||
byTrace.finishTrace('aboutToAppear', 0);
|
build() {
|
||||||
}
|
Column() {
|
||||||
|
Stack() {
|
||||||
onPageShow() {
|
Flex({
|
||||||
HiLog.i(TAG, "onPageShow : ")
|
direction: FlexDirection.Column,
|
||||||
byTrace.startTrace('onPageShow', 1);
|
alignItems: ItemAlign.Center,
|
||||||
this.appInactiveState = false;
|
justifyContent: FlexAlign.SpaceBetween
|
||||||
this.notificationManager.cancelNotification();
|
}) {
|
||||||
this.notificationManager.sendCapsuleNotification(this.callData, false);
|
Column() {
|
||||||
byTrace.finishTrace('onPageShow', 1);
|
ContactCard({
|
||||||
HiLog.i(TAG, "onPageShow end : ")
|
callData: $callData,
|
||||||
}
|
isShowKeyboard: this.isShowKeyboard,
|
||||||
|
callList: $callList
|
||||||
onPageHide() {
|
})
|
||||||
HiLog.i(TAG, "onPageHide :")
|
}
|
||||||
this.appInactiveState = true;
|
.margin({ top: 56 })
|
||||||
const {callState, accountNumber, contactName, callId} = this.callData;
|
|
||||||
let fool = (callState !== CallStateConst.callStateObj.CALL_STATUS_DISCONNECTED && callId)
|
if (this.callState() !== CallStateConst.callStateObj.CALL_STATUS_WAITING
|
||||||
if (callState !== CallStateConst.callStateObj.CALL_STATUS_DISCONNECTED && callId) {
|
&& this.callState() !== CallStateConst.callStateObj.CALL_STATUS_INCOMING) {
|
||||||
let text = contactName + ' ' + accountNumber + ' ';
|
Column() {
|
||||||
if (!contactName) {
|
Column() {
|
||||||
text = accountNumber + ' ' ;
|
Column() {
|
||||||
}
|
FuncBtnGroup({ callData: $callData, callList: $callList })
|
||||||
this.notificationManager.sendNotification(text, this.callData);
|
}
|
||||||
this.notificationManager.sendCapsuleNotification(this.callData, true);
|
.margin({ bottom: 29.5 })
|
||||||
HiLog.i(TAG, "onPageHide end : ")
|
}
|
||||||
}
|
.visibility(!this.isShowKeyboard ? Visibility.Visible : Visibility.None)
|
||||||
}
|
|
||||||
|
Column() {
|
||||||
build() {
|
Column() {
|
||||||
Column() {
|
Keyboard({ callData: $callData })
|
||||||
Stack() {
|
}
|
||||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
|
.margin({ bottom: 32 })
|
||||||
Column() {
|
}
|
||||||
ContactCard({
|
.visibility(this.isShowKeyboard ? Visibility.Visible : Visibility.None)
|
||||||
callData: $callData,
|
|
||||||
isShowKeyboard: this.isShowKeyboard,
|
Column() {
|
||||||
callList: $callList
|
BottomBtn({
|
||||||
})
|
callData: $callData,
|
||||||
}
|
onItemClick: () => {
|
||||||
.margin({ top: 56 })
|
this.showKeyboard()
|
||||||
|
}
|
||||||
if (this.callState() !== CallStateConst.callStateObj.CALL_STATUS_WAITING
|
})
|
||||||
&& this.callState() !== CallStateConst.callStateObj.CALL_STATUS_INCOMING) {
|
}
|
||||||
Column() {
|
}
|
||||||
Column() {
|
.margin({ bottom: 106 })
|
||||||
Column() {
|
} else {
|
||||||
FuncBtnGroup({ callData: $callData, callList: $callList })
|
Column() {
|
||||||
}
|
IncomingCom({
|
||||||
.margin({ bottom: 29.5 })
|
callData: $callData,
|
||||||
}
|
})
|
||||||
.visibility(!this.isShowKeyboard ? Visibility.Visible : Visibility.None)
|
}
|
||||||
|
.margin({ bottom: 106 })
|
||||||
Column() {
|
}
|
||||||
Column() {
|
}
|
||||||
Keyboard({ callData: $callData })
|
}
|
||||||
}
|
}
|
||||||
.margin({ bottom: 32 })
|
.width("100%")
|
||||||
}
|
.height("100%")
|
||||||
.visibility(this.isShowKeyboard ? Visibility.Visible : Visibility.None)
|
.backgroundImage('assets/picture/wallpaper.png', ImageRepeat.NoRepeat)
|
||||||
|
.backgroundImageSize(ImageSize.Cover)
|
||||||
Column() {
|
}
|
||||||
BottomBtn({
|
}
|
||||||
callData: $callData,
|
|
||||||
onItemClick: () => {
|
|
||||||
this.showKeyboard()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.margin({ bottom: 106 })
|
|
||||||
} else {
|
|
||||||
Column() {
|
|
||||||
IncomingCom({
|
|
||||||
callData: $callData,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
.margin({ bottom: 106 })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.width("100%")
|
|
||||||
.height("100%")
|
|
||||||
.backgroundImage('assets/picture/wallpaper.png', ImageRepeat.NoRepeat)
|
|
||||||
.backgroundImageSize(ImageSize.Cover)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"module": {
|
||||||
|
"name": "com.ohos.callui",
|
||||||
|
"type": "entry",
|
||||||
|
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
|
||||||
|
"description": "$string:callui_description",
|
||||||
|
"mainElement": "com.ohos.callui.ServiceAbility",
|
||||||
|
"deviceTypes": [
|
||||||
|
"default",
|
||||||
|
"tablet"
|
||||||
|
],
|
||||||
|
"deliveryWithInstall": true,
|
||||||
|
"installationFree": false,
|
||||||
|
"pages": "$profile:main_pages",
|
||||||
|
"uiSyntax": "ets",
|
||||||
|
"abilities": [
|
||||||
|
{
|
||||||
|
"name": "com.ohos.callui.MainAbility",
|
||||||
|
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
|
||||||
|
"description": "$string:callui_description",
|
||||||
|
"icon": "$media:icon",
|
||||||
|
"label": "$string:callui_description",
|
||||||
|
"startWindowIcon": "$media:icon",
|
||||||
|
"startWindowBackground": "$color:black",
|
||||||
|
"visible": true,
|
||||||
|
"skills": [
|
||||||
|
{
|
||||||
|
"entities": [
|
||||||
|
"entity.system.home"
|
||||||
|
],
|
||||||
|
"actions": [
|
||||||
|
"action.system.home"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extensionAbilities": [
|
||||||
|
{
|
||||||
|
"name": "com.ohos.callui.ServiceAbility",
|
||||||
|
"icon": "$media:app_icon",
|
||||||
|
"description": "service",
|
||||||
|
"type": "service",
|
||||||
|
"visible": true,
|
||||||
|
"srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
|
||||||
|
"label": "$string:callui_description"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestPermissions": [
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.READ_CONTACTS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.SEND_MESSAGES"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.SET_TELEPHONY_STATE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.GET_TELEPHONY_STATE"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"color": [
|
||||||
|
{
|
||||||
|
"name": "white",
|
||||||
|
"value": "#FFFFFF"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "black",
|
||||||
|
"value": "#000000"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,212 +1,208 @@
|
|||||||
{
|
{
|
||||||
"string": [
|
"string": [
|
||||||
{
|
{
|
||||||
"name": "entry_MainAbility",
|
"name": "callui_description",
|
||||||
"value": "通话"
|
"value": "Phone"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mainability_description",
|
"name": "sms",
|
||||||
"value": "JS_Empty Ability"
|
"value": "Message"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sms",
|
"name": "remind",
|
||||||
"value": "Message"
|
"value": "Reminder"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "remind",
|
"name": "hangUpReply",
|
||||||
"value": "Reminder"
|
"value": "Respond with"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hangUpReply",
|
"name": "backLater",
|
||||||
"value": "Respond with"
|
"value": "I'll call you back."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "backLater",
|
"name": "answerThePhone",
|
||||||
"value": "I'll call you back."
|
"value": "Sorry, I can't talk right now."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "answerThePhone",
|
"name": "contactMeLater",
|
||||||
"value": "Sorry, I can't talk right now."
|
"value": "I'm in a meeting. I'll get back to you ASAP."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "contactMeLater",
|
"name": "beThereSoon",
|
||||||
"value": "I'm in a meeting. I'll get back to you ASAP."
|
"value": "I'm on my way."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "beThereSoon",
|
"name": "customSMS",
|
||||||
"value": "I'm on my way."
|
"value": "Custom..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "customSMS",
|
"name": "cancel",
|
||||||
"value": "Custom..."
|
"value": "CANCEL"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "cancel",
|
"name": "callBackReminder",
|
||||||
"value": "CANCEL"
|
"value": "Callback reminder"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "callBackReminder",
|
"name": "minutes",
|
||||||
"value": "Callback reminder"
|
"value": "In 30 minutes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "minutes",
|
"name": "oneHourLater",
|
||||||
"value": "In 30 minutes"
|
"value": "In 1 hour"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "oneHourLater",
|
"name": "twoHoursLater",
|
||||||
"value": "In 1 hour"
|
"value": "In 2 hours"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twoHoursLater",
|
"name": "dialing",
|
||||||
"value": "In 2 hours"
|
"value": "Dialing"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dialing",
|
"name": "calling",
|
||||||
"value": "Dialing"
|
"value": "calling"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "calling",
|
"name": "callHold",
|
||||||
"value": "calling"
|
"value": "Call hold"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "callHold",
|
"name": "hangUpCompleted",
|
||||||
"value": "Call hold"
|
"value": "Hang up completed"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hangUpCompleted",
|
"name": "hangingUp",
|
||||||
"value": "Hang up completed"
|
"value": "Hanging up"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hangingUp",
|
"name": "recording",
|
||||||
"value": "Hanging up"
|
"value": "Record"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "recording",
|
"name": "keep",
|
||||||
"value": "Record"
|
"value": "Hold"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "keep",
|
"name": "addCall",
|
||||||
"value": "Hold"
|
"value": "Add call"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "addCall",
|
"name": "videoCall",
|
||||||
"value": "Add call"
|
"value": "Video call"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "videoCall",
|
"name": "mute",
|
||||||
"value": "Video call"
|
"value": "Mute"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mute",
|
"name": "contactPerson",
|
||||||
"value": "Mute"
|
"value": "Contacts"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "contactPerson",
|
"name": "partyIsRinging",
|
||||||
"value": "Contacts"
|
"value": "Ringing"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "partyIsRinging",
|
"name": "saveNumber",
|
||||||
"value": "Ringing"
|
"value": "Save number"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "saveNumber",
|
"name": "addToBlacklist",
|
||||||
"value": "Save number"
|
"value": "add to blacklist"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "addToBlacklist",
|
"name": "shutDown",
|
||||||
"value": "add to blacklist"
|
"value": "shut down"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "shutDown",
|
"name": "speaker",
|
||||||
"value": "shut down"
|
"value": "Speaker"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "speaker",
|
"name": "phoneHandset",
|
||||||
"value": "Speaker"
|
"value": "Handset earpiece"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phoneHandset",
|
"name": "mobileNetwork",
|
||||||
"value": "Handset earpiece"
|
"value": "Unable to access the mobile network."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mobileNetwork",
|
"name": "gotIt",
|
||||||
"value": "Unable to access the mobile network."
|
"value": "Got it"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gotIt",
|
"name": "currentCall",
|
||||||
"value": "Got it"
|
"value": "Current cal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "currentCall",
|
"name": "hangUp",
|
||||||
"value": "Current cal"
|
"value": "hang up"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hangUp",
|
"name": "handsFree",
|
||||||
"value": "hang up"
|
"value": "Hands-free"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "handsFree",
|
"name": "incomingCall",
|
||||||
"value": "Hands-free"
|
"value": "Incoming call"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "incomingCall",
|
"name": "reject",
|
||||||
"value": "Incoming call"
|
"value": "DECLINE"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "reject",
|
"name": "answer",
|
||||||
"value": "DECLINE"
|
"value": "ANSWER"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "answer",
|
"name": "maintain",
|
||||||
"value": "ANSWER"
|
"value": "On hold"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maintain",
|
"name": "exchange",
|
||||||
"value": "On hold"
|
"value": "Swap"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "exchange",
|
"name": "mergeCall",
|
||||||
"value": "Swap"
|
"value": "Merge calls"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mergeCall",
|
"name": "manageUsers",
|
||||||
"value": "Merge calls"
|
"value": "Manage users"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "manageUsers",
|
"name": "telephoneConference",
|
||||||
"value": "Manage users"
|
"value": "Conference"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "telephoneConference",
|
"name": "unknownNumber",
|
||||||
"value": "Conference"
|
"value": "Unknown number"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "unknownNumber",
|
"name": "noCard",
|
||||||
"value": "Unknown number"
|
"value": "Can't access mobile network"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "noCard",
|
"name": "telephone_Conference",
|
||||||
"value": "Can't access mobile network"
|
"value": "Conference"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "telephone_Conference",
|
"name": "message_Failed",
|
||||||
"value": "Conference"
|
"value": "message failed to send"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "message_Failed",
|
"name": "SMS_Sent",
|
||||||
"value": "message failed to send"
|
"value": "SMS sent to"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "SMS_Sent",
|
"name": "SMS_Authorization_Notification",
|
||||||
"value": "SMS sent to"
|
"value": "Go to settings for SMS Authorization"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "SMS_Authorization_Notification",
|
"name": "emergency",
|
||||||
"value": "Go to settings for SMS Authorization"
|
"value": "Emergency"
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
"name": "emergency",
|
|
||||||
"value": "Emergency"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 493 B |