From d7ed5ae3f93004aeab12cc8a54e090d78df23dda Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 6 Oct 2022 22:23:41 +0800 Subject: [PATCH] wifi: new state change HAL callback with current used key management mask Bug: 230766005 Test: atest vts Change-Id: I9a9d85df53fe615f89a448f8ece16c6cbfbf6dee --- .../ISupplicantStaIfaceCallback.aidl | 1 + .../ISupplicantStaIfaceCallback.aidl | 26 +++++++++++++++++++ .../supplicant_sta_iface_aidl_test.cpp | 7 +++++ 3 files changed, 34 insertions(+) diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 25a09b435e..c7dd5841bd 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -63,4 +63,5 @@ interface ISupplicantStaIfaceCallback { oneway void onWpsEventSuccess(); oneway void onQosPolicyReset(); oneway void onQosPolicyRequest(in int qosPolicyRequestId, in android.hardware.wifi.supplicant.QosPolicyData[] qosPolicyData); + oneway void onStateChangedWithAkm(in android.hardware.wifi.supplicant.StaIfaceCallbackState newState, in byte[] bssid, in int id, in byte[] ssid, in boolean filsHlpSent, in android.hardware.wifi.supplicant.KeyMgmtMask keyMgmtMask); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 0730a8cf54..c7961fa24b 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -27,6 +27,7 @@ import android.hardware.wifi.supplicant.DppEventType; import android.hardware.wifi.supplicant.DppFailureCode; import android.hardware.wifi.supplicant.DppProgressCode; import android.hardware.wifi.supplicant.Hs20AnqpData; +import android.hardware.wifi.supplicant.KeyMgmtMask; import android.hardware.wifi.supplicant.OsuMethod; import android.hardware.wifi.supplicant.QosPolicyData; import android.hardware.wifi.supplicant.StaIfaceCallbackState; @@ -252,6 +253,8 @@ oneway interface ISupplicantStaIfaceCallback { * event is triggered by a particular network, the |SupplicantNetworkId|, * |ssid|, |bssid| parameters must indicate the parameters of the network/AP * which caused this state transition. + *

+ * This callback is deprecated from AIDL v2, newer HAL should call onStateChangedWithAkm(). * * @param newState New State of the interface. This must be one of the |State| * values above. @@ -303,4 +306,27 @@ oneway interface ISupplicantStaIfaceCallback { * @param qosPolicyData QoS policies info requested by the AP. */ void onQosPolicyRequest(in int qosPolicyRequestId, in QosPolicyData[] qosPolicyData); + + /** + * Used to indicate a state change event on this particular iface. If this + * event is triggered by a particular network, the |id|, + * |ssid|, |bssid| parameters must indicate the parameters of the network/AP + * which caused this state transition. + * + * @param newState New State of the interface. This must be one of the + * |StaIfaceCallbackState| values above. + * @param bssid BSSID of the corresponding AP which caused this state + * change event. This must be zero'ed if this event is not + * specific to a particular network. + * @param id ID of the corresponding network which caused this + * state change event. This must be invalid (-1) if this + * event is not specific to a particular network. + * @param ssid SSID of the corresponding network which caused this state + * change event. This must be empty if this event is not specific + * to a particular network. + * @param filsHlpSent Whether FILS HLP IEs were included in this association. + * @param keyMgmtMask current used key mgmt mask. + */ + void onStateChangedWithAkm(in StaIfaceCallbackState newState, in byte[] bssid, in int id, + in byte[] ssid, in boolean filsHlpSent, in KeyMgmtMask keyMgmtMask); } diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp index 272a427e77..d57f539a20 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp @@ -206,6 +206,13 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback { QosPolicyData /* qosPolicyData */>&) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onStateChangedWithAkm( + ::aidl::android::hardware::wifi::supplicant::StaIfaceCallbackState /* newState */, + const std::vector& /* bssid */, int32_t /* id */, + const std::vector& /* ssid */, bool /* filsHlpSent */, + ::aidl::android::hardware::wifi::supplicant::KeyMgmtMask /* keyMgmtMask*/) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantStaIfaceAidlTest : public testing::TestWithParam {