Add disconnect reason to hostapd
Report the reason a client disconnected as part of the
onConnectedClientsChanged callback.
Bug: 361651437
Test: VtsHalHostapdTargetTest
Test: VtsHalWifiSupplicantStaIfaceTargetTest
Test: VtsHalWifiSupplicantStaNetworkTargetTest
Test: VtsHalWifiSupplicantP2pIfaceTargetTest
Change-Id: I93db0f5d379a598d64def9b807c9de666fb3eb0a
diff --git a/wifi/aidl/Android.bp b/wifi/aidl/Android.bp
index b77e935..4b7e372 100644
--- a/wifi/aidl/Android.bp
+++ b/wifi/aidl/Android.bp
@@ -29,7 +29,7 @@
"android/hardware/wifi/*.aidl",
],
imports: [
- "android.hardware.wifi.common-V1",
+ "android.hardware.wifi.common-V2",
],
stability: "vintf",
backend: {
diff --git a/wifi/aidl/default/Android.bp b/wifi/aidl/default/Android.bp
index 0711bde..c2e8541 100644
--- a/wifi/aidl/default/Android.bp
+++ b/wifi/aidl/default/Android.bp
@@ -200,7 +200,7 @@
"libgmock",
"libgtest",
"android.hardware.wifi-V3-ndk",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-service-lib",
],
shared_libs: [
diff --git a/wifi/aidl/vts/functional/Android.bp b/wifi/aidl/vts/functional/Android.bp
index 66eb970..429c0c5 100644
--- a/wifi/aidl/vts/functional/Android.bp
+++ b/wifi/aidl/vts/functional/Android.bp
@@ -40,7 +40,7 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system-iface",
],
@@ -66,7 +66,7 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system-iface",
],
@@ -92,7 +92,7 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system-iface",
],
@@ -118,7 +118,7 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system-iface",
],
@@ -144,7 +144,7 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system-iface",
],
@@ -169,7 +169,7 @@
"libnativehelper",
],
static_libs: [
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system-iface",
],
diff --git a/wifi/common/aidl/Android.bp b/wifi/common/aidl/Android.bp
index 0920a55..8ea54be 100644
--- a/wifi/common/aidl/Android.bp
+++ b/wifi/common/aidl/Android.bp
@@ -54,6 +54,6 @@
imports: [],
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/wifi/common/aidl/aidl_api/android.hardware.wifi.common/current/android/hardware/wifi/common/DeauthenticationReasonCode.aidl b/wifi/common/aidl/aidl_api/android.hardware.wifi.common/current/android/hardware/wifi/common/DeauthenticationReasonCode.aidl
new file mode 100644
index 0000000..2404b2c
--- /dev/null
+++ b/wifi/common/aidl/aidl_api/android.hardware.wifi.common/current/android/hardware/wifi/common/DeauthenticationReasonCode.aidl
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2024 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.common;
+@Backing(type="int") @VintfStability
+enum DeauthenticationReasonCode {
+ HOSTAPD_NO_REASON = 0,
+ UNSPECIFIED = 1,
+ PREV_AUTH_NOT_VALID = 2,
+ DEAUTH_LEAVING = 3,
+ DISASSOC_DUE_TO_INACTIVITY = 4,
+ DISASSOC_AP_BUSY = 5,
+ CLASS2_FRAME_FROM_NONAUTH_STA = 6,
+ CLASS3_FRAME_FROM_NONASSOC_STA = 7,
+ DISASSOC_STA_HAS_LEFT = 8,
+ STA_REQ_ASSOC_WITHOUT_AUTH = 9,
+ PWR_CAPABILITY_NOT_VALID = 10,
+ SUPPORTED_CHANNEL_NOT_VALID = 11,
+ BSS_TRANSITION_DISASSOC = 12,
+ INVALID_IE = 13,
+ MICHAEL_MIC_FAILURE = 14,
+ FOURWAY_HANDSHAKE_TIMEOUT = 15,
+ GROUP_KEY_UPDATE_TIMEOUT = 16,
+ IE_IN_4WAY_DIFFERS = 17,
+ GROUP_CIPHER_NOT_VALID = 18,
+ PAIRWISE_CIPHER_NOT_VALID = 19,
+ AKMP_NOT_VALID = 20,
+ UNSUPPORTED_RSN_IE_VERSION = 21,
+ INVALID_RSN_IE_CAPAB = 22,
+ IEEE_802_1X_AUTH_FAILED = 23,
+ CIPHER_SUITE_REJECTED = 24,
+ TDLS_TEARDOWN_UNREACHABLE = 25,
+ TDLS_TEARDOWN_UNSPECIFIED = 26,
+ SSP_REQUESTED_DISASSOC = 27,
+ NO_SSP_ROAMING_AGREEMENT = 28,
+ BAD_CIPHER_OR_AKM = 29,
+ NOT_AUTHORIZED_THIS_LOCATION = 30,
+ SERVICE_CHANGE_PRECLUDES_TS = 31,
+ UNSPECIFIED_QOS_REASON = 32,
+ NOT_ENOUGH_BANDWIDTH = 33,
+ DISASSOC_LOW_ACK = 34,
+ EXCEEDED_TXOP = 35,
+ STA_LEAVING = 36,
+ END_TS_BA_DLS = 37,
+ UNKNOWN_TS_BA = 38,
+ TIMEOUT = 39,
+ PEERKEY_MISMATCH = 45,
+ AUTHORIZED_ACCESS_LIMIT_REACHED = 46,
+ EXTERNAL_SERVICE_REQUIREMENTS = 47,
+ INVALID_FT_ACTION_FRAME_COUNT = 48,
+ INVALID_PMKID = 49,
+ INVALID_MDE = 50,
+ INVALID_FTE = 51,
+ MESH_PEERING_CANCELLED = 52,
+ MESH_MAX_PEERS = 53,
+ MESH_CONFIG_POLICY_VIOLATION = 54,
+ MESH_CLOSE_RCVD = 55,
+ MESH_MAX_RETRIES = 56,
+ MESH_CONFIRM_TIMEOUT = 57,
+ MESH_INVALID_GTK = 58,
+ MESH_INCONSISTENT_PARAMS = 59,
+ MESH_INVALID_SECURITY_CAP = 60,
+ MESH_PATH_ERROR_NO_PROXY_INFO = 61,
+ MESH_PATH_ERROR_NO_FORWARDING_INFO = 62,
+ MESH_PATH_ERROR_DEST_UNREACHABLE = 63,
+ MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64,
+ MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65,
+ MESH_CHANNEL_SWITCH_UNSPECIFIED = 66,
+}
diff --git a/wifi/common/aidl/android/hardware/wifi/common/DeauthenticationReasonCode.aidl b/wifi/common/aidl/android/hardware/wifi/common/DeauthenticationReasonCode.aidl
new file mode 100644
index 0000000..95eb31d
--- /dev/null
+++ b/wifi/common/aidl/android/hardware/wifi/common/DeauthenticationReasonCode.aidl
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2024 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.common;
+
+/**
+ * Reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
+ *
+ * Note: HOSTAPD_NO_REASON is the default return from hostapd, even though it
+ * does not appear in the IEEE spec.
+ */
+@VintfStability
+@Backing(type="int")
+enum DeauthenticationReasonCode {
+ HOSTAPD_NO_REASON = 0,
+ UNSPECIFIED = 1,
+ PREV_AUTH_NOT_VALID = 2,
+ DEAUTH_LEAVING = 3,
+ DISASSOC_DUE_TO_INACTIVITY = 4,
+ DISASSOC_AP_BUSY = 5,
+ CLASS2_FRAME_FROM_NONAUTH_STA = 6,
+ CLASS3_FRAME_FROM_NONASSOC_STA = 7,
+ DISASSOC_STA_HAS_LEFT = 8,
+ STA_REQ_ASSOC_WITHOUT_AUTH = 9,
+ PWR_CAPABILITY_NOT_VALID = 10,
+ SUPPORTED_CHANNEL_NOT_VALID = 11,
+ BSS_TRANSITION_DISASSOC = 12,
+ INVALID_IE = 13,
+ MICHAEL_MIC_FAILURE = 14,
+ FOURWAY_HANDSHAKE_TIMEOUT = 15,
+ GROUP_KEY_UPDATE_TIMEOUT = 16,
+ IE_IN_4WAY_DIFFERS = 17,
+ GROUP_CIPHER_NOT_VALID = 18,
+ PAIRWISE_CIPHER_NOT_VALID = 19,
+ AKMP_NOT_VALID = 20,
+ UNSUPPORTED_RSN_IE_VERSION = 21,
+ INVALID_RSN_IE_CAPAB = 22,
+ IEEE_802_1X_AUTH_FAILED = 23,
+ CIPHER_SUITE_REJECTED = 24,
+ TDLS_TEARDOWN_UNREACHABLE = 25,
+ TDLS_TEARDOWN_UNSPECIFIED = 26,
+ SSP_REQUESTED_DISASSOC = 27,
+ NO_SSP_ROAMING_AGREEMENT = 28,
+ BAD_CIPHER_OR_AKM = 29,
+ NOT_AUTHORIZED_THIS_LOCATION = 30,
+ SERVICE_CHANGE_PRECLUDES_TS = 31,
+ UNSPECIFIED_QOS_REASON = 32,
+ NOT_ENOUGH_BANDWIDTH = 33,
+ DISASSOC_LOW_ACK = 34,
+ EXCEEDED_TXOP = 35,
+ STA_LEAVING = 36,
+ END_TS_BA_DLS = 37,
+ UNKNOWN_TS_BA = 38,
+ TIMEOUT = 39,
+ PEERKEY_MISMATCH = 45,
+ AUTHORIZED_ACCESS_LIMIT_REACHED = 46,
+ EXTERNAL_SERVICE_REQUIREMENTS = 47,
+ INVALID_FT_ACTION_FRAME_COUNT = 48,
+ INVALID_PMKID = 49,
+ INVALID_MDE = 50,
+ INVALID_FTE = 51,
+ MESH_PEERING_CANCELLED = 52,
+ MESH_MAX_PEERS = 53,
+ MESH_CONFIG_POLICY_VIOLATION = 54,
+ MESH_CLOSE_RCVD = 55,
+ MESH_MAX_RETRIES = 56,
+ MESH_CONFIRM_TIMEOUT = 57,
+ MESH_INVALID_GTK = 58,
+ MESH_INCONSISTENT_PARAMS = 59,
+ MESH_INVALID_SECURITY_CAP = 60,
+ MESH_PATH_ERROR_NO_PROXY_INFO = 61,
+ MESH_PATH_ERROR_NO_FORWARDING_INFO = 62,
+ MESH_PATH_ERROR_DEST_UNREACHABLE = 63,
+ MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64,
+ MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65,
+ MESH_CHANNEL_SWITCH_UNSPECIFIED = 66,
+}
diff --git a/wifi/hostapd/aidl/Android.bp b/wifi/hostapd/aidl/Android.bp
index 88f4ef2..e580573 100644
--- a/wifi/hostapd/aidl/Android.bp
+++ b/wifi/hostapd/aidl/Android.bp
@@ -29,7 +29,7 @@
"android/hardware/wifi/hostapd/*.aidl",
],
imports: [
- "android.hardware.wifi.common-V1",
+ "android.hardware.wifi.common-V2",
],
stability: "vintf",
backend: {
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ClientInfo.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ClientInfo.aidl
index c4d62b6..c4db789 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ClientInfo.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ClientInfo.aidl
@@ -38,4 +38,5 @@
String apIfaceInstance;
byte[] clientAddress;
boolean isConnected;
+ android.hardware.wifi.common.DeauthenticationReasonCode disconnectReasonCode;
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ClientInfo.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ClientInfo.aidl
index 7bed658..a7ca1ec 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ClientInfo.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ClientInfo.aidl
@@ -16,6 +16,8 @@
package android.hardware.wifi.hostapd;
+import android.hardware.wifi.common.DeauthenticationReasonCode;
+
/**
* Parameters to control the channel selection for the interface.
*/
@@ -42,4 +44,9 @@
* True when client connected, false when client disconnected.
*/
boolean isConnected;
+
+ /**
+ * Reason for client disconnect from soft ap.
+ */
+ DeauthenticationReasonCode disconnectReasonCode;
}
diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp
index b1c9c5d..de31e14 100644
--- a/wifi/hostapd/aidl/vts/functional/Android.bp
+++ b/wifi/hostapd/aidl/vts/functional/Android.bp
@@ -37,7 +37,7 @@
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
"android.hardware.wifi@1.6",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp
index 8d16cb7..1fbe8e9 100644
--- a/wifi/supplicant/aidl/Android.bp
+++ b/wifi/supplicant/aidl/Android.bp
@@ -29,7 +29,7 @@
"android/hardware/wifi/supplicant/*.aidl",
],
imports: [
- "android.hardware.wifi.common-V1",
+ "android.hardware.wifi.common-V2",
],
stability: "vintf",
backend: {
diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp
index 8bfe805..f94eb46 100644
--- a/wifi/supplicant/aidl/vts/functional/Android.bp
+++ b/wifi/supplicant/aidl/vts/functional/Android.bp
@@ -43,7 +43,7 @@
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V4-ndk",
@@ -52,7 +52,7 @@
"VtsHalWifiV1_0TargetTestUtil",
"VtsHalWifiV1_5TargetTestUtil",
"VtsHalWifiSupplicantV1_0TargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"VtsHalWifiTargetTestUtil",
],
@@ -81,7 +81,7 @@
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V4-ndk",
@@ -90,7 +90,7 @@
"VtsHalWifiV1_0TargetTestUtil",
"VtsHalWifiV1_5TargetTestUtil",
"VtsHalWifiSupplicantV1_0TargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"VtsHalWifiTargetTestUtil",
],
@@ -119,7 +119,7 @@
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V4-ndk",
@@ -128,7 +128,7 @@
"VtsHalWifiV1_0TargetTestUtil",
"VtsHalWifiV1_5TargetTestUtil",
"VtsHalWifiSupplicantV1_0TargetTestUtil",
- "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi.common-V2-ndk",
"android.hardware.wifi-V3-ndk",
"VtsHalWifiTargetTestUtil",
],