This kit provides APIs related to network quality assessment and network handover.
The network quality module provides capabilities including real-time network quality assessment, network scenario identification, and weak signal prediction. These capabilities enable your app to dynamically adjust cache, bit rate, frame rate, resolution, and other policies, ensuring a seamless experience even in challenging network environments. Your app can also call the transmission quality feedback API to report the network quality, so as to trigger network acceleration.
The network handover module provides network handover capabilities. When the network signal is weak and the device initiates a network handover (such as between Wi-Fi and cellular or between primary and secondary SIM cards), the device will notify your app upon the start and end of the handover. Then your app can re-establish the link accordingly and swiftly restore services, providing users with a smooth, fast, and low-latency network experience.
Multi-network concurrency refers to the system capability to establish multiple network paths through provided APIs. When an app initiates a multi-network concurrency request, the device determines the concurrency strategy based on the service scenario, applies corresponding concurrency controls, and evaluates the performance benefits accordingly. The principles for using multi-network concurrency are: app-initiated requests (with restricted permissions), system-level governance, and minimal usage.
Since: 5.1.0(18)
| File | Description |
|---|---|
| network_boost_handover.h | Declares APIs for network handover, and defines basic functions, structs, and constants. |
| network_boost_quality.h | Declares APIs for network quality assessment, and defines basic functions, structs, and constants. |
| network_boost.h | Declares APIs for network acceleration, and defines basic functions, structs, and constants. |
| Struct | Description |
|---|---|
| struct NetworkBoost_DataSpeedAction | Defines the recommended packet transmission rate. |
| struct NetworkBoost_NetHandle | Defines the network handle information. |
| struct NetworkBoost_HandoverStart | Defines the information about the start of network handover. |
| struct NetworkBoost_HandoverComplete | Defines the information about the end of network handover. |
| struct HMS_NetworkBoost_HandoverCallback | Defines the network handover information that is returned. |
| struct NetworkBoost_NetworkQos | Defines the network quality information of a single path that is returned. |
| struct NetworkBoost_NetworkQosArray | Defines the network quality information of multiple paths that is returned. |
| struct NetworkBoost_WeakSignalPrediction | Defines weak signal prediction information. |
| struct NetworkBoost_NetworkScene | Defines the network scenario change information that is returned. |
| struct NetworkBoost_MultiPathQuotaInfo | Defines multi-network concurrency quota information. |
| struct NetworkBoost_MultiPathQuota | Defines the quota usage information for multi-network concurrency. |
| struct NetworkBoost_MultiPathRequestResult | Defines the multi-network concurrency request result. |
| struct NetworkBoost_MultiPathStateChange | Defines multi-network concurrency status information. |
| struct NetworkBoost_MultiPathRecommendation | Defines multi-network concurrency suggestion information. |
| struct NetworkBoost_SceneDesc | Defines the description information of a service scenario. |
| Macro | Description |
|---|---|
| NETBOOST_MAX_PATH_NUM 4 | Maximum number of paths for which network quality change information can be returned. |
| NB_BPS 1 | 1 bit/s. |
| NB_KBPS 1000 | 1 kbit/s. |
| NB_MBPS 1000000 | 1 Mbit/s. |
| NB_GBPS 1000000000 | 1 Gbit/s. |
| NB_TBPS 1000000000000 | 1 Tbit/s. To handle this, utilize the uint64_t data type to prevent overflow. |
| Type | Description |
|---|---|
| typedef enum NetworkBoost_DataSpeedSimpleAction NetworkBoost_DataSpeedSimpleAction | Defines the enumeration of suggested packet transmission policies. |
| typedef enum NetworkBoost_ErrorResult NetworkBoost_ErrorResult | Defines the enumeration of network handover results. |
| typedef enum NetworkBoost_ReEstAction NetworkBoost_ReEstAction | Defines the enumeration of link re-establishment types. |
| typedef struct NetworkBoost_DataSpeedAction NetworkBoost_DataSpeedAction | Defines the recommended packet transmission rate. |
| typedef struct NetworkBoost_NetHandle NetworkBoost_NetHandle | Defines the network handle information. |
| typedef struct NetworkBoost_HandoverStart NetworkBoost_HandoverStart | Defines the information about the start of network handover. |
| typedef struct NetworkBoost_HandoverComplete NetworkBoost_HandoverComplete | Defines the information about the end of network handover. |
| typedef enum NetworkBoost_HandoverMode NetworkBoost_HandoverMode | Defines the enumeration of network handover modes. |
| typedef void(* HMS_NetworkBoost_OnHandoverStart) (NetworkBoost_HandoverStart *handoverStart) | Defines the callback prototype triggered when the network handover starts. |
| typedef void(* HMS_NetworkBoost_OnHandoverComplete) (NetworkBoost_HandoverComplete *handoverComplete) | Defines the callback prototype triggered when the network handover ends. |
| typedef struct HMS_NetworkBoost_HandoverCallback HMS_NetworkBoost_HandoverCallback | Defines the parameters for registering a callback function to handle network handover, including start and end. |
| typedef enum NetworkBoost_RecommendedAction NetworkBoost_RecommendedAction | Defines the enumeration of suggested data transmission policies. |
| typedef enum NetworkBoost_PathType NetworkBoost_PathType | Defines the enumeration of data path types. |
| typedef enum NetworkBoost_Scene NetworkBoost_Scene | Defines the enumeration of network scenario types. |
| typedef enum NetworkBoost_ServiceType NetworkBoost_ServiceType | Defines the enumeration of app service types. |
| typedef enum NetworkBoost_QoeType NetworkBoost_QoeType | Defines the enumeration of network quality data types of the app. |
| typedef struct NetworkBoost_NetworkQos NetworkBoost_NetworkQos | Defines the network quality information of a single path that is returned. |
| typedef struct NetworkBoost_NetworkQosArray NetworkBoost_NetworkQosArray | Defines the network quality information of multiple paths that is returned. |
| typedef struct NetworkBoost_WeakSignalPrediction NetworkBoost_WeakSignalPrediction | Defines weak signal prediction information. |
| typedef struct NetworkBoost_NetworkScene NetworkBoost_NetworkScene | Defines the network scenario change information that is returned. |
| typedef void(* HMS_NetworkBoost_NetQosChange) (NetworkBoost_NetworkQosArray *networkQosArray) | Defines the callback prototype for network quality changes. |
| typedef void(* HMS_NetworkBoost_NetSceneChange) (NetworkBoost_NetworkScene *networkScene) | Defines the callback prototype for network scenario changes. |
| typedef void (* HMS_NetworkBoost_OnMultiPathRequestResult)(NetworkBoost_MultiPathRequestResult* result) | Defines the callback prototype for multi-network concurrency request results. |
| typedef void (* HMS_NetworkBoost_OnMultiPathStateChange)(NetworkBoost_MultiPathStateChange* multiPathState) | Defines the callback prototype for multi-network concurrency status changes. |
| typedef void (* HMS_NetworkBoost_OnMultiPathRecommendation)(NetworkBoost_MultiPathRecommendation* recommendation) | Defines the callback prototype for multi-network concurrency suggestion changes. |
| Enum | Description |
|---|---|
| NetworkBoost_DataSpeedSimpleAction { NB_SIMPLEACTION_SUSPEND_DATA = 1, NB_SIMPLEACTION_DECREASE_DATA = 2, NB_SIMPLEACTION_INCREASE_DATA = 3, NB_SIMPLEACTION_KEEP_DATA = 4 } | Defines the enumeration of suggested packet transmission policies. |
| NetworkBoost_ErrorResult { NB_ERROR_NONE = 0, NB_ERROR_HANDOVER_TIMEOUT = 1, NB_ERROR_NEW_PATH_ACTIVATION_FAILED = 2, NB_ERROR_ABORT = 3 } | Defines the enumeration of network handover results. |
| NB_REEST_DEFAULT = 0, NB_REEST_QUERY_DNS = 1, NB_REEST_CHANGE_REMOTE_IP = 2, NB_REEST_CHANGE_IP_VERSION = 3, NB_NO_EST = 4 } | Defines the enumeration of link re-establishment types. |
| NetworkBoost_HandoverMode { NB_MODE_DELEGATION = 0, NB_MODE_DISCRETION = 1 } | Defines the enumeration of network handover modes. |
NetworkBoost_RecommendedAction { NB_ACTION_DO_CACHING = 0, NB_ACTION_SUSPEND_DATA = 1, NB_ACTION_DECREASE_DATA = 2, NB_ACTION_INCREASE_DATA = 3, NB_ACTION_KEEP_DATA = 4 } | Defines the enumeration of suggested data transmission policies. |
| NetworkBoost_PathType { NB_PATH_CELLULAR_PRIMARY = 0, NB_PATH_CELLULAR_SECONDARY = 1, NB_PATH_WIFI_PRIMARY = 2, NB_PATH_WIFI_SECONDARY = 3 } | Defines the enumeration of data path types. |
| NetworkBoost_Scene { NB_SCENE_NORMAL = 0, NB_SCENE_CONGESTION = 1, NB_SCENE_FREQUENT_HANDOVER = 2, NB_SCENE_WEAK_SIGNAL = 3 } | Defines the enumeration of network scenario types. |
| NB_SERVICE_DEFAULT = 0, NB_SERVICE_BACKGROUND = 1, NB_SERVICE_REAL_TIME_VOICE = 2, NB_SERVICE_REAL_TIME_VIDEO = 3, NB_SERVICE_CALL_SIGNALING = 4, NB_SERVICE_REAL_TIME_GAME = 5, NB_SERVICE_NORMAL_GAME = 6, NB_SERVICE_SHORT_VIDEO = 7, NB_SERVICE_LONG_VIDEO = 8, NB_SERVICE_LIVE_STREAMING_ANCHOR = 9, NB_SERVICE_LIVE_STREAMING_WATCHER = 10, NB_SERVICE_DOWNLOAD = 11, NB_SERVICE_UPLOAD = 12, NB_SERVICE_BROWSER = 13, NB_SERVICE_TRANSACTION = 14, NB_SERVICE_DETECTION = 15, NB_SERVICE_CLOUDSERVICE = 16, NB_SERVICE_VOICE_CONFERENCE = 17, NB_SERVICE_VIDEO_CONFERENCE = 18, NB_SERVICE_NAVIGATION = 19, NB_SERVICE_SECKILL_SERVICE = 20, NB_SERVICE_LOGIN = 21, NB_SERVICE_AUDIO = 22, NB_SERVICE_SHOPPING = 23 } | Defines the enumeration of app service types. |
| NB_QOE_GOOD = 0, NB_QOE_BAD_UNKNOWN = 1, NB_QOE_BAD_SERVER_ERROR = 2, NB_QOE_BAD_NO_DATA = 3, NB_QOE_BAD_PACKET_LOST = 4, NB_QOE_BAD_PACKET_OUT_OF_ORDER = 5, NB_QOE_BAD_HIGH_JITTER = 6, NB_QOE_BAD_HIGH_LATENCY = 7 } | Defines the enumeration of network quality data types of the app. |
| NB_PATH_IDLE = 0,NB_PATH_CONNECTED = 1,NB_PATH_SUSPENDED = 2 } | Defines the enumeration for the status of a data path other than the default path in multi-network concurrency. |
NetworkBoost_MultiPathErrorResult { NB_MULTIPATH_ERROR_NONE = 0,NB_MULTIPATH_ERROR_NETWORK_REFUSED = 1, NB_MULTIPATH_ERROR_TIMEOUT = 2, NB_MULTIPATH_ERROR_LOCAL = 3 } | Defines the enumeration of multi-network concurrency initiation results. |
NetworkBoost_MultiPathChangeCause { NB_MULTIPATH_CAUSE_REQUEST_NORMAL = 0, NB_MULTIPATH_CAUSE_RELEASE_NORMAL = 50, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_NETWORK = 51, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_USER_REFUSED = 52, NB_MULTIPATH_CAUSE_RELEASE_NO_QUOTA = 53, NB_MULTIPATH_CAUSE_RELEASE_POWER_CONSUMPTION = 54, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_INSUFFICIENT_TRAFFIC = 55, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_CONFLICT = 56, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_SYS_FUSING = 57, NB_MULTIPATH_CHANGE_CAUSE_RELEASE_SYS_DEFAULT = 99, NB_MULTIPATH_CHANGE_CAUSE_SUSPEND_ENTER = 100, NB_MULTIPATH_CHANGE_CAUSE_SUSPEND_LEAVE = 101, NB_MULTIPATH_CHANGE_CAUSE_CONN_PROPERTIES_UPDATE = 102 } | Defines the enumeration of the reasons why multi-network concurrency status changes. |
| NB_MULTIPATH_IDLE = 0, NB_MULTIPATH_CREATING = 1, NB_MULTIPATH_CREATED = 2, NB_MULTIPATH_RELEASING = 3 } | Defines the enumeration for the status of multi-network concurrency. |
NetworkBoost_MultiPathAction { NB_MULTIPATH_ACTION_REQUEST = 0, NB_MULTIPATH_ACTION_RELEASE = 1 } | Defines the enumeration of suggested multi-network concurrency actions. |
| NB_SCENE_EVENT_ENTER = 0, NB_SCENE_EVENT_UPDATE = 1,NB_SCENE_EVENT_LEAVE = 2 } | Defines the enumeration of service scenario events. |
| Function | Description |
|---|---|
| int32_t HMS_NetworkBoost_RegisterHandoverChangeCallback (HMS_NetworkBoost_HandoverCallback *callback, uint32_t *callbackId) | Registers the network handover callback. |
| int32_t HMS_NetworkBoost_UnregisterHandoverChangeCallback (uint32_t callbackId) | Deregisters the network handover callback. |
| int32_t HMS_NetworkBoost_SetHandoverMode (NetworkBoost_HandoverMode mode) | Defines the network handover mode. Your app can call the relevant API to change the network handover mode between delegation mode and proactive mode. The default mode is delegation. |
| int32_t HMS_NetworkBoost_RegisterNetQosCallback (HMS_NetworkBoost_NetQosChange callback, uint32_t *callbackId) | Registers the network quality change callback. |
| int32_t HMS_NetworkBoost_UnregisterNetQosCallback (uint32_t callbackId) | Deregisters the network quality change callback. |
| int32_t HMS_NetworkBoost_RegisterNetSceneCallback (HMS_NetworkBoost_NetSceneChange callback, uint32_t *callbackId) | Registers the network scenario change callback. |
| int32_t HMS_NetworkBoost_UnregisterNetSceneCallback (uint32_t callbackId) | Deregisters the network scenario change callback. |
| int32_t HMS_NetworkBoost_ReportQoe (NetworkBoost_ServiceType serviceType, NetworkBoost_QoeType qoeType) | Reports app data transmission quality. |
| int32_t HMS_NetworkBoost_GetMultiPathQuotaStats(NetworkBoost_MultiPathQuota *quota) | Obtains the quota information of multi-network concurrency, including the used and remaining quotas. |
| int32_t HMS_NetworkBoost_RequestMultiPath(HMS_NetworkBoost_OnMultiPathRequestResult result) | Initiates a multi-network concurrency request. |
| int32_t HMS_NetworkBoost_ReleaseMultiPath() | Releases multi-network concurrency. |
| int32_t HMS_NetworkBoost_RegisterMultiPathStateChangeCallback(HMS_NetworkBoost_OnMultiPathStateChange callback, uint32_t* callbackId) | Registers the callback triggered when a multi-network concurrency status change event occurs. |
| int32_t HMS_NetworkBoost_UnregisterMultiPathStateChangeCallback(uint32_t callbackId) | Deregisters the callback triggered when a multi-network concurrency status change event occurs. |
| int32_t HMS_NetworkBoost_RegisterMultiPathRecommendationCallback(HMS_NetworkBoost_OnMultiPathRecommendation callback, uint32_t* callbackId) | Registers the callback triggered when the multi-network concurrency suggestion provided by the device changes. |
| int32_t HMS_NetworkBoost_UnregisterMultiPathRecommendationCallback(uint32_t callbackId) | Deregisters the callback triggered when the multi-network concurrency suggestion provided by the device changes. |
| int32_t HMS_NetworkBoost_SetSceneDesc(NetworkBoost_SceneDesc sceneDesc) | Sets the service scenario. |
#define NB_TBPS 1000000000000
Description
1 Tbit/s. To handle this, utilize the uint64_t data type to prevent overflow.
Since: 5.1.0(18)
#define NETBOOST_MAX_PATH_NUM 4
Description
Maximum length of the array of details about network quality changes.
Since: 5.1.0(18)
typedef struct HMS_NetworkBoost_HandoverCallback HMS_NetworkBoost_HandoverCallback
Description
Defines the network handover information that is returned. Each method in the callback cannot be empty.
Since: 5.1.0(18)
typedef void(* HMS_NetworkBoost_NetQosChange) (NetworkBoost_NetworkQosArray *networkQosArray)
Description
Callback used to return network quality change details.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| networkQosArray | Network quality change details. |
typedef void(* HMS_NetworkBoost_NetSceneChange) (NetworkBoost_NetworkScene *networkScene)
Description
Callback used to return network scenario change details.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| networkScene | Network scenario change details. |
typedef void(* HMS_NetworkBoost_OnHandoverComplete) (NetworkBoost_HandoverComplete *handoverComplete)
Description
Callback used to return the details about the end of a network handover.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| handoverComplete | Details about the end of network handover. |
typedef void(* HMS_NetworkBoost_OnHandoverStart) (NetworkBoost_HandoverStart *handoverStart)
Description
Callback used to return the details about the start of a network handover.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| handoverStart | Details about the start of network handover. |
typedef void (*HMS_NetworkBoost_OnMultiPathRequestResult)(NetworkBoost_MultiPathRequestResult* result)
Description
Defines the callback prototype for multi-network concurrency request results.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| result | Result of initiating multi-network concurrency. |
typedef void (*HMS_NetworkBoost_OnMultiPathStateChange)(NetworkBoost_MultiPathStateChange* multiPathState)
Description
Defines the callback prototype for multi-network concurrency status changes.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| multiPathState | Multi-network concurrency status information. |
typedef void (*HMS_NetworkBoost_OnMultiPathRecommendation)(NetworkBoost_MultiPathRecommendation* recommendation)
Description
Defines the callback prototype for multi-network concurrency suggestion information.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| recommendation | Multi-network concurrency suggestion information. |
typedef struct NetworkBoost_DataSpeedAction NetworkBoost_DataSpeedAction
Description
Defines the recommended packet transmission rate.
Since: 5.1.0(18)
typedef enum NetworkBoost_DataSpeedSimpleAction NetworkBoost_DataSpeedSimpleAction
Description
Defines the enumeration of suggested packet transmission policies.
Since: 5.1.0(18)
typedef enum NetworkBoost_ErrorResult NetworkBoost_ErrorResult
Description
Defines the enumeration of network handover results.
Since: 5.1.0(18)
typedef struct NetworkBoost_HandoverComplete NetworkBoost_HandoverComplete
Description
Defines the information about the end of network handover.
Since: 5.1.0(18)
typedef enum NetworkBoost_HandoverMode NetworkBoost_HandoverMode
Description
Defines the enumeration of network handover modes.
Since: 5.1.0(18)
typedef struct NetworkBoost_HandoverStart NetworkBoost_HandoverStart
Description
Defines the information about the start of network handover.
Since: 5.1.0(18)
typedef struct NetworkBoost_NetHandle NetworkBoost_NetHandle
Description
Defines the handle of the data network.
Since: 5.1.0(18)
typedef struct NetworkBoost_NetworkQos NetworkBoost_NetworkQos
Description
Defines the network quality information of a single path that is returned.
Since: 5.1.0(18)
typedef struct NetworkBoost_NetworkQosArray NetworkBoost_NetworkQosArray
Description
Defines the network quality information of multiple paths that is returned.
Since: 5.1.0(18)
typedef struct NetworkBoost_NetworkScene NetworkBoost_NetworkScene
Description
Defines the network scenario change information that is returned.
Since: 5.1.0(18)
typedef enum NetworkBoost_PathType NetworkBoost_PathType
Description
Defines the enumeration of path types.
Since: 5.1.0(18)
typedef enum NetworkBoost_QoeType NetworkBoost_QoeType
Description
Defines the enumeration of network quality data types of the app.
Since: 5.1.0(18)
typedef enum NetworkBoost_RecommendedAction NetworkBoost_RecommendedAction
Description
Defines the enumeration of recommended data transmission policies.
Since: 5.1.0(18)
typedef enum NetworkBoost_ReEstAction NetworkBoost_ReEstAction
Description
Defines the enumeration of link re-establishment types.
Since: 5.1.0(18)
typedef enum NetworkBoost_Scene NetworkBoost_Scene
Description
Defines the enumeration of network scenario types.
Since: 5.1.0(18)
typedef enum NetworkBoost_ServiceType NetworkBoost_ServiceType
Description
Defines the enumeration of app service types.
Since: 5.1.0(18)
typedef struct NetworkBoost_WeakSignalPrediction NetworkBoost_WeakSignalPrediction
Description
Defines weak signal prediction information.
Since: 5.1.0(18)
enum NetworkBoost_DataSpeedSimpleAction
Description
Defines the enumeration of suggested packet transmission policies.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_SIMPLEACTION_SUSPEND_DATA | Stop transmitting packets. |
| NB_SIMPLEACTION_DECREASE_DATA | Decrease the packet transmission rate. |
| NB_SIMPLEACTION_INCREASE_DATA | Increase the packet transmission rate. |
| NB_SIMPLEACTION_KEEP_DATA | Keep the current packet transmission rate. |
enum NetworkBoost_ErrorResult
Description
Defines the enumeration of network handover results.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_ERROR_NONE | The network handover is successful. |
| NB_ERROR_HANDOVER_TIMEOUT | The network handover timed out. |
| NB_ERROR_NEW_PATH_ACTIVATION_FAILED | The new link failed to be activated. |
| NB_ERROR_ABORT | Network handover was canceled. |
enum NetworkBoost_HandoverMode
Description
Defines the enumeration of network handover modes.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_MODE_DELEGATION | Delegation mode, indicating that the device initiates network handover. This is the default mode. |
| NB_MODE_DISCRETION | Proactive mode, indicating that the app initiates network handover. The app can call this API to forbid the device to initiate network handover. However, in some cases, for example, when the app is switched to the background, the device may still initiate network handover even if the API is called. |
enum NetworkBoost_PathType
Description
Defines the enumeration of data path types.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_PATH_CELLULAR_PRIMARY | Primary SIM card. |
| NB_PATH_CELLULAR_SECONDARY | Secondary SIM card. |
| NB_PATH_WIFI_PRIMARY | Primary Wi-Fi. |
| NB_PATH_WIFI_SECONDARY | Secondary Wi-Fi. |
enum NetworkBoost_QoeType
Description
Defines the enumeration of network quality data types of the app.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_QOE_GOOD | Good network quality. |
| NB_QOE_BAD_UNKNOWN | Bad network quality: unknown cause. |
| NB_QOE_BAD_SERVER_ERROR | Bad network quality: server error. |
| NB_QOE_BAD_NO_DATA | Bad network quality: no data. |
| NB_QOE_BAD_PACKET_LOST | Bad network quality: packet loss. |
| NB_QOE_BAD_PACKET_OUT_OF_ORDER | Bad network quality: packets out of order. |
| NB_QOE_BAD_HIGH_JITTER | Bad network quality: high jitter. |
| NB_QOE_BAD_HIGH_LATENCY | Bad network quality: high latency. |
enum NetworkBoost_RecommendedAction
Description
Defines the enumeration of suggested data transmission policies.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_ACTION_DO_CACHING | Cache data. |
| NB_ACTION_SUSPEND_DATA | Stop transmitting packets. |
| NB_ACTION_DECREASE_DATA | Decrease the packet transmission rate. |
| NB_ACTION_INCREASE_DATA | Increase the packet transmission rate. |
| NB_ACTION_KEEP_DATA | Keep the current packet transmission rate. |
enum NetworkBoost_ReEstAction
Description
Defines the enumeration of link re-establishment types.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_REEST_DEFAULT | The app needs to re-establish the link to the same remote IP address. |
| NB_REEST_QUERY_DNS | The link type changes, for example, between Wi-Fi and cellular network, or the carrier information of the link changes. |
| NB_REEST_CHANGE_REMOTE_IP | The app needs to re-establish the link to a different remote IP address. |
| NB_REEST_CHANGE_IP_VERSION | The app needs to re-establish the link by changing the IP address type, for example, between IPv4 and IPv6. |
| NB_NO_EST | The app needs to request network resources through the original data link, without the need to re-establish the link. |
enum NetworkBoost_Scene
Description
Defines the enumeration of network scenario types.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_SCENE_NORMAL | Normal scenario. |
| NB_SCENE_CONGESTION | Congestion scenario. |
| NB_SCENE_FREQUENT_HANDOVER | Frequent cell handover scenarios. |
| NB_SCENE_WEAK_SIGNAL | Weak signal scenario. |
enum NetworkBoost_ServiceType
Description
Defines the enumeration of app service types.
Since: 5.1.0(18)
| Enumerated Value | Description |
|---|---|
| NB_SERVICE_DEFAULT | Default service type. |
| NB_SERVICE_BACKGROUND | Background service. |
| NB_SERVICE_REAL_TIME_VOICE | Real-time voice. |
| NB_SERVICE_REAL_TIME_VIDEO | Real-time video. |
| NB_SERVICE_CALL_SIGNALING | Voice signaling. |
| NB_SERVICE_REAL_TIME_GAME | Real-time game. |
| NB_SERVICE_NORMAL_GAME | Common game. |
| NB_SERVICE_SHORT_VIDEO | Short video. |
| NB_SERVICE_LONG_VIDEO | Long video. |
| NB_SERVICE_LIVE_STREAMING_ANCHOR | Live streamer service. |
| NB_SERVICE_LIVE_STREAMING_WATCHER | Live streaming viewer service. |
| NB_SERVICE_DOWNLOAD | Download. |
| NB_SERVICE_UPLOAD | Upload. |
| NB_SERVICE_BROWSER | Page browsing. |
| NB_SERVICE_TRANSACTION | Transaction payment or code scanning. |
| NB_SERVICE_DETECTION | Detection. |
| NB_SERVICE_CLOUDSERVICE | Cloud service/game. |
| NB_SERVICE_VOICE_CONFERENCE | Voice conference. |
| NB_SERVICE_VIDEO_CONFERENCE | Video conference. |
| NB_SERVICE_NAVIGATION | Navigation and location. |
| NB_SERVICE_SECKILL_SERVICE | Seckill service, such as ticket snatching, flash sale, order grabbing, and red envelope rush. |
| NB_SERVICE_LOGIN | Sign-in (including one-tap sign-in). |
| NB_SERVICE_AUDIO | Audio (including music) service. |
| NB_SERVICE_SHOPPING | Shopping. |
enum NetworkBoost_PathState
Description
Defines the enumeration for the status of a data path other than the default path in multi-network concurrency.
Since: 6.0.2(22)
| Enumerated Value | Description |
|---|---|
| NB_PATH_IDLE | The path in multi-network concurrency is idle. |
| NB_PATH_CONNECTED | The path in multi-network concurrency is set up. |
| NB_PATH_SUSPENDED | The path in multi-network concurrency is suspended. |
enum NetworkBoost_MultiPathChangeCause
Description
Defines the enumeration of the reasons why multi-network concurrency status changes.
Since: 6.0.2(22)
| Enumerated Value | Description |
|---|---|
| NB_MULTIPATH_CAUSE_REQUEST_NORMAL | A multi-network concurrency request is normally initiated. |
| NB_MULTIPATH_CAUSE_RELEASE_NORMAL | Multi-network concurrency is normally released. |
| NB_MULTIPATH_CHANGE_CAUSE_RELEASE_NETWORK | Multi-network concurrency is released due to poor network conditions. |
| NB_MULTIPATH_CHANGE_CAUSE_RELEASE_USER_REFUSED | Multi-network concurrency is released as the user turns off a relevant switch. |
| NB_MULTIPATH_CAUSE_RELEASE_NO_QUOTA | Multi-network concurrency is released due to quota exhaustion. |
| NB_MULTIPATH_CAUSE_RELEASE_POWER_CONSUMPTION | Multi-network concurrency is released due to power consumption factors. |
| NB_MULTIPATH_CHANGE_CAUSE_RELEASE_INSUFFICIENT_TRAFFIC | Multi-network concurrency is released due to traffic consumption factors. |
| NB_MULTIPATH_CHANGE_CAUSE_RELEASE_CONFLICT | Multi-network concurrency is released due to scenario conflicts. |
| NB_MULTIPATH_CHANGE_CAUSE_RELEASE_SYS_FUSING | Multi-network concurrency is released by the device after an app improperly uses multi-network concurrency, for example, keeping multi-network concurrency on for a long time. |
| NB_MULTIPATH_CHANGE_CAUSE_RELEASE_SYS_DEFAULT | Multi-network concurrency is released due to network status changes of the device. |
| NB_MULTIPATH_CHANGE_CAUSE_SUSPEND_ENTER | Multi-network concurrency is suspended. In this case, it is not released, but data transmission is actually suspended. |
| NB_MULTIPATH_CHANGE_CAUSE_SUSPEND_LEAVE | Multi-network concurrency leaves the suspended state. |
| NB_MULTIPATH_CHANGE_CAUSE_CONN_PROPERTIES_UPDATE | Link attributes are updated for multi-network concurrency. For example, the IP address changes. |
enum NetworkBoost_MultiPathErrorResult
Description
Defines the enumeration of multi-network concurrency initiation results.
Since: 6.0.2(22)
| Enumerated Value | Description |
|---|---|
| NB_MULTIPATH_ERROR_NONE | Multi-network concurrency initiated successfully. |
| NB_MULTIPATH_ERROR_NETWORK_REFUSED | Multi-network concurrency rejected. |
| NB_MULTIPATH_ERROR_TIMEOUT | Multi-network concurrency timed out. |
| NB_MULTIPATH_ERROR_LOCAL | Multi-network concurrency is released locally when it is being initiated. For example, multi-network concurrency conditions are no longer met due to cellular data switch being turned off or other events during the startup. |
enum NetworkBoost_MultiPathState
Description
Defines the enumeration for the status of multi-network concurrency.
Since: 6.0.2(22)
| Enumerated Value | Description |
|---|---|
| NB_MULTIPATH_IDLE | Multi-network concurrency is available. |
| NB_MULTIPATH_CREATING | Multi-network concurrency is being initiated. |
| NB_MULTIPATH_CREATED | Multi-network concurrency has been initiated. |
| NB_MULTIPATH_RELEASING | Multi-network concurrency is being released. |
enum NetworkBoost_MultiPathAction
Description
Defines the enumeration of suggested multi-network concurrency actions.
Since: 6.0.2(22)
| Enumerated Value | Description |
|---|---|
| NB_MULTIPATH_ACTION_REQUEST | Initiate a multi-network concurrency request. |
| NB_MULTIPATH_ACTION_RELEASE | Release multi-network concurrency. |
enum NetworkBoost_SceneEvent
Description
Defines the enumeration of service scenario events.
Since: 6.0.2(22)
| Enumerated Value | Description |
|---|---|
| NB_SCENE_EVENT_ENTER | The app enters a service scenario. |
| NB_SCENE_EVENT_UPDATE | The last service scenario event information is updated. |
| NB_SCENE_EVENT_LEAVE | The app leaves a service scenario. |
int32_t HMS_NetworkBoost_RegisterHandoverChangeCallback (HMS_NetworkBoost_HandoverCallback * callback, uint32_t * callbackId )
Description
Registers the network handover callback.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| callback | Callback function used to return network handover information. |
| callbackId | ID of the callback function, which is allocated by the system and used to deregister the callback. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
62100003: The number of registration requests has reached the upper limit.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_RegisterNetQosCallback (HMS_NetworkBoost_NetQosChange callback, uint32_t * callbackId )
Description
Registers the network quality information callback.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| callback | Callback function used to return network quality data. |
| callbackId | ID of the callback function, which is allocated by the system and used to deregister the callback. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
62100003: The number of registration requests has reached the upper limit.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_RegisterNetSceneCallback (HMS_NetworkBoost_NetSceneChange callback, uint32_t * callbackId )
Description
Registers the network scenario change callback.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| callback | Callback function used to return the network scenario change details. |
| callbackId | ID of the callback function, which is allocated by the system and used to deregister the callback. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
62100003: The number of registration requests has reached the upper limit.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_ReportQoe (NetworkBoost_ServiceType serviceType, NetworkBoost_QoeType qoeType )
Description
Reports app data transmission quality.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| serviceType | Service type of the app. |
| qoeType | Network quality type of the app. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_SetHandoverMode (NetworkBoost_HandoverMode mode)
Description
Changes the network handover mode.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| mode | Network handover mode. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_UnregisterHandoverChangeCallback (uint32_t callbackId)
Description
Deregisters the network handover information callback.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_UnregisterNetQosCallback (uint32_t callbackId)
Description
Deregisters the network quality information callback.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_UnregisterNetSceneCallback (uint32_t callbackId)
Description
Deregisters the network scenario change callback.
Since: 5.1.0(18)
Parameters
| Name | Description |
|---|---|
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
401: Parameter error.
801: System capability not supported.
62100001: Internal error.
62100002: System service operation failure.
Permissions:
ohos.permission.GET_NETWORK_INFO
int32_t HMS_NetworkBoost_GetMultiPathQuotaStats(NetworkBoost_MultiPathQuota* quota)
Description
Obtains the quota information of multi-network concurrency, including the used and remaining quotas.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| quota | Quota information obtained for an app. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: Internal error.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
1013600041: The input parameter is invalid. For example, a null pointer has been passed.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_RequestMultiPath(HMS_NetworkBoost_OnMultiPathRequestResult result)
Description
Initiates a multi-network concurrency request.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| result | Result of initiating multi-network concurrency. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
1013600041: The input parameter is invalid. For example, a null pointer has been passed.
1013620000: Multi-network concurrency is not enabled.
1013620001: Multi-network concurrency has been activated or is being activated.
1013620002: Multi-network concurrency requests reached the upper limit.
1013620003: Multi-network concurrency cannot be initiated due to power consumption restrictions.
1013620004: Quota exhausted.
1013620005: A multi-network concurrency scenario conflict occurred.
1013620006: Multi-network concurrency is initiated too frequently.
1013620007: No path is available for multi-network concurrency.
1013620008: Insufficient data traffic quota.
1013620009: Multi-network concurrency is not supported.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_ReleaseMultiPath()
Description
Releases multi-network concurrency.
Since: 6.0.2(22)
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
1013620100: Multi-network concurrency is activated by an app different from the one that initiated the release request.
1013620101: Multi-network concurrency is not activated.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_RegisterMultiPathStateChangeCallback(HMS_NetworkBoost_OnMultiPathStateChange callback, uint32_t* callbackId)
Description
Registers the callback triggered when a multi-network concurrency status change event occurs.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| callback | Network status change callback. |
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
1013600041: The input parameter is invalid. For example, a null pointer has been passed.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_UnregisterMultiPathStateChangeCallback(uint32_t callbackId)
Description
Deregisters the callback triggered when a multi-network concurrency status change event occurs.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_RegisterMultiPathRecommendationCallback(HMS_NetworkBoost_OnMultiPathRecommendation callback, uint32_t* callbackId)
Description
Registers the callback triggered when the multi-network concurrency suggestion provided by the device changes.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| callback | Callback for multi-network concurrency suggestion changes. |
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
1013600041: The input parameter is invalid. For example, a null pointer has been passed.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_UnregisterMultiPathRecommendationCallback(uint32_t callbackId)
Description
Deregisters the callback triggered when the multi-network concurrency suggestion provided by the device changes.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| callbackId | Callback ID, which is allocated by the system when the callback is registered. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
Permissions:
ohos.permission.LINKTURBO
int32_t HMS_NetworkBoost_SetSceneDesc(NetworkBoost_SceneDesc sceneDesc)
Description
Sets the service scenario.
Since: 6.0.2(22)
Parameters
| Name | Description |
|---|---|
| sceneDesc | Description information of a service scenario. |
Returns:
0: Success.
201: Insufficient permission.
1013600001: System processing error. For example, the internal state machine is faulty, or the internal message queue is congested.
1013600002: System processing error. For example, IPC fails or the network management service fails to be started.
Permissions:
ohos.permission.INTERNET