diff options
author | Kouhei Kuroda <kouhei.x.kuroda@sonymobile.com> | 2015-12-01 15:08:39 +0900 |
---|---|---|
committer | Toshiya Ikenaga <toshiya.ikenaga@sonymobile.com> | 2016-04-22 23:00:54 +0900 |
commit | 7934e22219ee2b8da861867266a3e21463d7882f (patch) | |
tree | 9ddd2de8d4f87e17c6b8e0fea121023226230ff0 /service/java/com/android/server/wifi/hotspot2/omadm | |
parent | 6d66a0fbbcb3b3ffa32973c77dd895f7184be58a (diff) | |
download | android_frameworks_opt_net_wifi-7934e22219ee2b8da861867266a3e21463d7882f.tar.gz android_frameworks_opt_net_wifi-7934e22219ee2b8da861867266a3e21463d7882f.tar.bz2 android_frameworks_opt_net_wifi-7934e22219ee2b8da861867266a3e21463d7882f.zip |
Handle EAP-SIM/AKA config without IMSI
Crash happens when adding EAP-SIM/AKA Passpoint config that
doesn't have IMSI parameter. This patch takes care of the case.
Bug: 28329844
Change-Id: I3d520233f5a55221ac34d3cb65af506790c83c19
Diffstat (limited to 'service/java/com/android/server/wifi/hotspot2/omadm')
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java b/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java index 0ea75aea0..923685531 100644 --- a/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java +++ b/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java @@ -1,5 +1,6 @@ package com.android.server.wifi.hotspot2.omadm; +import android.text.TextUtils; import android.util.Base64; import android.util.Log; @@ -418,7 +419,8 @@ public class MOManager { || method.getEAPMethodID() == EAP.EAPMethodID.EAP_AKAPrim) { OMANode simNode = credentialNode.addChild(TAG_SIM, null, null, null); - simNode.addChild(TAG_IMSI, null, cred.getImsi().toString(), null); + IMSIParameter imsi = cred.getImsi(); + simNode.addChild(TAG_IMSI, null, imsi != null ? imsi.toString() : "", null); simNode.addChild(TAG_EAPType, null, Integer.toString(EAP.mapEAPMethod(method.getEAPMethodID())), null); @@ -633,7 +635,10 @@ public class MOManager { } if (simNode != null) { try { - IMSIParameter imsi = new IMSIParameter(getString(simNode.getChild(TAG_IMSI))); + IMSIParameter imsi = null; + if (!TextUtils.isEmpty(getString(simNode.getChild(TAG_IMSI)))) { + imsi = new IMSIParameter(getString(simNode.getChild(TAG_IMSI))); + } EAPMethod eapMethod = new EAPMethod(EAP.mapEAPMethod(getInteger(simNode.getChild(TAG_EAPType))), |