diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-03-03 03:01:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-03 03:01:27 +0000 |
commit | 0c218cb23df088f732b9c46239c4ab727bc8c4a7 (patch) | |
tree | 23b9c600222e1a5416480e410c0a9f4f796e2c98 /service | |
parent | 464ed4cf4a481e2e18bdd1809ffa8e55322d0362 (diff) | |
parent | 10505615dbeb7ea75ede6ee7fbf45192818b2a9c (diff) |
Merge changes from topic "r-api-review-ims" into rvc-dev
* changes:
Wifi: handle died supplicant condition properly
Wifi: revise WIFI off deferring constant name
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeManager.java | 2 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/SupplicantStaIfaceHal.java | 24 |
2 files changed, 20 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeManager.java b/service/java/com/android/server/wifi/ClientModeManager.java index 30706186f..043473a4b 100644 --- a/service/java/com/android/server/wifi/ClientModeManager.java +++ b/service/java/com/android/server/wifi/ClientModeManager.java @@ -235,7 +235,7 @@ public class ClientModeManager implements ActiveModeManager { (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); PersistableBundle config = configManager.getConfigForSubId(defaultVoiceSubId); return (config != null) - ? config.getInt(CarrierConfigManager.Ims.KEY_WIFI_OFF_DEFERRING_TIME_INT) + ? config.getInt(CarrierConfigManager.Ims.KEY_WIFI_OFF_DEFERRING_TIME_MILLIS_INT) : 0; } diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java index 717d0d7b5..cc63d2f93 100644 --- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java +++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java @@ -752,23 +752,37 @@ public class SupplicantStaIfaceHal { protected ISupplicant getSupplicantMockable() throws RemoteException, NoSuchElementException { synchronized (mLock) { - return ISupplicant.getService(); + ISupplicant iSupplicant = ISupplicant.getService(); + if (iSupplicant == null) { + throw new NoSuchElementException("Cannot get root service."); + } + return iSupplicant; } } protected android.hardware.wifi.supplicant.V1_1.ISupplicant getSupplicantMockableV1_1() throws RemoteException, NoSuchElementException { synchronized (mLock) { - return android.hardware.wifi.supplicant.V1_1.ISupplicant.castFrom( - ISupplicant.getService()); + android.hardware.wifi.supplicant.V1_1.ISupplicant iSupplicantDerived = + android.hardware.wifi.supplicant.V1_1.ISupplicant.castFrom( + getSupplicantMockable()); + if (iSupplicantDerived == null) { + throw new NoSuchElementException("Cannot cast to V1.1 service."); + } + return iSupplicantDerived; } } protected android.hardware.wifi.supplicant.V1_2.ISupplicant getSupplicantMockableV1_2() throws RemoteException, NoSuchElementException { synchronized (mLock) { - return android.hardware.wifi.supplicant.V1_2.ISupplicant.castFrom( - ISupplicant.getService()); + android.hardware.wifi.supplicant.V1_2.ISupplicant iSupplicantDerived = + android.hardware.wifi.supplicant.V1_2.ISupplicant.castFrom( + getSupplicantMockable()); + if (iSupplicantDerived == null) { + throw new NoSuchElementException("Cannot cast to V1.1 service."); + } + return iSupplicantDerived; } } |