diff options
author | Jack Yu <jackyu@google.com> | 2017-01-16 10:49:55 -0800 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2017-02-22 13:45:40 -0800 |
commit | 364e0be9e15e9bcef7fbe33ff0b330228d4e861c (patch) | |
tree | 6e720b29196ef4368b80bd385223100648cbc5b5 | |
parent | 6bc7cf9d8e3a688945fbf9bbe18f774b576d25f3 (diff) | |
download | base-364e0be9e15e9bcef7fbe33ff0b330228d4e861c.tar.gz |
Fixed the logic for tethering provisioning re-evaluation
Previously we only re-evaluate provisioning for SIM swap case
The new logic covers both SIM swap case
(ABSENT->NOT_READY->UNKNOWN->READY->LOADED) and modem reset
case (NOT_READY->READY->LOADED)
Test: Manual
bug: 33815946
Change-Id: I9960123605b10d3fa5f3584c6c8b70b616acd6f8
(cherry picked from commit 91a0bc956445c1a0fa099d3e8e87affe217519f7)
-rw-r--r-- | services/core/java/com/android/server/connectivity/Tethering.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index da9c5474b66b..de919a3f1aa6 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -1541,9 +1541,8 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering // used to verify this receiver is still current final private int mGenerationNumber; - // we're interested in edge-triggered LOADED notifications, so - // ignore LOADED unless we saw an ABSENT state first - private boolean mSimAbsentSeen = false; + // used to check the sim state transition from non-loaded to loaded + private boolean mSimNotLoadedSeen = false; public SimChangeBroadcastReceiver(int generationNumber) { super(); @@ -1561,14 +1560,14 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering final String state = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE); - Log.d(TAG, "got Sim changed to state " + state + ", mSimAbsentSeen=" + - mSimAbsentSeen); - if (!mSimAbsentSeen && IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(state)) { - mSimAbsentSeen = true; + Log.d(TAG, "got Sim changed to state " + state + ", mSimNotLoadedSeen=" + + mSimNotLoadedSeen); + if (!mSimNotLoadedSeen && !IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(state)) { + mSimNotLoadedSeen = true; } - if (mSimAbsentSeen && IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(state)) { - mSimAbsentSeen = false; + if (mSimNotLoadedSeen && IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(state)) { + mSimNotLoadedSeen = false; try { if (mContext.getResources().getString(com.android.internal.R.string. config_mobile_hotspot_provision_app_no_ui).isEmpty() == false) { |