拨号过程中显示“Unknown Caller”

[Android Version]

Android V2.3 (GB,GB2,GB3)

Android V4.0, 4.1,4.2,4.3,4.4(ICS,ICS2,JBJ,B2,JB3,JB5,KK1,KK1.MP1,KK1.MP3)

Android V5.0,5.1(L0,L1)

 

[DESCRIPTION]

拨号过程中显示“Unknown Caller”

[SOLUTION]

一, KK及之前的版本:可将文件InCallScreen.java中的
(KK版本在SuppMessageManager.java)
函数doSuppCrssSuppServiceNotification中的以下语句
if (conn == null) {
            // TODO
            if (DBG) log(" Connnection is null");
            return;
        } else {
修改为
if (conn == null) {
            // TODO
            if (DBG) log(" Connnection is null");
            return;
        } else if (!TextUtils.isEmpty(number)) {//仅当号码不为空时才更新号码
 
 
二, L0/L1版本修改如下:
 
1. frameworks\opt\telephony\src\java\com\android\internal\telephony\gsm\GsmConnection.java

update (DriverCall dc) {
    .....................................;
    //Ignore dc.number and dc.name in case of a handover connection
    if (mOrigConnection != null) {
        if (Phone.DEBUG_PHONE) log("update: mOrigConnection is not null");
    } else {
        /// M: for ALPS02254226. disable COLP. @{
        // if original number is valid, don't update.
        log(" mNumberConverted: " + mNumberConverted + ", mAddress: " + mAddress);
        if ((mAddress == null || mAddress.isEmpty()) &&
        /// @}
            !equalsHandlesNulls(mAddress, dc.number) && (!mNumberConverted||
            !equalsHandlesNulls(mConvertedNumber, dc.number))) {
            if (Phone.DEBUG_PHONE) log("update: phone # changed!");
            mAddress = dc.number;
            changed = true;
        }
    }

    ....................................;

    return changed;
}
 
2. frameworks\opt\telephony\src\java\com\android\internal\telephony\gsm\GsmPhone.java

public void handleMessage (Message msg) {
    ..................................;
    switch (msg.what) {
    .........................................;
    case EVENT_CRSS_IND:
        ar = (AsyncResult) msg.obj;
        SuppCrssNotification noti = (SuppCrssNotification) ar.result;

        if (noti.code == SuppCrssNotification.CRSS_CALLING_LINE_ID_PREST) {
            ...............................;
        } else if (noti.code == SuppCrssNotification.CRSS_CONNECTED_LINE_ID_PREST) {
            /* If the phone number contains in +COLP is different from the address of connection,
                store it to connection as redirecting address.
            */
            Rlog.d(LOG_TAG, "[COLP]noti.number = " + noti.number);
            if (getForegroundCall().getState() != GsmCall.State.IDLE) {
                ..............................;
            }

            /// M: for ALPS02254226. disable COLP. @{
            // need not to notity SuppMessageManager, ignore COLP. So, break;
            Rlog.d(LOG_TAG, "Ignore COLP, don't notify SuppMessageManager to update number.");
            break;
            /// @}
        }

        /// M: CRSS notification @{
        mCachedCrssn = ar;
        /// @}
        mCallRelatedSuppSvcRegistrants.notifyRegistrants(ar);

        break;

    .........................................;
    }
}
 
 
Note: 针对 L 版本的特别说明; 虽然上面针对该FAQ的更改涉及到两个部分. 但不管是 L0, 还是 L1; 我们仅需要改动
 
frameworks\opt\telephony\src\java\com\android\internal\telephony\gsm\GsmConnection.java
 
部分就可以完全规避这个问题. 这是因为 COLP 这一路消息的更新, 在 Telecom 进程已经做了限制. 在这种情况
 
下不会去更新 Telecom 中 Call 对象的号码信息(具体请参考 CallsManager.nofityNumberUpdate(Call, String) 方法).
 
请知悉.
 

你可能感兴趣的:(拨号过程中显示“Unknown Caller”)