From b07b56ee6d7e5e0812998c59fe71bd1efded5c2a Mon Sep 17 00:00:00 2001 From: tornaco Date: Sat, 25 Jul 2020 19:38:42 +0800 Subject: [PATCH] Add slot index support for Data API --- .DS_Store | Bin 8196 -> 8196 bytes docs/.DS_Store | Bin 10244 -> 10244 bytes docs/_posts/.DS_Store | Bin 6148 -> 6148 bytes docs/_posts/2019-12-02-Profile.md | 60 +++++++++++++++++++++++++----- 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/.DS_Store b/.DS_Store index 71a5cd1ad343090a18075373ff278fc623591a0f..91dd5d1235654e9131678b73a2dd29c290278020 100644 GIT binary patch delta 225 zcmZp1XmQx!E#USosURn_xWvHV1|t(Q3o9Et2PYRdCpRBAXKZjretB?7Vo7PSQ({rP zfJ|^^N@`MKQFvxbNk&L&o@-8OS!$ktkxybt>f{;$&-!SPhJeJ944@(oWrrLG1`y!n z;EWfLtgbe)G}citG%>5yQK&XFGB?ptFtaqRt>xt4kW_aIiYsmEn>BmM(q+pJ9|3D) zU}S{Q41!P^MjZt*SQt_m@)?pDigSv~oRf0$lNcD7HtPzmW82Iw@r`BkMGk delta 164 zcmZp1XmQx!Ens*msURn_xWvHVIwKP^3o9Et2L~4i7cWDj)IASNv)1TwV{y-h+|}4Tg%BIu4-uOnUGsq sRb5kCH;Vxb7#Sfn13#38QL{HY2_9ve*r2nSUE&+dW=+w1OcNV40r!h2R{#J2 diff --git a/docs/.DS_Store b/docs/.DS_Store index 0d58bea429c49ad931295ab855bb93254c2f7817..b1c31e6e879ccbcde3c7043eb1443e157ccd21ab 100644 GIT binary patch delta 33 ocmZn(XbISGN>IeoSVzIo#H?0Fq1w>M+(bvg%+hr8JwY`w0IgIBdjJ3c delta 33 ocmZn(XbISGN>IeaTt~s!(xO&Jq1w>M#6U;E#K?T}JwY`w0Ig;TbpQYW diff --git a/docs/_posts/.DS_Store b/docs/_posts/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..dd7b7e1ec5080e33d78fe19ddee889d40386856f 100644 GIT binary patch literal 6148 zcmeHKO-sW-5Pe&VC|-JzDuU$bC1U(Q#Y-&pP*4#22keJ}7>(3c&{Hn{7=NEXK;P^x zl_u*|L}$Xx+e~&|Hg7{V3&6A{!vtsmSfC5m78wF2*TpMV^O<>~u^chBu#XrCb}GF! z@f#J8xocvZ^OoR%Gxs%rF;3CL3!a%hLyjS?u!%biJ6S&HXL+BM^4c8HH$JSf1*`_x zcFEDjn0zC~7#ElzBj00?@vX$T7GT^fF}BE;V}M(-jzX-aSz=ueupW}NgL{rk#+vbn zaZJ`RZt%p+IIMwrEpb;zED8(P0}po(Q9@LmkUyxbc`vap`w`116SifxB%bq$b6j(b zqG@1`YP}K@Pt{ZbRp4JMz%^TJVacIJRX`O`1*Qtf_aUMSrXCB2_S3;&w*bUC)7IFQ zpF*jLJf$aaTG9coks zRDoFq=GD+v!r`=p4Z9Sx fuPntYbZg8<(jcZD3x~|m^hdzTpg|S*Q3XB$*^YEZ delta 70 zcmZoMXfc=|#>AjHu~2NHo+1YW5HK<@2y7PQ5M$Xaz%q+@Gdl-A2T;LgMwai)llesy VIf3#F2_S`&O?Z?y$B3+81_0!d4M+e0 diff --git a/docs/_posts/2019-12-02-Profile.md b/docs/_posts/2019-12-02-Profile.md index b11cea85f..fb0669e18 100644 --- a/docs/_posts/2019-12-02-Profile.md +++ b/docs/_posts/2019-12-02-Profile.md @@ -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 | 接口定义: @@ -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