diff options
author | Shareef Ali <shareefalis@cyanogenmod.org> | 2013-07-29 18:37:51 -0500 |
---|---|---|
committer | Desterly <d3s7royer@gmail.com> | 2013-07-29 19:55:04 -0400 |
commit | 23bd60795611ebf0f81489bd153db959a0caf0a0 (patch) | |
tree | 1cab52fe03a05da8cdeef6d02a83c34ad4fd13e6 | |
parent | a0ca848c63fc5e3b2a52028bf5d7d4148be04510 (diff) | |
download | frameworks_opt_telephony-23bd60795611ebf0f81489bd153db959a0caf0a0.zip frameworks_opt_telephony-23bd60795611ebf0f81489bd153db959a0caf0a0.tar.gz frameworks_opt_telephony-23bd60795611ebf0f81489bd153db959a0caf0a0.tar.bz2 |
SamsungQualcommRIL: fix NPE
Change-Id: I640228aee5424605d3df5c491f1c36ea72a6d3a7
-rw-r--r-- | src/java/com/android/internal/telephony/SamsungQualcommRIL.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/java/com/android/internal/telephony/SamsungQualcommRIL.java b/src/java/com/android/internal/telephony/SamsungQualcommRIL.java index 49e369c..e3c0d40 100644 --- a/src/java/com/android/internal/telephony/SamsungQualcommRIL.java +++ b/src/java/com/android/internal/telephony/SamsungQualcommRIL.java @@ -503,22 +503,24 @@ public class SamsungQualcommRIL extends RIL implements CommandsInterface { operatorCheck(Parcel p) { String response[] = (String[])responseStrings(p); for(int i=0; i<response.length; i++){ - if (response[i]!= null&&i<2){ - if (response[i].equals(" Empty") || (response[i].equals("") && !isGSM)) { - response[i]=operator; - } else if (!response[i].equals("")) { - try { - Integer.parseInt(response[i]); - response[i]=Operators.operatorReplace(response[i]); - //optimize - if(i==0) - response[i+1]=response[i]; - } catch(NumberFormatException E){ - // do nothing + if (response[i]!= null){ + if (i<2){ + if (response[i].equals(" Empty") || (response[i].equals("") && !isGSM)) { + response[i]=operator; + } else if (!response[i].equals("")) { + try { + Integer.parseInt(response[i]); + response[i]=Operators.operatorReplace(response[i]); + //optimize + if(i==0) + response[i+1]=response[i]; + } catch(NumberFormatException E){ + // do nothing + } } + } else if (response[i].equals("31000")|| response[i].equals("11111") || response[i].equals("123456") || response[i].equals("31099") || (response[i].equals("") && !isGSM)){ + response[i]=homeOperator; } - } else if (response[i].equals("31000")|| response[i].equals("11111") || response[i].equals("123456") || response[i].equals("31099") || (response[i].equals("") && !isGSM)){ - response[i]=homeOperator; } } return response; |