summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-06-18 16:21:06 -0700
committerRaj Yengisetty <rajesh@cyngn.com>2015-06-18 16:21:08 -0700
commitb72e820a966cd8ebb4cc9b6e6e93f79fde44304e (patch)
tree23c1b2b956ab8b5489d379f6c037beb504c5d97d /src/com/cyanogenmod/setupwizard/setup
parentffc0dbd2fbba0b4fe5c9c19f481ba815c31c6d4f (diff)
downloadpackages_apps_SetupWizard-b72e820a966cd8ebb4cc9b6e6e93f79fde44304e.zip
packages_apps_SetupWizard-b72e820a966cd8ebb4cc9b6e6e93f79fde44304e.tar.gz
packages_apps_SetupWizard-b72e820a966cd8ebb4cc9b6e6e93f79fde44304e.tar.bz2
SetupWizard: protect against IllegalStateExceptions in telephony
Telephony throws this exception in some cases when retrieving SIM state Change-Id: I87e14aaa328d46ebba4990559f6531de4e961d68
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
index 5c918b3..fd557c1 100644
--- a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
+++ b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
@@ -24,6 +24,7 @@ import android.os.SystemProperties;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
+import android.util.Log;
import com.android.internal.telephony.TelephonyIntents;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -171,7 +172,13 @@ public class CMSetupWizardData extends AbstractSetupData {
TelephonyManager tm = TelephonyManager.from(mContext);
int simSlotCount = tm.getSimCount();
for (int i = 0; i < simSlotCount; i++) {
- int state = tm.getSimState(i);
+ int state;
+ try {
+ state = tm.getSimState(i);
+ } catch (IllegalStateException ise) {
+ Log.e(TAG, "Unable to get sim state from TelephonyManager");
+ continue;
+ }
if (state != TelephonyManager.SIM_STATE_ABSENT
&& state != TelephonyManager.SIM_STATE_UNKNOWN) {
return true;