A500的dial過程選擇phone

2021-06-29 06:01:46 字數 1103 閱讀 5135

在自己寫的apk中發現當發出activity(intent)之後會跳出需要在兩個phone之間選擇,這個選擇會影響後面的hangup,hangup中需要相應的phone來匹配。

outgoingcallreceiver是負責處理發過來的intent的,在它的doreceive裡

int simindex = telephonyconstants.dsds_invalid_slot_id;

if (telephonyconstants.is_dsds)

看起來這邊有對phone進行了選擇

研究dualphonecontroller.usingprimaryphone(intent),這個必須是零。

static boolean usingprimaryphone(intent intent) 

string sipphoneuri = intent.getstringextra(

outgoingcallbroadcaster.extra_sip_phone_uri);

if (sipphoneuri != null)

switch (findsimid(intent))

}

關鍵在於isprimaryonsim1() ,因為這裡看起來和case是誰一點關係都沒有

static boolean isprimaryonsim1()
後面的這個telephonyconstants.dsds_slot_1_id是個常量

關鍵在於mprimaryid

mprimaryid = settings.global.getint(phoneglobals.getinstance().getcontentresolver(),

settings.global.mobile_data_sim,

telephonyconstants.dsds_slot_1_id);

}這個初始化在建構函式裡

public static int getint(contentresolver cr, string name, int def)  catch (numberformatexception e)

C 實現選擇排序的過程

總時間限制 1000ms 記憶體限制 65536kb 描述給定包含n個元素的陣列a 1 a 2 a 3 a n 利用選擇排序將其排成公升序。每次在未排序部分中選出最小元素 若有多個並列最小值,選擇下標最大的那乙個 交換到未排序部分的最前面。輸入2行 第1行包含1個正整數n 1 n 10000 代表陣...

關於Adaboos選擇最優弱分類器過程的理解

特徵的設計在此不做解釋,隨著研究的深入,很多學者豐富和改善了以前的那些特徵,最原始的矩形特徵為例 所謂的弱分類器其實是由特徵f 閾值theta和乙個決定不等號方向的p所決定的在此先不考慮p,簡單談談我理解中的選擇最優弱分類器的過程。在上述的特徵中,第一中的特徵值就是兩個矩形的畫素值之差,那麼對於很多...

web頁面左右框選擇的實現與優化過程

開始的 使用for迴圈來乙個個監測是否被選中 functionmoveoption2 sourceselect,destselect 優化後的 只檢查被選中的 巧妙的使用了selectedindex的特性,每次上乙個selected option被刪除,則selectedindex就變成下乙個sel...