summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jack Yu <jackyu@google.com> 2017-02-02 22:21:00 +0000
committer android-build-merger <android-build-merger@google.com> 2017-02-02 22:21:00 +0000
commit40d0753b10f9ffd5fea8ae827d8fbeb7f266025c (patch)
tree309106de4877263eea4211a3d92cd9bd01121b36
parent1422a6074d840906e6d92ddb9e0a5a308b791bef (diff)
parent91a0bc956445c1a0fa099d3e8e87affe217519f7 (diff)
Fixed the logic for tethering provisioning re-evaluation
am: 91a0bc9564 Change-Id: I4c499b756c019d83a61e61da3065f31a4d8672f2
-rw-r--r--services/core/java/com/android/server/connectivity/Tethering.java17
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 9566f9396d18..6a7e0d4667c0 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -1419,9 +1419,8 @@ public class Tethering extends BaseNetworkObserver {
// 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();
@@ -1439,14 +1438,14 @@ public class Tethering extends BaseNetworkObserver {
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) {