openharmony 鸿蒙 js-apis-radio-sys

2025-06-12 浏览 (1)

@ohos.telephony.radio (Radio) (System API)

The radio module provides basic network search management functions. You can obtain the radio access technology (RAT) used in the CS and PS domains, network status, current network selection mode, ISO country code of the registered network, ID of the slot in which the primary card is located, list of signal strengths of the registered network, carrier name, and IMEI, MEID, and unique device ID of the SIM card in the specified slot. Besides, you can check whether the current device supports 5G(NR) and whether the radio service is enabled on the primary SIM card.

NOTE

The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. This topic describes only system APIs provided by the module. For details about its public APIs, see @ohos.telephony.radio (Radio).

Modules to Import

import { radio } from '@kit.TelephonyKit';

radio.setPrimarySlotId8+

setPrimarySlotId(slotId: number, callback: AsyncCallback<void>): void

Sets the ID of the slot in which the primary card is located. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300004No SIM card found.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.setPrimarySlotId(slotId, (err: BusinessError) => {
    if (err) {
        console.error(`setPrimarySlotId failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`setPrimarySlotId success.`);
});

radio.setPrimarySlotId8+

setPrimarySlotId(slotId: number): Promise<void>

Sets the ID of the slot in which the primary card is located. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300004No SIM card found.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.setPrimarySlotId(slotId).then(() => {
    console.log(`setPrimarySlotId success.`);
}).catch((err: BusinessError) => {
    console.error(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
});

radio.getIMEI8+

getIMEI(callback: AsyncCallback<string>): void

Obtains the IMEI of the primary SIM card of the device. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<string>YesCallback used to return the result. If the IMEI does not exist, an empty string is returned.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getIMEI((err: BusinessError, data: string) => {
    if (err) {
        console.error(`getIMEI failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getIMEI success, callback: data->${JSON.stringify(data)}`);
});

radio.getIMEI8+

getIMEI(slotId: number, callback: AsyncCallback<string>): void

Obtains the IMEI of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<string>YesCallback used to return the result. If the IMEI does not exist, an empty string is returned.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getIMEI(slotId, (err: BusinessError, data: string) => {
    if (err) {
        console.error(`getIMEI failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getIMEI success, callback: data->${JSON.stringify(data)}`);
});

radio.getIMEI8+

getIMEI(slotId?: number): Promise<string>

Obtains the IMEI of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<string>Promise used to return the result. If the IMEI does not exist, an empty string is returned.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getIMEI(slotId).then((data: string) => {
    console.log(`getIMEI success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`);
});

radio.getMEID8+

getMEID(callback: AsyncCallback<string>): void

Obtains the MEID of the SIM card. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<string>YesCallback used to return the result. If the MEID does not exist, an empty string is returned.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getMEID((err: BusinessError, data: string) => {
    if (err) {
        console.error(`getMEID failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getMEID success, callback: data->${JSON.stringify(data)}`);
});

radio.getMEID8+

getMEID(slotId: number, callback: AsyncCallback<string>): void

Obtains the MEID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<string>YesCallback used to return the result. If the MEID does not exist, an empty string is returned.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getMEID(slotId, (err: BusinessError, data: string) => {
    if (err) {
        console.error(`getMEID failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getMEID success, callback: data->${JSON.stringify(data)}`);
});

radio.getMEID8+

getMEID(slotId?: number): Promise<string>

Obtains the MEID of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<string>Promise used to return the result. If the MEID does not exist, an empty string is returned.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getMEID(slotId).then((data: string) => {
    console.log(`getMEID success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`);
});

radio.getUniqueDeviceId8+

getUniqueDeviceId(callback: AsyncCallback<string>): void

Obtains the unique device ID of the primary SIM card of the device. This API uses an asynchronous callback to return the result.

If the device registers with a 3GPP network, an IMEI is returned. If the device registers with a 3GPP2 network, an MEID is returned.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<string>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getUniqueDeviceId((err: BusinessError, data: string) => {
    if (err) {
        console.error(`getUniqueDeviceId failed, callback: err->${JSON.stringify(err)}}`);
        return;
    }
    console.log(`getUniqueDeviceId success, callback: data->${JSON.stringify(data)}`);
});

radio.getUniqueDeviceId8+

getUniqueDeviceId(slotId: number, callback: AsyncCallback<string>): void

Obtains the unique device ID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

If the device registers with a 3GPP network, an IMEI is returned. If the device registers with a 3GPP2 network, an MEID is returned.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<string>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getUniqueDeviceId(slotId, (err: BusinessError, data: string) => {
    if (err) {
        console.error(`getUniqueDeviceId failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getUniqueDeviceId success, callback: data->${JSON.stringify(data)}`);
});

radio.getUniqueDeviceId8+

getUniqueDeviceId(slotId?: number): Promise<string>

Obtains the unique device ID of the SIM card in the specified slot. This API uses a promise to return the result.

If the device registers with a 3GPP network, an IMEI is returned. If the device registers with a 3GPP2 network, an MEID is returned.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<string>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getUniqueDeviceId(slotId).then((data: string) => {
    console.log(`getUniqueDeviceId success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`);
});

radio.sendUpdateCellLocationRequest8+

sendUpdateCellLocationRequest(callback: AsyncCallback<void>): void

Sends a cell location update request. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permissions: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.sendUpdateCellLocationRequest((err: BusinessError) => {
    if (err) {
        console.error(`sendUpdateCellLocationRequest failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`sendUpdateCellLocationRequest success.`);
});

radio.sendUpdateCellLocationRequest8+

sendUpdateCellLocationRequest(slotId: number, callback: AsyncCallback<void>): void

Sends a cell location update request for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permissions: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.sendUpdateCellLocationRequest(slotId, (err: BusinessError) => {
    if (err) {
        console.error(`sendUpdateCellLocationRequest failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`sendUpdateCellLocationRequest success.`);
});

radio.sendUpdateCellLocationRequest8+

sendUpdateCellLocationRequest(slotId?: number): Promise<void>

Sends a cell location update request for the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permissions: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.sendUpdateCellLocationRequest(slotId).then(() => {
    console.log(`sendUpdateCellLocationRequest success.`);
}).catch((err: BusinessError) => {
    console.error(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
});

radio.getCellInformation8+

getCellInformation(callback: AsyncCallback<Array<CellInformation>>): void

Obtains cell information. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permissions: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<Array<CellInformation>>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getCellInformation((err: BusinessError, data: Array<radio.CellInformation>) => {
    if (err) {
        console.error(`getCellInformation failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getCellInformation success, callback: data->${JSON.stringify(data)}`);
});

radio.getCellInformation8+

getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation>>): void

Obtains cell information of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permissions: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<Array<CellInformation>>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getCellInformation(slotId, (err: BusinessError, data: Array<radio.CellInformation>) => {
    if (err) {
        console.error(`getCellInformation failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getCellInformation success, callback: data->${JSON.stringify(data)}`);
});

radio.getCellInformation8+

getCellInformation(slotId?: number): Promise<Array<CellInformation>>

Obtains cell information of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permissions: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<Array<CellInformation>>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getCellInformation(slotId).then((data: Array<radio.CellInformation>) => {
    console.log(`getCellInformation success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`);
});

radio.setNetworkSelectionMode

setNetworkSelectionMode(options: NetworkSelectionModeOptions, callback: AsyncCallback<void>): void

Sets the network selection mode. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
optionsNetworkSelectionModeOptionsYesNetwork selection mode.
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let networkInformation: radio.NetworkInformation = {
    operatorName: "China Mobile",
    operatorNumeric: "898600",
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
    radioTech: "CS"
}
let networkSelectionModeOptions: radio.NetworkSelectionModeOptions = {
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
    networkInformation: networkInformation,
    resumeSelection: true
}
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err: BusinessError) => {
    if (err) {
        console.error(`setNetworkSelectionMode failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`setNetworkSelectionMode success.`);
});

radio.setNetworkSelectionMode

setNetworkSelectionMode(options: NetworkSelectionModeOptions): Promise<void>

Sets the network selection mode. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
optionsNetworkSelectionModeOptionsYesNetwork selection mode.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let networkInformation: radio.NetworkInformation = {
    operatorName: "China Mobile",
    operatorNumeric: "898600",
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
    radioTech: "CS"
}
let networkSelectionModeOptions: radio.NetworkSelectionModeOptions = {
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
    networkInformation: networkInformation,
    resumeSelection: true
}
radio.setNetworkSelectionMode(networkSelectionModeOptions).then(() => {
    console.log(`setNetworkSelectionMode success.`);
}).catch((err: BusinessError) => {
    console.error(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
});

radio.getNetworkSearchInformation

getNetworkSearchInformation(slotId: number, callback: AsyncCallback<NetworkSearchResult>): void

Obtains network search information of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<NetworkSearchResult>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getNetworkSearchInformation(0, (err: BusinessError, data: radio.NetworkSearchResult) => {
    if (err) {
        console.error(`getNetworkSearchInformation failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getNetworkSearchInformation success, callback: data->${JSON.stringify(data)}`);
});

radio.getNetworkSearchInformation

getNetworkSearchInformation(slotId: number): Promise<NetworkSearchResult>

Obtains network search information of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<NetworkSearchResult>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getNetworkSearchInformation(0).then((data: radio.NetworkSearchResult) => {
    console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`);
});

radio.getNrOptionMode(deprecated)

getNrOptionMode(callback: AsyncCallback<NrOptionMode>): void

Obtains the NR option mode of the SIM card. This API uses an asynchronous callback to return the result.

NOTE

This API is supported since API version 8 and deprecated since API version 10. You are advised to use getNROptionMode.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<NrOptionMode>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.getNrOptionMode((err: BusinessError, data: radio.NrOptionMode) => {
    if (err) {
        console.error(`getNrOptionMode failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getNrOptionMode success, callback: data->${JSON.stringify(data)}`);
});

radio.getNrOptionMode(deprecated)

getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode>): void

Obtains the NR option mode of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

NOTE

This API is supported since API version 8 and deprecated since API version 10. You are advised to use getNROptionMode.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<NrOptionMode>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getNrOptionMode(slotId, (err: BusinessError, data: radio.NrOptionMode) => {
    if (err) {
        console.error(`getNrOptionModecallback failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getNrOptionModecallback success, callback: data->${JSON.stringify(data)}`);
});

radio.getNrOptionMode(deprecated)

getNrOptionMode(slotId?: number): Promise<NrOptionMode>

Obtains the NR option mode of the SIM card in the specified slot. This API uses a promise to return the result.

NOTE

This API is supported since API version 8 and deprecated since API version 10. You are advised to use getNROptionMode.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<NrOptionMode>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getNrOptionMode(slotId).then((data: radio.NrOptionMode) => {
    console.log(`getNrOptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`);
});

radio.turnOnRadio7+

turnOnRadio(callback: AsyncCallback<void>): void

Turns on the radio function. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.turnOnRadio((err: BusinessError) => {
    if (err) {
        console.error(`turnOnRadio failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`turnOnRadio success.`);
});

radio.turnOnRadio7+

turnOnRadio(slotId: number, callback: AsyncCallback<void>): void

Enables the radio service for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.turnOnRadio(slotId, (err: BusinessError) => {
    if (err) {
        console.error(`turnOnRadio failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`turnOnRadio success.`);
});

radio.turnOnRadio7+

turnOnRadio(slotId?: number): Promise<void>

Turns on the radio function for the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.turnOnRadio(slotId).then(() => {
    console.log(`turnOnRadio success.`);
}).catch((err: BusinessError) => {
    console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
});

radio.turnOffRadio7+

turnOffRadio(callback: AsyncCallback<void>): void

Turns off the radio function. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

radio.turnOffRadio((err: BusinessError) => {
    if (err) {
        console.error(`turnOffRadio failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`turnOffRadio success.`);
});

radio.turnOffRadio7+

turnOffRadio(slotId: number, callback: AsyncCallback<void>): void

Disables the radio service for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.turnOffRadio(slotId, (err: BusinessError) => {
    if (err) {
        console.error(`turnOffRadio failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`turnOffRadio success.`);
});

radio.turnOffRadio7+

turnOffRadio(slotId?: number): Promise<void>

Turns off the radio function for the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.turnOffRadio(slotId).then(() => {
    console.log(`turnOffRadio success.`);
}).catch((err: BusinessError) => {
    console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
});

radio.setPreferredNetwork8+

setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void>): void

Sets the preferred network of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
networkModePreferredNetworkModeYesPreferred network mode.
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let mode: radio.PreferredNetworkMode = radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM;
radio.setPreferredNetwork(slotId, mode, (err: BusinessError) => {
    if (err) {
        console.error(`setPreferredNetwork failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`setPreferredNetwork success.`);
});

radio.setPreferredNetwork8+

setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void>

Sets the preferred network of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
networkModePreferredNetworkModeYesPreferred network mode.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let mode: radio.PreferredNetworkMode = radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM;
radio.setPreferredNetwork(slotId, mode).then(() => {
    console.log(`setPreferredNetwork success.`);
}).catch((err: BusinessError) => {
    console.error(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
});

radio.getPreferredNetwork8+

getPreferredNetwork(slotId: number, callback: AsyncCallback<PreferredNetworkMode>): void

Obtains the preferred network of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<PreferredNetworkMode>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getPreferredNetwork(slotId, (err: BusinessError, data: radio.PreferredNetworkMode) => {
    if (err) {
        console.error(`getPreferredNetwork failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getPreferredNetwork success, callback: data->${JSON.stringify(data)}`);
});

radio.getPreferredNetwork8+

getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode>

Obtains the preferred network of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<PreferredNetworkMode>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getPreferredNetwork(slotId).then((data: radio.PreferredNetworkMode) => {
    console.log(`getPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
});

radio.getImsRegInfo9+

getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo>): void

Obtains the IMS registration status of the specified IMS service type for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
imsTypeImsServiceTypeYesIMS service type.
callbackAsyncCallback<ImsRegInfo>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: Mandatory parameters are left unspecified.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO;
radio.getImsRegInfo(slotId, mode, (err: BusinessError, data: radio.ImsRegInfo) => {
    if (err) {
        console.error(`getImsRegInfo failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getImsRegInfo success, callback: data->${JSON.stringify(data)}`);
});

radio.getImsRegInfo9+

getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo>

Obtains the IMS registration status of the specified IMS service type for the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
imsTypeImsServiceTypeYesIMS service type.

Return value

TypeDescription
Promise<ImsRegInfo>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: Mandatory parameters are left unspecified.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO;
radio.getImsRegInfo(slotId, mode).then((data: radio.ImsRegInfo) => {
    console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`);
});

radio.on('imsRegStateChange')9+

on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback<ImsRegInfo>): void

Enables listening for imsRegStateChange events of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
typestringYesIMS registration status change. This field has a fixed value of imsRegStateChange.
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
imsTypeImsServiceTypeYesIMS service type.
callbackCallback<ImsRegInfo>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: Mandatory parameters are left unspecified.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

let slotId: number = 0;
let mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO;
radio.on('imsRegStateChange', slotId, mode, (data: radio.ImsRegInfo) => {
    console.log(`on imsRegStateChange success, callback: data->${JSON.stringify(data)}`);
});

radio.off('imsRegStateChange')9+

off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback<ImsRegInfo>): void

Disables listening for imsRegStateChange events of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
typestringYesIMS registration status change. This field has a fixed value of imsRegStateChange.
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
imsTypeImsServiceTypeYesIMS service type.
callbackCallback<ImsRegInfo>NoCallback used to return the result. If it is left unspecified, it indicates the callback for all the events will be unsubscribed. The value must be the same as the value of callback in on('imsRegStateChange').

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: Mandatory parameters are left unspecified.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

let slotId: number = 0;
let mode: radio.ImsServiceType = radio.ImsServiceType.TYPE_VIDEO;
radio.off('imsRegStateChange', slotId, mode, (data: radio.ImsRegInfo) => {
    console.log(`off imsRegStateChange success, callback: data->${JSON.stringify(data)}`);
});

radio.getBasebandVersion10+

getBasebandVersion(slotId: number, callback: AsyncCallback<string>): void

Obtains the device baseband version of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<string>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getBasebandVersion(slotId, (err: BusinessError, data: string) => {
    if (err) {
        console.error(`getBasebandVersion failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getBasebandVersion success, callback: data->${JSON.stringify(data)}`);
});

radio.getBasebandVersion10+

getBasebandVersion(slotId: number): Promise<string>

Obtains the device baseband version of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<string>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getBasebandVersion(slotId).then((data: string) => {
    console.log(`getBasebandVersion success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getBasebandVersion failed, promise: err->${JSON.stringify(err)}`);
});

radio.setNROptionMode10+

setNROptionMode(slotId: number, mode: NROptionMode, callback: AsyncCallback<void>): void

Sets the NR mode of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
modeNROptionModeYesEnumerates NR selection modes.
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let mode: radio.NROptionMode = radio.NROptionMode.NR_OPTION_NSA_ONLY;
radio.setNROptionMode(slotId, mode, (err: BusinessError) => {
    if (err) {
        console.error(`setNROptionMode failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`setNROptionMode success.`);
});

radio.setNROptionMode10+

setNROptionMode(slotId: number, mode: NROptionMode): Promise<void>

Sets the NR mode of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
modeNROptionModeYesNR mode.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let mode: radio.NROptionMode = radio.NROptionMode.NR_OPTION_NSA_ONLY;
radio.setNROptionMode(slotId, mode).then(() => {
    console.log(`setNROptionMode success`);
}).catch((err: BusinessError) => {
    console.error(`setNROptionMode failed, promise: err->${JSON.stringify(err)}`);
});

radio.getNROptionMode10+

getNROptionMode(slotId: number, callback: AsyncCallback<NROptionMode>): void

Obtains the NR option mode of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
callbackAsyncCallback<NROptionMode>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getNROptionMode(slotId, (err: BusinessError, data: radio.NROptionMode) => {
    if (err) {
        console.error(`getNROptionMode failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getNROptionMode success, callback: data->${JSON.stringify(data)}`);
});

radio.getNROptionMode10+

getNROptionMode(slotId: number): Promise<NROptionMode>

Obtains the NR option mode of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<NROptionMode>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.getNROptionMode(slotId).then((data: radio.NROptionMode) => {
    console.log(`getNROptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getNROptionMode failed, promise: err->${JSON.stringify(err)}`);
});

radio.getNetworkCapability10+

getNetworkCapability(slotId: number, type: NetworkCapabilityType, callback: AsyncCallback<NetworkCapabilityState>): void

Obtains the network capability of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
typeNetworkCapabilityTypeYesNetwork capability type.
callbackAsyncCallback<NetworkCapabilityState>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
radio.getNetworkCapability(slotId, type, (err: BusinessError, data: radio.NetworkCapabilityState) => {
    if (err) {
        console.error(`getNetworkCapability failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`getNetworkCapability success, callback: err->${JSON.stringify(err)}`);
});

radio.getNetworkCapability10+

getNetworkCapability(slotId: number, type: NetworkCapabilityType): Promise<NetworkCapabilityState>

Obtains the network capability of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
typeNetworkCapabilityTypeYesNetwork capability type.

Return value

TypeDescription
Promise<NetworkCapabilityState>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
radio.getNetworkCapability(slotId, type).then((data: radio.NetworkCapabilityState) => {
    console.log(`getNetworkCapability success, promise: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getNetworkCapability failed, promise: err->${JSON.stringify(err)}`);
});

radio.setNetworkCapability10+

setNetworkCapability(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState, callback: AsyncCallback<void>): void

Sets the network capability of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
typeNetworkCapabilityTypeYesNetwork capability type.
stateNetworkCapabilityStateYesNetwork capability status.
callbackAsyncCallback<void>YesCallback used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
let state: radio.NetworkCapabilityState = radio.NetworkCapabilityState.SERVICE_CAPABILITY_ON;
radio.setNetworkCapability(slotId, type, state, (err: BusinessError) => {
    if (err) {
        console.error(`setNetworkCapability failed, callback: err->${JSON.stringify(err)}`);
        return;
    }
    console.log(`setNetworkCapability success.`);
});

radio.setNetworkCapability10+

setNetworkCapability(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState): Promise<void>

Sets the network capability of the SIM card in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
typeNetworkCapabilityTypeYesNetwork capability type.
stateNetworkCapabilityStateYesNetwork capability status.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
let type: radio.NetworkCapabilityType = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
let state: radio.NetworkCapabilityState = radio.NetworkCapabilityState.SERVICE_CAPABILITY_ON;
radio.setNetworkCapability(slotId, type, state).then(() => {
    console.log(`setNetworkCapability success`);
}).catch((err: BusinessError) => {
    console.error(`setNetworkCapability failed, promise: err->${JSON.stringify(err)}`);
});

radio.factoryReset11+

factoryReset(slotId: number): Promise<void>

Restores the radio service to factory settings. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2

Return value

TypeDescription
Promise<void>Promise used to return the result.

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

import { BusinessError } from '@kit.BasicServicesKit';

let slotId: number = 0;
radio.factoryReset(slotId).then(() => {
    console.log(`factoryReset success`);
}).catch((err: BusinessError) => {
    console.error(`factoryReset failed, promise: err->${JSON.stringify(err)}`);
});

radio.getIMEISV12+

getIMEISV(slotId: number): string

Obtains the software version of the SIM card in the specified slot.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_STATE

System capability: SystemCapability.Telephony.CoreService

Parameters

NameTypeMandatoryDescription
slotIdnumberNoCard slot ID.
- 0: card slot 1
- 1: card slot 2

Error codes

For details about the error codes, seeohos.telephony (Telephony) Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
8300001Invalid parameter value.
8300002Service connection failed.
8300003System internal error.
8300999Unknown error.

Example

let slotId: number = 0;
let data: string = radio.getIMEISV(slotId);
console.log(`IMEISV is:` + data);

PreferredNetworkMode8+

Enumerates preferred network modes.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
PREFERRED_NETWORK_MODE_GSM1GSM network mode.
PREFERRED_NETWORK_MODE_WCDMA2WCDMA network mode.
PREFERRED_NETWORK_MODE_LTE3LTE network mode.
PREFERRED_NETWORK_MODE_LTE_WCDMA4LTE+WCDMA network mode.
PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM5LTE+WCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_WCDMA_GSM6WCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_CDMA7CDMA network mode.
PREFERRED_NETWORK_MODE_EVDO8EVDO network mode.
PREFERRED_NETWORK_MODE_EVDO_CDMA9EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA10WCDMA+GSM+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA11LTE+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA12LTE+WCDMA+GSM+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_TDSCDMA13TD-SCDMA network mode.
PREFERRED_NETWORK_MODE_TDSCDMA_GSM14TD-SCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA15TD-SCDMA+WCDMA network mode.
PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM16TD-SCDMA+WCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_LTE_TDSCDMA17LTE+TD-SCDMA network mode.
PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM18LTE+TD-SCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA19LTE+TD-SCDMA+WCDMA network mode.
PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM20LTE+TD-SCDMA+WCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA21TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA22LTE+TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_NR31NR network mode.
PREFERRED_NETWORK_MODE_NR_LTE32NR+LTE network mode.
PREFERRED_NETWORK_MODE_NR_LTE_WCDMA33NR+LTE+WCDMA network mode.
PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM34NR+LTE+WCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA35NR+LTE+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA36NR+LTE+WCDMA+GSM+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA37NR+LTE+TD-SCDMA network mode.
PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM38NR+LTE+TD-SCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA39NR+LTE+TD-SCDMA+WCDMA network mode.
PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM40NR+LTE+TD-SCDMA+WCDMA+GSM network mode.
PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA41NR+LTE+TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.
PREFERRED_NETWORK_MODE_MAX_VALUE99Maximum value of the preferred network mode.

CellInformation8+

Defines the cell information.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
isCampedbooleanYesCell status.
System API: This is a system API.
The value true indicates a camped cell, and the value false indicates a non-camped cell.
timeStampnumberYesTimestamp when cell information is obtained.
System API: This is a system API.
dataCdmaCellInformation |GsmCellInformation |LteCellInformation |NrCellInformation |TdscdmaCellInformation|WcdmaCellInformationYesCDMA cell information|GSM cell information|LTE cell information|NR cell information|TD-SCDMA cell information|WCDMA.
System API: This is a system API.

CdmaCellInformation8+

Defines the CDMA cell information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
baseIdnumberYesBase station ID.
latitudenumberYesLatitude.
longitudenumberYesLongitude.
nidnumberYesNetwork ID.
sidnumberYesSystem ID.

GsmCellInformation8+

Defines the GSM cell information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
lacnumberYesLocation area code.
cellIdnumberYesCell ID.
arfcnnumberYesAbsolute radio frequency channel number.
bsicnumberYesBase station ID.
mccstringYesMobile country code.
mncstringYesMobile network code.

LteCellInformation8+

LTE cell information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
cginumberYesCell global identification.
pcinumberYesPhysical cell ID.
tacnumberYesTracking area code.
earfcnnumberYesAbsolute radio frequency channel number.
bandwidthnumberYesBandwidth.
mccstringYesMobile country code.
mncstringYesMobile network code.
isSupportEndcbooleanYesWhether New Radio Dual Connectivity (NR-DC) is supported.
The value true indicates that NR-DC is supported, and the value false indicates the opposite.

NrCellInformation8+

Defines the 5G NR cell information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
nrArfcnnumberYes5G frequency number.
pcinumberYesPhysical cell ID.
tacnumberYesTracking area code.
ncinumberYes5G network cell ID.
mccstringYesMobile country code.
mncstringYesMobile network code.

TdscdmaCellInformation8+

Defines the TD-SCDMA cell information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
lacnumberYesLocation area code.
cellIdnumberYesCell ID.
cpidnumberYesCell parameter ID.
uarfcnnumberYesAbsolute radio frequency number.
mccstringYesMobile country code.
mncstringYesMobile network code.

WcdmaCellInformation8+

Defines the WCDMA cell information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
lacnumberYesLocation area code.
cellIdnumberYesCell ID.
pscnumberYesPrimary scrambling code.
uarfcnnumberYesAbsolute radio frequency number.
mccstringYesMobile country code.
mncstringYesMobile network code.

NrOptionMode(deprecated)

Enumerates NR selection modes.

NOTE

This API is supported since API version 8 and deprecated since API version 10. You are advised to use NROptionMode.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
NR_OPTION_UNKNOWN0Unknown NR selection mode.
NR_OPTION_NSA_ONLY1NR selection mode in 5G non-standalone networking.
NR_OPTION_SA_ONLY2NR selection mode in 5G non-standalone networking.
NR_OPTION_NSA_AND_SA3NR selection mode in non-standalone and standalone networking.

NROptionMode10+

Enumerates NR selection modes.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
NR_OPTION_UNKNOWN0Unknown NR selection mode.
NR_OPTION_NSA_ONLY1NR selection mode in 5G non-standalone networking.
NR_OPTION_SA_ONLY2NR selection mode in 5G non-standalone networking.
NR_OPTION_NSA_AND_SA3NR selection mode in non-standalone and standalone networking.

NetworkSearchResult

Defines the network search result.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
isNetworkSearchSuccessbooleanYesWhether the network search is successful.
The value true indicates that the network search is successful, and the value false indicates the opposite.
networkSearchResultArray<NetworkInformation>YesNetwork search result.

NetworkInformation

Defines the network information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
operatorNamestringYesCarrier name.
operatorNumericstringYesCarrier number.
stateNetworkInformationStateYesNetwork information status.
radioTechstringYesRadio access technology.

NetworkInformationState

Enumerates network information states.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
NETWORK_UNKNOWN0Unknown state.
NETWORK_AVAILABLE1Available for registration.
NETWORK_CURRENT2Registered state.
NETWORK_FORBIDDEN3Unavailable for registration.

NetworkSelectionModeOptions

Defines the network selection mode.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1
- 1: card slot 2
selectModeNetworkSelectionModeYesNetwork selection mode.
networkInformationNetworkInformationYesNetwork information.
resumeSelectionbooleanYesWhether to resume selection.
The value true means to resume selection, and the value false means the opposite.

ImsRegState9+

Enumerates IMS registration states.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
IMS_UNREGISTERED0Not registered.
IMS_REGISTERED1Registered.

ImsRegTech9+

Enumerates IMS registration technologies.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
REGISTRATION_TECH_NONE0None.
REGISTRATION_TECH_LTE1LTE.
REGISTRATION_TECH_IWLAN2I-WLAN.
REGISTRATION_TECH_NR3NR.

ImsRegInfo9+

Defines the IMS registration information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameTypeMandatoryDescription
imsRegStateImsRegStateYesIMS registration state.
imsRegTechImsRegTechYesIMS registration technology.

ImsServiceType9+

Enumerates IMS service types.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
TYPE_VOICE0Voice service.
TYPE_VIDEO1Video service.
TYPE_UT2UT service.
TYPE_SMS3SMS service.

NetworkCapabilityType10+

Enumerates network capability types.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
SERVICE_TYPE_LTE0LTE service.
SERVICE_TYPE_NR1NR service.

NetworkCapabilityState10+

Defines the network capability switch status.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService

NameValueDescription
SERVICE_CAPABILITY_OFF0The network capability is disabled.
SERVICE_CAPABILITY_ON1The network capability is enabled.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Telephony Kit

harmony 鸿蒙Telephony_NetworkState

harmony 鸿蒙Telephony Error Codes

harmony 鸿蒙js-apis-call-sys

harmony 鸿蒙@ohos.telephony.call (Call)

harmony 鸿蒙@ohos.telephony.esim (eSIM Management) (System API)

harmony 鸿蒙@ohos.telephony.esim (eSIM Management)

harmony 鸿蒙@ohos.telephony.observer (Observer) (System API)

harmony 鸿蒙@ohos.telephony.observer (Observer)

harmony 鸿蒙@ohos.telephony.radio (Network Search)

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/2zWLfK