&ottVec);
int32_t ReportOttCallEventInfo(OttCallEventInfo &eventInfo);
+ bool HasVoiceCapability();
};
} // namespace Telephony
} // namespace OHOS
diff --git a/interfaces/innerkits/call_manager_errors.h b/interfaces/innerkits/call_manager_errors.h
old mode 100755
new mode 100644
diff --git a/interfaces/innerkits/call_manager_inner_type.h b/interfaces/innerkits/call_manager_inner_type.h
old mode 100755
new mode 100644
index d7038d45184ba31d44c185c64fa78df34338c8ea..32e351edb00578ce802d1399641c1ebc49e7edd4
--- a/interfaces/innerkits/call_manager_inner_type.h
+++ b/interfaces/innerkits/call_manager_inner_type.h
@@ -78,8 +78,8 @@ enum class DialScene {
};
enum class CallDirection {
- CALL_DIRECTION_OUT = 0,
- CALL_DIRECTION_IN,
+ CALL_DIRECTION_IN = 0,
+ CALL_DIRECTION_OUT,
CALL_DIRECTION_UNKNOW,
};
@@ -166,6 +166,7 @@ struct CallAttributeInfo {
struct CallRecordInfo {
int32_t callId;
char phoneNumber[kMaxNumberLen + 1];
+ char formattedPhoneNumber[kMaxNumberLen + 1];
CallType callType;
time_t callBeginTime;
time_t callEndTime;
@@ -367,12 +368,19 @@ struct ClirResponse {
int32_t clirStat;
};
+struct MmiCodeInfo {
+ int32_t result; // 0: ok other: error
+ char message[kMaxNumberLen + 1];
+};
+
struct CallTransferResponse {
int32_t result; // 0: ok other: error
int32_t status;
int32_t classx;
int32_t type;
char number[kMaxNumberLen + 1];
+ int32_t reason;
+ int32_t time;
};
struct CallRestrictionResponse {
@@ -417,6 +425,16 @@ struct MuteControlResponse {
int32_t value; // 0: Un mute 1: Set mute
};
+struct CellularCallInfo {
+ int32_t callId; // uuid
+ char phoneNum[kMaxNumberLen]; // call phone number
+ int32_t slotId; // del
+ int32_t accountId;
+ CallType callType; // call type: CS、IMS
+ int32_t videoState; // 0: audio 1:video
+ int32_t index; // CallInfo index
+};
+
/**
* 27007-430_2001 7.11 Call forwarding number and conditions +CCFC
* 3GPP TS 22.082 [4]
@@ -455,6 +473,14 @@ struct CallTransferInfo {
CallTransferType type;
};
+enum class SsRequestType {
+ SS_ACTIVATION = 0,
+ SS_DEACTIVATION,
+ SS_INTERROGATION,
+ SS_REGISTRATION,
+ SS_ERASURE,
+};
+
struct VideoWindow {
int32_t x;
int32_t y;
diff --git a/interfaces/kits/js/@ohos.telephony.call.d.ts b/interfaces/kits/js/@ohos.telephony.call.d.ts
old mode 100755
new mode 100644
index 130f39d12fb8c0bcb2f079ebab4651390a1d686f..cdf279387c2cb8d342551f84978ff08ad655b080
--- a/interfaces/kits/js/@ohos.telephony.call.d.ts
+++ b/interfaces/kits/js/@ohos.telephony.call.d.ts
@@ -1,634 +1,731 @@
/*
-* Copyright (C) 2021 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.
-*/
+ * Copyright (C) 2021-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 {AsyncCallback, Callback} from "./basic";
/**
* Provides methods related to call management.
*
- * @since 7
- * @sysCap SystemCapability.Telephony.DCall
- * @devices phone, tablet, wearable, car
+ * @since 6
+ * @syscap SystemCapability.Telephony.CallManager
*/
declare namespace call {
- /**
- * Makes a call.
- *
- * Applications must have the {@code ohos.permission.PLACE_CALL} permission to call this method.
- *
- * @param phoneNumber Indicates the called number.
- * @param options Indicates additional information carried in the call.
- * @param callback Returns {@code true} if the call request is successful; returns {@code false} otherwise.
- * Note that the value {@code true} indicates only the successful processing of the request; it does not mean
- * that the call is or can be connected.
- * @permission ohos.permission.PLACE_CALL
- * @since 6
- */
- function dial(phoneNumber: string, callback: AsyncCallback): void;
- function dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void;
- function dial(phoneNumber: string, options?: DialOptions): Promise;
-
- /**
- * Checks whether a call is ongoing.
- *
- * @param callback Returns {@code true} if at least one call is not in the {@link CallState#CALL_STATE_IDLE}
- * state; returns {@code false} otherwise.
- */
- function hasCall(callback: AsyncCallback): void;
- function hasCall(): Promise;
-
- /**
- * Obtains the call state.
- *
- * If an incoming call is ringing or waiting, the system returns {@code CallState#CALL_STATE_RINGING}.
- * If at least one call is in the active, hold, or dialing state, the system returns
- * {@code CallState#CALL_STATE_OFFHOOK}.
- * In other cases, the system returns {@code CallState#CALL_STATE_IDLE}.
- *
- * @param callback Returns the call state.
- */
- function getCallState(callback: AsyncCallback): void;
- function getCallState(): Promise;
-
- /**
- * Stops the ringtone.
- *
- * If an incoming call is ringing, the phone stops ringing. Otherwise, this method does not function.
- *
- * @permission ohos.permission.SET_TELEPHONY_STATE or System App
- * @systemapi Hide this for inner system use.
- */
- function muteRinger(callback: AsyncCallback): void;
- function muteRinger(): Promise;
-
- /**
- * Checks whether a phone number is on the emergency number list.
- *
- * @param phoneNumber Indicates the phone number to check.
- * @param callback Returns {@code true} if the phone number is on the emergency number list;
- * returns {@code false} otherwise.
- */
- function isEmergencyPhoneNumber(phoneNumber: string, callback: AsyncCallback): void;
- function isEmergencyPhoneNumber(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback): void;
- function isEmergencyPhoneNumber(phoneNumber: string, options?: EmergencyNumberOptions): Promise;
-
- /**
- * Formats a phone number according to the Chinese Telephone Code Plan. Before the formatting,
- * a phone number is in the format of country code (if any) + 3-digit service provider code
- * + 4-digit area code + 4-digit subscriber number. After the formatting,
- * each part is separated by a space.
- *
- * @param phoneNumber Indicates the phone number to format.
- * @param callback Returns the phone number after being formatted; returns an empty string
- * if the input phone number is invalid.
- */
- function formatPhoneNumber(phoneNumber: string, callback: AsyncCallback): void;
- function formatPhoneNumber(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback): void;
- function formatPhoneNumber(phoneNumber: string, options?: NumberFormatOptions): Promise;
-
- /**
- * Formats a phone number into an E.164 representation.
- *
- * @param phoneNumber Indicates the phone number to format.
- * @param countryCode Indicates a two-digit country code defined in ISO 3166-1.
- * @param callback Returns an E.164 number; returns an empty string if the input phone number is invalid.
- */
- function formatPhoneNumberToE164(phoneNumber: string, countryCode: string, callback: AsyncCallback): void;
- function formatPhoneNumberToE164(phoneNumber: string, countryCode: string): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function answer(callId: number, callback: AsyncCallback): void;
- function answer(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function hangup(callId: number, callback: AsyncCallback): void;
- function hangup(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function reject(callId: number, callback: AsyncCallback): void;
- function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void;
- function reject(callId: number, options?: RejectMessageOptions): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function holdCall(callId: number, callback: AsyncCallback): void;
- function holdCall(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function unHoldCall(callId: number, callback: AsyncCallback): void;
- function unHoldCall(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function switchCall(callId: number, callback: AsyncCallback): void;
- function switchCall(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function combineConference(callId: number, callback: AsyncCallback): void;
- function combineConference(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function getMainCallId(callId: number, callback: AsyncCallback): void;
- function getMainCallId(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function getSubCallIdList(callId: number, callback: AsyncCallback>): void;
- function getSubCallIdList(callId: number): Promise>;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function getCallIdListForConference(callId: number, callback: AsyncCallback>): void;
- function getCallIdListForConference(callId: number): Promise>;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function getCallWaitingStatus(slotId: number, callback: AsyncCallback): void;
- function getCallWaitingStatus(slotId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function setCallWaiting(slotId: number, activate: boolean, callback: AsyncCallback): void;
- function setCallWaiting(slotId: number, activate: boolean): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function startDTMF(callId: number, character: string, callback: AsyncCallback): void;
- function startDTMF(callId: number, character: string): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function stopDTMF(callId: number, callback: AsyncCallback): void;
- function stopDTMF(callId: number): Promise;
-
- /**
- * @permission ohos.permission.SET_TELEPHONY_STATE
- * @systemapi Hide this for inner system use.
- */
- function isInEmergencyCall(callback: AsyncCallback): void;
- function isInEmergencyCall(): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function on(type: 'callDetailsChange', callback: Callback): void;
- function off(type: 'callDetailsChange', callback?: Callback): void;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function on(type: 'callEventChange', callback: Callback): void;
- function off(type: 'callEventChange', callback?: Callback): void;
-
- /**
- * @systemapi Hide this for inner system use.
- * @since 8
- */
- function on(type: 'callDisconnectedCause', callback: Callback): void;
- function off(type: 'callDisconnectedCause', callback?: Callback): void;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function isNewCallAllowed(callback: AsyncCallback): void;
- function isNewCallAllowed(): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function separateConference(callId: number, callback: AsyncCallback): void;
- function separateConference(callId: number): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function getCallRestrictionStatus(slotId: number, type: CallRestrictionType, callback: AsyncCallback): void;
- function getCallRestrictionStatus(slotId: number, type: CallRestrictionType): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function setCallRestriction(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback): void;
- function setCallRestriction(slotId: number, info: CallRestrictionInfo): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function getCallTransferInfo(slotId: number, type: CallTransferType, callback: AsyncCallback): void;
- function getCallTransferInfo(slotId: number, type: CallTransferType): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function setCallTransfer(slotId: number, info: CallTransferInfo, callback: AsyncCallback): void;
- function setCallTransfer(slotId: number, info: CallTransferInfo): Promise;
-
- /**
- * @permission ohos.permission.SET_TELEPHONY_STATE
- * @systemapi Hide this for inner system use.
- */
- function isRinging(callback: AsyncCallback): void;
- function isRinging(): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function setMuted(callback: AsyncCallback): void;
- function setMuted(): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- * @since 8
- */
- function cancelMuted(callback: AsyncCallback): void;
- function cancelMuted(): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- */
- function setAudioDevice(device: AudioDevice, callback: AsyncCallback): void;
- function setAudioDevice(device: AudioDevice): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- * @since 8
- */
- function joinConference(mainCallId: number, callNumberList: Array, callback: AsyncCallback): void;
- function joinConference(mainCallId: number, callNumberList: Array): Promise;
-
- /**
- * @systemapi Hide this for inner system use.
- * @since 8
- */
- function UpdateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback): void;
- function UpdateImsCallMode(callId: number, mode: ImsCallMode): Promise;
-
+ /**
+ * Makes a call.
+ *
+ * Applications must have the {@code ohos.permission.PLACE_CALL} permission to call this method.
+ *
+ * @param phoneNumber Indicates the called number.
+ * @param options Indicates additional information carried in the call.
+ * @param callback Returns {@code true} if the call request is successful; returns {@code false} otherwise.
+ * Note that the value {@code true} indicates only the successful processing of the request; it does not mean
+ * that the call is or can be connected.
+ * @permission ohos.permission.PLACE_CALL
+ */
+ function dial(phoneNumber: string, callback: AsyncCallback): void;
+ function dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void;
+ function dial(phoneNumber: string, options?: DialOptions): Promise;
+
+ /**
+ * Go to the dial screen and the called number is displayed.
+ *
+ * @param phoneNumber Indicates the called number.
+ * @syscap SystemCapability.Applications.Contacts
+ * @since 7
+ */
+ function makeCall(phoneNumber: string, callback: AsyncCallback): void;
+ function makeCall(phoneNumber: string): Promise;
+
+ /**
+ * Checks whether a call is ongoing.
+ *
+ * @param callback Returns {@code true} if at least one call is not in the {@link CallState#CALL_STATE_IDLE}
+ * state; returns {@code false} otherwise.
+ */
+ function hasCall(callback: AsyncCallback): void;
+ function hasCall(): Promise;
+
+ /**
+ * Obtains the call state.
+ *
+ * If an incoming call is ringing or waiting, the system returns {@code CallState#CALL_STATE_RINGING}.
+ * If at least one call is in the active, hold, or dialing state, the system returns
+ * {@code CallState#CALL_STATE_OFFHOOK}.
+ * In other cases, the system returns {@code CallState#CALL_STATE_IDLE}.
+ *
+ * @param callback Returns the call state.
+ */
+ function getCallState(callback: AsyncCallback): void;
+ function getCallState(): Promise;
+
+ /**
+ * Stops the ringtone.
+ *
+ * If an incoming call is ringing, the phone stops ringing. Otherwise, this method does not function.
+ *
+ * @permission ohos.permission.SET_TELEPHONY_STATE or System App
+ * @systemapi Hide this for inner system use.
+ * @since 8
+ */
+ function muteRinger(callback: AsyncCallback): void;
+ function muteRinger(): Promise;
+
+ /**
+ * Checks whether a device supports voice calls.
+ *
+ * The system checks whether the device has the capability to initiate a circuit switching (CS) or IP multimedia
+ * subsystem domain (IMS) call on a telephone service network. If the device supports only packet switching
+ * (even if the device supports OTT calls), {@code false} is returned.
+ *
+ * @return Returns {@code true} if the device supports voice calls; returns {@code false} otherwise.
+ * @since 7
+ */
+ function hasVoiceCapability(): boolean;
+
+ /**
+ * Checks whether a phone number is on the emergency number list.
+ *
+ * @param phoneNumber Indicates the phone number to check.
+ * @param callback Returns {@code true} if the phone number is on the emergency number list;
+ * returns {@code false} otherwise.
+ * @since 7
+ */
+ function isEmergencyPhoneNumber(phoneNumber: string, callback: AsyncCallback): void;
+ function isEmergencyPhoneNumber(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback): void;
+ function isEmergencyPhoneNumber(phoneNumber: string, options?: EmergencyNumberOptions): Promise;
+
+ /**
+ * Formats a phone number according to the Chinese Telephone Code Plan. Before the formatting,
+ * a phone number is in the format of country code (if any) + 3-digit service provider code
+ * + 4-digit area code + 4-digit subscriber number. After the formatting,
+ * each part is separated by a space.
+ *
+ * @param phoneNumber Indicates the phone number to format.
+ * @param callback Returns the phone number after being formatted; returns an empty string
+ * if the input phone number is invalid.
+ * @since 7
+ */
+ function formatPhoneNumber(phoneNumber: string, callback: AsyncCallback