diff options
author | Yunong Fang <yunong@codeaurora.org> | 2016-06-11 05:10:15 +0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-08-15 01:58:10 -0700 |
commit | 6501ec3089797e930cdc8ff7a4c2651399955a0b (patch) | |
tree | 57305fcf3798060dfe42c538a0577d4f94309505 | |
parent | 4bbf00c88023895c0ae0461675553c3f789c300e (diff) | |
download | android_frameworks_opt_net_wifi-6501ec3089797e930cdc8ff7a4c2651399955a0b.tar.gz android_frameworks_opt_net_wifi-6501ec3089797e930cdc8ff7a4c2651399955a0b.tar.bz2 android_frameworks_opt_net_wifi-6501ec3089797e930cdc8ff7a4c2651399955a0b.zip |
WifiService:Fix profile can't be updated when SIM changed
Because the homeSP is stored by Map structure.and the key is
"homeSP.getFQDN()" value is homeSP. For the same Passpoint AP,
the homeSP.getFQDN() is always same.so once you connect the AP
with one TMO SIM,the PerProviderSubscription.conf will created
and stored which contains the special IMSI.but at this time ,
if you change to another TMO SIM(IMSI changed),the mSPs already
has the key(Same AP). Cause the PerProviderSubscription.conf never
be updated to the latest,then the device can not connect to AP
successfully.So it should not only judge whether "homeSP.getFQDN()"
existed but also the content.especially,IMSI.Because the IMSI is
the key point for verification whether valid.
CRs-fixed: 954654
Change-Id: I195e1862cdbe9049aee7f9e524a9aa50d136ded7
-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..5bb131e12 100644 --- a/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java +++ b/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java @@ -225,12 +225,17 @@ public class MOManager { if (!mEnabled) { throw new IOException("HS2.0 not enabled on this device"); } - if (mSPs.containsKey(homeSP.getFQDN())) { + if (mSPs.containsKey(homeSP.getFQDN()) + && getHomeSP(homeSP.getFQDN()).getCredential() != null + && getHomeSP(homeSP.getFQDN()).getCredential().getImsi() != null + && getHomeSP(homeSP.getFQDN()).getCredential().getImsi() + .equals(homeSP.getCredential().getImsi())) { Log.d(Utils.hs2LogTag(getClass()), "HS20 profile for " + homeSP.getFQDN() + " already exists"); return; } - Log.d(Utils.hs2LogTag(getClass()), "Adding new HS20 profile for " + homeSP.getFQDN()); + Log.d(Utils.hs2LogTag(getClass()), "Adding or update HS20 profile for " + + homeSP.getFQDN()); mSPs.put(homeSP.getFQDN(), homeSP); writeMO(mSPs.values(), mPpsFile); } |