diff options
author | Jayachandran Chinnakkannu <jayachandranc@google.com> | 2020-03-02 21:18:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-02 21:18:50 +0000 |
commit | e7fa928e88a711ff5fcedbe0b0f13801fca6ae97 (patch) | |
tree | cb61bca9254cc6aa6167b2cc9f9ab240ba5755f7 /service | |
parent | 4531cc8eaabe3a0bbec1675b4e52d87a6a89aefe (diff) | |
parent | 71844d18b32d2c40f51c7f2f633e9387ec25ce50 (diff) |
Merge "Make IccCardConstants APIs hidden as per API concil's feedback" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 582d053a9..eefe6ded7 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -366,21 +366,29 @@ public class WifiServiceImpl extends BaseWifiService { new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - if (intent.getBooleanExtra( - Intent.EXTRA_REBROADCAST_ON_UNLOCK, false)) { - return; - } - String state = intent.getStringExtra(Intent.EXTRA_SIM_STATE); - if (Intent.SIM_STATE_ABSENT.equals(state)) { + int state = intent.getIntExtra(TelephonyManager.EXTRA_SIM_STATE, + TelephonyManager.SIM_STATE_UNKNOWN); + if (TelephonyManager.SIM_STATE_ABSENT == state) { Log.d(TAG, "resetting networks because SIM was removed"); mClientModeImpl.resetSimAuthNetworks(false); - } else if (Intent.SIM_STATE_LOADED.equals(state)) { + } + } + }, + new IntentFilter(TelephonyManager.ACTION_SIM_CARD_STATE_CHANGED)); + + mContext.registerReceiver( + new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + int state = intent.getIntExtra(TelephonyManager.EXTRA_SIM_STATE, + TelephonyManager.SIM_STATE_UNKNOWN); + if (TelephonyManager.SIM_STATE_LOADED == state) { Log.d(TAG, "resetting networks because SIM was loaded"); mClientModeImpl.resetSimAuthNetworks(true); } } }, - new IntentFilter(Intent.ACTION_SIM_STATE_CHANGED)); + new IntentFilter(TelephonyManager.ACTION_SIM_APPLICATION_STATE_CHANGED)); // Adding optimizations of only receiving broadcasts when wifi is enabled // can result in race conditions when apps toggle wifi in the background |