雙卡雙待手機 海信 結束通話來電和指定卡去電實現

2021-06-20 12:04:55 字數 1695 閱讀 7699

海雙卡雙待手機[海信]結束通話來電和指定卡去電實現的技術調研信雙卡手機撥打**時,在啟動撥打**時,傳遞乙個引數給系統,這樣系統的可以根據該引數判斷使用指定的卡:

intent i = new intent();

i.setaction(intent.action_call);

i.setdata(uri.parse("tel:" + address));

i.putextra("subscription", type);// subscription 是名稱,不可改變. type :1為gsm卡|0為電信卡

i.addflags(intent.flag_activity_new_task);

context.startactivity(i);

海信手機在結束通話**時,使用反射方法,獲取endcall(int) 引數來結束通話**,

try  catch (exception e)

上面**中之所以沒有將注視的**去掉是因為,經測試當endcall方法引數為1時,可以結束通話主卡和副卡來電,引數為0時,只能結束通話副卡來電.那麼

intendcall.invoke(objitelephonymsim, 1);

以上一句話就是可以結束通話兩個卡的來電了. 移植專案中測試發現.打進**測試: 廣播接收到"android.intent.action.phone_state"這個action ,監聽到此廣播,再判斷來電狀態

telephonymanager tm = (telephonymanager) context.getsystemservice(service.telephony_service);

int callstate = tm.getcallstate();//獲取來電時狀態

主卡來電時,上面**通過,但是在副卡來電獲取callstate狀態時,callstate狀態是0(phone_idle =0 **結束通話狀態,phone_ringring = 1是響鈴狀態).那麼繼續猜測,副卡來電時,android系統的api方法getcallstate()是不能獲取副卡的來電狀態的,這需要使用反射方法獲取主卡和副卡的狀態,只要有來電,一定有乙個卡的callstate是phone_ringring狀態,**如下

method getitelephonymethod = mtelephymgr.getclass().getdeclaredmethod("getitelephonymsim");

getitelephonymethod.setaccessible(true);

object objitelephonymsim = getitelephonymethod.invoke(mtelephymgr);

method intendcall = objitelephonymsim.getclass().getmethod("getcallstate", int.class);

int state1 = (integer) intendcall.invoke(objitelephonymsim, 0);//主卡狀態

int state2 = (integer)intendcall.invoke(objitelephonymsim, 1);//副卡狀態

if (state1 == 1 || state2 ==1)

iphone12是雙卡雙待嗎

iphone12支援雙卡的,且無論聯通 移動 電信都可以使用。簡單地說,雙卡雙待就是消費者使用gsm雙卡雙待手機 蘋果京東 iphone12共計4款機型,包含5.4英吋和6.1英吋,iphone12 pro系列,包含6.英吋的iphone12 pro和6.7英吋的iphone12 pro max。全...

雙卡已落伍 三卡三待全鍵盤手機亮相

印度運營商olive喜歡推出一些獨具特色的手機,此前它在印度市場推出了首款3g上網本以及aaa電池手機,現在,這家公司又推出了首款三卡三待手機。圖為olive推出的三卡三待手機wiz v gc800 wiz v gc800的造型類似此前inq推出的chat 3g手機,採用了qwerty全鍵盤。功能方...

華為雙卡雙待手機聯通3G上網慢的解決辦法

例 卡1,插入聯通186的3g卡,每月有1g流量。卡2,插入移動135普通卡,可2g上網,有30m流量。設定裡面已經設定為聯通3g用來上網,3gnet模式,系統為出廠系統,未rom和roo 附加 或者以rom和root。不想關閉移動卡而又想3g卡上網速度快的朋友可試試下列方法 中國聯通上網設定 在待...