Loading src/java/com/android/internal/telephony/Operators.java +32 −0 Original line number Original line Diff line number Diff line Loading @@ -116,4 +116,36 @@ public class Operators{ storedOperators = operators.containsKey(response) ? operators.get(response) : response; storedOperators = operators.containsKey(response) ? operators.get(response) : response; return storedOperators; return storedOperators; } } // this will not stay persistant in memory, this will be taken care of // iin garbage collection routiene. private Map<String, String> unOptOperators = null; // unoptimized version of operatorreplace for responseOperatorInfos // this will provide a little more flexiblilty in a loop like sisuation // same numbers of checks like before // this is for the search network functionality public String unOptimizedOperatorReplace(String response){ // sanity checking if the value is actually not equal to the range apn // numerics // if it is null, check your ril class. if(response == null || (5 != response.length() && response.length() != 6)){ return response; } try { // this will find out if it a number then it will catch it based // on invalid chars. Integer.parseInt(response); } catch(NumberFormatException E){ // an illegal char is found i.e a word return response; } if (unOptOperators == null){ unOptOperators = initList(); } return unOptOperators.containsKey(response) ? unOptOperators.get(response) : response; } } } src/java/com/android/internal/telephony/SamsungQualcommRIL.java +32 −2 Original line number Original line Diff line number Diff line Loading @@ -65,8 +65,6 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { private boolean mIsSendingSMS = false; private boolean mIsSendingSMS = false; private boolean isGSM = false; private boolean isGSM = false; public static final long SEND_SMS_TIMEOUT_IN_MS = 30000; public static final long SEND_SMS_TIMEOUT_IN_MS = 30000; private String homeOperator= SystemProperties.get("ro.cdma.home.operator.numeric"); private String operator= SystemProperties.get("ro.cdma.home.operator.alpha"); private boolean oldRilState = needsOldRilFeature("exynos4RadioState"); private boolean oldRilState = needsOldRilFeature("exynos4RadioState"); private boolean googleEditionSS = needsOldRilFeature("googleEditionSS"); private boolean googleEditionSS = needsOldRilFeature("googleEditionSS"); private boolean driverCall = needsOldRilFeature("newDriverCall"); private boolean driverCall = needsOldRilFeature("newDriverCall"); Loading Loading @@ -755,4 +753,36 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { send(rr); send(rr); } } //this method is used in the search network functionality. // in mobile network setting-> network operators @Override protected Object responseOperatorInfos(Parcel p) { String strings[] = (String [])responseStrings(p); ArrayList<OperatorInfo> ret; if (strings.length % mQANElements != 0) { throw new RuntimeException( "RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got " + strings.length + " strings, expected multiple of " + mQANElements); } ret = new ArrayList<OperatorInfo>(strings.length / mQANElements); Operators init = null; if (strings.length != 0) { init = new Operators(); } for (int i = 0 ; i < strings.length ; i += mQANElements) { String temp = init.unOptimizedOperatorReplace(strings[i+0]); ret.add ( new OperatorInfo( temp, //operatorAlphaLong temp,//operatorAlphaShort strings[i+2],//operatorNumeric strings[i+3]));//state } return ret; } } } Loading
src/java/com/android/internal/telephony/Operators.java +32 −0 Original line number Original line Diff line number Diff line Loading @@ -116,4 +116,36 @@ public class Operators{ storedOperators = operators.containsKey(response) ? operators.get(response) : response; storedOperators = operators.containsKey(response) ? operators.get(response) : response; return storedOperators; return storedOperators; } } // this will not stay persistant in memory, this will be taken care of // iin garbage collection routiene. private Map<String, String> unOptOperators = null; // unoptimized version of operatorreplace for responseOperatorInfos // this will provide a little more flexiblilty in a loop like sisuation // same numbers of checks like before // this is for the search network functionality public String unOptimizedOperatorReplace(String response){ // sanity checking if the value is actually not equal to the range apn // numerics // if it is null, check your ril class. if(response == null || (5 != response.length() && response.length() != 6)){ return response; } try { // this will find out if it a number then it will catch it based // on invalid chars. Integer.parseInt(response); } catch(NumberFormatException E){ // an illegal char is found i.e a word return response; } if (unOptOperators == null){ unOptOperators = initList(); } return unOptOperators.containsKey(response) ? unOptOperators.get(response) : response; } } }
src/java/com/android/internal/telephony/SamsungQualcommRIL.java +32 −2 Original line number Original line Diff line number Diff line Loading @@ -65,8 +65,6 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { private boolean mIsSendingSMS = false; private boolean mIsSendingSMS = false; private boolean isGSM = false; private boolean isGSM = false; public static final long SEND_SMS_TIMEOUT_IN_MS = 30000; public static final long SEND_SMS_TIMEOUT_IN_MS = 30000; private String homeOperator= SystemProperties.get("ro.cdma.home.operator.numeric"); private String operator= SystemProperties.get("ro.cdma.home.operator.alpha"); private boolean oldRilState = needsOldRilFeature("exynos4RadioState"); private boolean oldRilState = needsOldRilFeature("exynos4RadioState"); private boolean googleEditionSS = needsOldRilFeature("googleEditionSS"); private boolean googleEditionSS = needsOldRilFeature("googleEditionSS"); private boolean driverCall = needsOldRilFeature("newDriverCall"); private boolean driverCall = needsOldRilFeature("newDriverCall"); Loading Loading @@ -755,4 +753,36 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { send(rr); send(rr); } } //this method is used in the search network functionality. // in mobile network setting-> network operators @Override protected Object responseOperatorInfos(Parcel p) { String strings[] = (String [])responseStrings(p); ArrayList<OperatorInfo> ret; if (strings.length % mQANElements != 0) { throw new RuntimeException( "RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got " + strings.length + " strings, expected multiple of " + mQANElements); } ret = new ArrayList<OperatorInfo>(strings.length / mQANElements); Operators init = null; if (strings.length != 0) { init = new Operators(); } for (int i = 0 ; i < strings.length ; i += mQANElements) { String temp = init.unOptimizedOperatorReplace(strings[i+0]); ret.add ( new OperatorInfo( temp, //operatorAlphaLong temp,//operatorAlphaShort strings[i+2],//operatorNumeric strings[i+3]));//state } return ret; } } }