Skip to content

Commit

Permalink
Add slot index support for Data API
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Jul 25, 2020
1 parent 0557732 commit b07b56e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified docs/.DS_Store
Binary file not shown.
Binary file modified docs/_posts/.DS_Store
Binary file not shown.
60 changes: 51 additions & 9 deletions docs/_posts/2019-12-02-Profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,15 +709,19 @@ interface IIO {

移动数据相关能力。

| 能力 | 含义 | 参数 | 举例 | 返回值 |
| ------------------------------ | -------------------------------------- | --------------------------- | ---- | --------------------- |
| setDataEnabled | 看名字 | true打开,false关闭 | 如下 | Boolean(true/false) |
| setDataEnabled | 设置移动数据开启状态(可以指定卡序号) | 卡序号,true打开,false关闭 | 如下 ||
| isDataEnabled | 获取移动数据开启状态 | true打开,false关闭 | 如下 | Boolean(true/false) |
| setDataNetworkType | 看名字 || 如下 ||
| setDataNetworkTypeForPhone | 设置网络模式(指定某个卡) || 如下 ||
| getCurrentPreferredNetworkMode | 看名字 || 如下 | int |
| getCurrentPreferredNetworkMode | 看名字 || 如下 | int |
| 能力 | 含义 | 参数 | 举例 | 返回值 |
| ------------------------------------- | -------------------------------------- | --------------------------- | ---- | --------------------- |
| setDataEnabled | 设置移动数据开启状态 | true打开,false关闭 | 如下 | Boolean(true/false) |
| setDataEnabled | 设置移动数据开启状态(可以指定卡序号) | 卡序号,true打开,false关闭 | 如下 ||
| setDataEnabledForSlot | 设置移动数据开启状态(可以指定卡槽号) | 卡序号,true打开,false关闭 | 如下 ||
| isDataEnabled | 获取移动数据开启状态 | true打开,false关闭 | 如下 | Boolean(true/false) |
| isDataEnabledForSlot | 获取移动数据开启状态(可以指定卡槽号) | true打开,false关闭 | 如下 | Boolean(true/false) |
| setDataNetworkType | 设置网络模式 | type | 如下 ||
| setDataNetworkTypeForPhone | 设置网络模式(指定某个卡) | phoneId,type | 如下 ||
| setDataNetworkTypeForSlot | 设置网络模式(指定某个卡槽号) | slotId,type | 如下 ||
| getCurrentPreferredNetworkMode | 获取当前默认卡的网络模式 || 如下 | int |
| getCurrentPreferredNetworkMode | 获取某subId的网络模式 | subId | 如下 | int |
| getCurrentPreferredNetworkModeForSlot | 获取某卡槽的网络模式 | slotId | 如下 | int |

接口定义:

Expand All @@ -728,19 +732,57 @@ interface IData {

void setDataEnabled(int subId, boolean enable);

void setDataEnabledForSlot(int slotId, boolean enable);

boolean isDataEnabled();

boolean isDataEnabledForSlot(int slotId);

void setDataNetworkType(int type);

void setDataNetworkTypeForPhone(int phoneId, int type);

void setDataNetworkTypeForSlot(int slotId, int type);

int getCurrentPreferredNetworkMode();

int getCurrentPreferredNetworkMode(int subId);

int getCurrentPreferredNetworkModeForSlot(int slotId);
}

```

数据网络模式类型:

```c
// Network type enums, primarily used by android/telephony/TelephonyManager.java.
// Do not add negative types.
enum NetworkTypeEnum {
NETWORK_TYPE_UNKNOWN = 0;
NETWORK_TYPE_GPRS = 1;
NETWORK_TYPE_EDGE = 2;
NETWORK_TYPE_UMTS = 3;
NETWORK_TYPE_CDMA = 4;
NETWORK_TYPE_EVDO_0 = 5;
NETWORK_TYPE_EVDO_A = 6;
NETWORK_TYPE_1XRTT = 7;
NETWORK_TYPE_HSDPA = 8;
NETWORK_TYPE_HSUPA = 9;
NETWORK_TYPE_HSPA = 10;
NETWORK_TYPE_IDEN = 11;
NETWORK_TYPE_EVDO_B = 12;
NETWORK_TYPE_LTE = 13;
NETWORK_TYPE_EHRPD = 14;
NETWORK_TYPE_HSPAP = 15;
NETWORK_TYPE_GSM = 16;
NETWORK_TYPE_TD_SCDMA = 17;
NETWORK_TYPE_IWLAN = 18;
NETWORK_TYPE_LTE_CA = 19;
NETWORK_TYPE_NR = 20;
}
```

举例:

```json
Expand Down

0 comments on commit b07b56e

Please sign in to comment.