Create callback to call on auxiliary supplicant events, namely
EAP_METHOD_SELECTED, SSID_TEMP_DISABLED, and OPEN_SSL_FAILURE.

Bug: 165342942
Test: m
Change-Id: I28ccd513bba937041ae8be1c5eff1fa6cb491c97
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
new file mode 100644
index 0000000..471cfff
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum AuxiliarySupplicantEventCode {
+  EAP_METHOD_SELECTED = 0,
+  SSID_TEMP_DISABLED = 1,
+  OPEN_SSL_FAILURE = 2,
+}
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 8d11d41..b36cd84 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
@@ -37,6 +37,7 @@
   oneway void onAnqpQueryDone(in byte[] bssid, in android.hardware.wifi.supplicant.AnqpData data, in android.hardware.wifi.supplicant.Hs20AnqpData hs20Data);
   oneway void onAssociationRejected(in android.hardware.wifi.supplicant.AssociationRejectionData assocRejectData);
   oneway void onAuthenticationTimeout(in byte[] bssid);
+  oneway void onAuxiliarySupplicantEvent(in android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode eventCode, in byte[] bssid, in String reasonString);
   oneway void onBssTmHandlingDone(in android.hardware.wifi.supplicant.BssTmData tmData);
   oneway void onBssidChanged(in android.hardware.wifi.supplicant.BssidChangeReason reason, in byte[] bssid);
   oneway void onDisconnected(in byte[] bssid, in boolean locallyGenerated, in android.hardware.wifi.supplicant.StaIfaceReasonCode reasonCode);
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
new file mode 100644
index 0000000..c0035c4
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi.supplicant;
+
+/**
+ * Event codes for auxiliary events that can be generated by
+ * the supplicant. This includes events that are not major
+ * state changes (e.g. Connected, Disconnected), but that the
+ * client may still want to be alerted about.
+ */
+@VintfStability
+@Backing(type="int")
+enum AuxiliarySupplicantEventCode {
+    EAP_METHOD_SELECTED,
+    SSID_TEMP_DISABLED,
+    OPEN_SSL_FAILURE
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index ade68f0..5479441 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -18,6 +18,7 @@
 
 import android.hardware.wifi.supplicant.AnqpData;
 import android.hardware.wifi.supplicant.AssociationRejectionData;
+import android.hardware.wifi.supplicant.AuxiliarySupplicantEventCode;
 import android.hardware.wifi.supplicant.BssTmData;
 import android.hardware.wifi.supplicant.BssidChangeReason;
 import android.hardware.wifi.supplicant.DppAkm;
@@ -71,6 +72,16 @@
     void onAuthenticationTimeout(in byte[] bssid);
 
     /**
+     * Indicates that an auxiliary event was generated by the supplicant.
+     *
+     * @param eventCode |AuxiliarySupplicantEventCode| for the event that occurred.
+     * @param bssid BSSID of the AP which caused the event.
+     * @param reasonString Additional information about why the event occurred.
+     */
+    void onAuxiliarySupplicantEvent(
+            in AuxiliarySupplicantEventCode eventCode, in byte[] bssid, in String reasonString);
+
+    /**
      * Indicates BTM request frame handling status.
      *
      * @param tmData Data retrieved from received BSS transition management
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 fdafe08..d991e39 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
@@ -79,6 +79,13 @@
         const std::vector<uint8_t>& /* bssid */) override {
         return ndk::ScopedAStatus::ok();
     }
+    ::ndk::ScopedAStatus onAuxiliarySupplicantEvent(
+            ::aidl::android::hardware::wifi::supplicant ::
+                    AuxiliarySupplicantEventCode /* eventCode */,
+            const std::vector<uint8_t>& /* bssid */,
+            const std::string& /* reasonString */) override {
+        return ndk::ScopedAStatus::ok();
+    }
     ::ndk::ScopedAStatus onBssTmHandlingDone(
         const ::aidl::android::hardware::wifi::supplicant::
             BssTmData& /* tmData */) override {