MTK Android 紧急号码修改

两种修改方法

(1)   找modem管理员在modem中修改插卡情况下的紧急号码

注:在modem模块给出说明

(2)   在代码中屏蔽掉插卡情况下的代码,使插卡不插卡都走同一个流程比如v856 movistar的修改方法

在frameworks/base/telephony/java/android/telephony/目录下的PhoneNumberUtils.java文件isEmergencyNumber方法

public static boolean isEmergencyNumber(String number){

        StringplusNumber = null;

        StringnumberPlus = null;

        // If thenumber passed in is null, just return false:

        if(number == null) return false;

        // Stripthe separators from the number before comparing it

        // to the list.

        number =extractNetworkPortionAlt(number);

        //retrieve the list of emergency numbers

        // checkread-write ecclist property first

        Stringnumbers = SystemProperties.get("ril.ecclist");

if(!TextUtils.isEmpty(numbers)) {

            //searches through the comma-separated list for a match,

            //return true if one is found.

            for(String emergencyNum : numbers.split(",")) {

               plusNumber = "+" + emergencyNum;

                numberPlus= emergencyNum + "+";

               if (emergencyNum.equals(number)

                    || plusNumber.equals(number)

                    || (number.startsWith(numberPlus) &&!number.contains("*") && !number.contains("#"))) {

                    return true;

                }

            }

        }

        // thenread-only ecclist property since old RIL only uses this

        numbers =SystemProperties.get("ro.ril.ecclist");

 

        if(!TextUtils.isEmpty(numbers)) {

            //searches through the comma-separated list for a match,

            //return true if one is found.

            for(String emergencyNum : numbers.split(",")) {

               plusNumber = "+" + emergencyNum;

               numberPlus = emergencyNum + "+";

                if (emergencyNum.equals(number)

                    || plusNumber.equals(number)

                    || (number.startsWith(numberPlus) &&!number.contains("*") && !number.contains("#"))) {

                   return true;

                }

            }

            // nomatches found against the list!

           //注释掉return语句使得不卡插卡和插卡情况下都走同一流程

           //return false;

        }

        //noecclist system property, so use our own list.

        /*Modified by ALPS00005641 add 000,08,110,118,119,999 */

        final inteccNo = 9;

//zengtao 20111009 start add 133 122 105 以下流程就是不插卡情况下的紧急号码的判断流程

        String[]emergencyNumList = {"112", "911","000","08", "110", "999", "118","119", "133"};

if(!(TelephonyManager.getDefault().getSimState() == TelephonyManager.SIM_STATE_ABSENT)){//判断是否有插入SIM卡

           emergencyNumList[0]= "112";

           emergencyNumList[1]= "911";

           emergencyNumList[2]= "133";

           emergencyNumList[3]= "133";

           emergencyNumList[4]= "133";

           emergencyNumList[5]= "133";

           emergencyNumList[6]= "133";

           emergencyNumList[7]= "133";

           emergencyNumList[8]= "133";

}

//end

        for (inti = 0; i < eccNo; i++) {

           plusNumber = "+" + emergencyNumList[i];

           numberPlus = emergencyNumList[i] + "+";

            if(emergencyNumList[i].equals(number)

               || plusNumber.equals(number)

               || (number.startsWith(numberPlus) &&!number.contains("*") && !number.contains("#"))) {

               return true;

            }

        }

        returnfalse;

}


你可能感兴趣的:(android,list,String,null,MTK,Numbers)