diff options
author | Jayachandran C <jayachandranc@google.com> | 2020-02-28 16:56:12 -0800 |
---|---|---|
committer | Jayachandran Chinnakkannu <jayachandranc@google.com> | 2020-02-29 01:03:21 +0000 |
commit | 71844d18b32d2c40f51c7f2f633e9387ec25ce50 (patch) | |
tree | c4bb177f9b3fbcbd51a4c948a34086bd0b558698 /service | |
parent | a41a8b4bace719172bb2721e0b6323bc3830e11d (diff) |
Make IccCardConstants APIs hidden as per API concil's feedback
This CL uses altenate API for WiFi
For rest of the external components, we will fix in S
Bug: 147320577
Test: atest frameworks/opt/net/wifi/tests/wifitests
Change-Id: I8d54411cad6e8f61697095fa2fd6baed63fe4ce8
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 acb060dfc..347a6e5d2 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -364,21 +364,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 |