Modify based on the vendor feedback
- Add end pairing request method
- Handle bootstrapping comeback event
- Add cipher type in the pairing request
Bug: 265075699
Test: cts sinlgeDeviceTest
Change-Id: Ic744b0a1098e258b68caba5a9a33b2bef3226b40
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl
index b20f505..0e2f90f 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIface.aidl
@@ -56,6 +56,7 @@
void respondToPairingIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToPairingIndicationRequest msg);
void initiateBootstrappingRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingRequest msg);
void respondToBootstrappingIndicationRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingResponse msg);
+ void terminatePairingRequest(in char cmdId, in int pairingInstanceId);
const int MIN_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 8;
const int MAX_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 63;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index dfb28aa..ed78d35 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -70,4 +70,5 @@
oneway void eventBootstrappingConfirm(in android.hardware.wifi.NanBootstrappingConfirmInd event);
oneway void notifyInitiateBootstrappingResponse(in char id, in android.hardware.wifi.NanStatus status, in int bootstrappingInstanceId);
oneway void notifyRespondToBootstrappingIndicationResponse(in char id, in android.hardware.wifi.NanStatus status);
+ oneway void notifyTerminatePairingResponse(in char id, in android.hardware.wifi.NanStatus status);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
index 9a4c050..4302735 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
@@ -64,20 +64,20 @@
void setDtimMultiplier(in int multiplier);
@Backing(type="int") @VintfStability
enum StaIfaceCapabilityMask {
- APF = (1 << 0),
- BACKGROUND_SCAN = (1 << 1),
- LINK_LAYER_STATS = (1 << 2),
- RSSI_MONITOR = (1 << 3),
- CONTROL_ROAMING = (1 << 4),
- PROBE_IE_ALLOWLIST = (1 << 5),
- SCAN_RAND = (1 << 6),
- STA_5G = (1 << 7),
- HOTSPOT = (1 << 8),
- PNO = (1 << 9),
- TDLS = (1 << 10),
- TDLS_OFFCHANNEL = (1 << 11),
- ND_OFFLOAD = (1 << 12),
- KEEP_ALIVE = (1 << 13),
- DEBUG_PACKET_FATE = (1 << 14),
+ APF = (1 << 0) /* 1 */,
+ BACKGROUND_SCAN = (1 << 1) /* 2 */,
+ LINK_LAYER_STATS = (1 << 2) /* 4 */,
+ RSSI_MONITOR = (1 << 3) /* 8 */,
+ CONTROL_ROAMING = (1 << 4) /* 16 */,
+ PROBE_IE_ALLOWLIST = (1 << 5) /* 32 */,
+ SCAN_RAND = (1 << 6) /* 64 */,
+ STA_5G = (1 << 7) /* 128 */,
+ HOTSPOT = (1 << 8) /* 256 */,
+ PNO = (1 << 9) /* 512 */,
+ TDLS = (1 << 10) /* 1024 */,
+ TDLS_OFFCHANNEL = (1 << 11) /* 2048 */,
+ ND_OFFLOAD = (1 << 12) /* 4096 */,
+ KEEP_ALIVE = (1 << 13) /* 8192 */,
+ DEBUG_PACKET_FATE = (1 << 14) /* 16384 */,
}
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
index 65e85af..5ab8dcd 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
@@ -35,6 +35,8 @@
@VintfStability
parcelable NanBootstrappingConfirmInd {
int bootstrappingInstanceId;
- boolean acceptRequest;
+ android.hardware.wifi.NanBootstrappingResponseCode responseCode;
android.hardware.wifi.NanStatus reasonCode;
+ int comeBackDelay;
+ byte[] cookie;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl
index 1504534..6ff62b2 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingMethod.aidl
@@ -34,15 +34,15 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum NanBootstrappingMethod {
- BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0),
- BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1),
- BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2),
- BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3),
- BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4),
- BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5),
- BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6),
- BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7),
- BOOTSTRAPPING_NFC_READER_MASK = (1 << 8),
- BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14),
- BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15),
+ BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0) /* 1 */,
+ BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1) /* 2 */,
+ BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2) /* 4 */,
+ BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3) /* 8 */,
+ BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4) /* 16 */,
+ BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5) /* 32 */,
+ BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6) /* 64 */,
+ BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7) /* 128 */,
+ BOOTSTRAPPING_NFC_READER_MASK = (1 << 8) /* 256 */,
+ BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14) /* 16384 */,
+ BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15) /* 32768 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl
index 2be8924..dd0a5ed 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl
@@ -37,4 +37,5 @@
int peerId;
byte[6] peerDiscMacAddr;
android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod;
+ byte[] cookie;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponseCode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponseCode.aidl
new file mode 100644
index 0000000..a3e9e4d
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponseCode.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 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;
+@Backing(type="int") @VintfStability
+enum NanBootstrappingResponseCode {
+ NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0,
+ NAN_BOOTSTRAPPING_REQUEST_REJECT,
+ NAN_BOOTSTRAPPING_REQUEST_COMEBACK,
+}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
index e98122d..d1149c4 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCipherSuiteType.aidl
@@ -35,8 +35,10 @@
@Backing(type="int") @VintfStability
enum NanCipherSuiteType {
NONE = 0,
- SHARED_KEY_128_MASK = (1 << 0),
- SHARED_KEY_256_MASK = (1 << 1),
- PUBLIC_KEY_128_MASK = (1 << 2),
- PUBLIC_KEY_256_MASK = (1 << 3),
+ SHARED_KEY_128_MASK = (1 << 0) /* 1 */,
+ SHARED_KEY_256_MASK = (1 << 1) /* 2 */,
+ PUBLIC_KEY_2WDH_128_MASK = (1 << 2) /* 4 */,
+ PUBLIC_KEY_2WDH_256_MASK = (1 << 3) /* 8 */,
+ PUBLIC_KEY_PASN_128_MASK = (1 << 4) /* 16 */,
+ PUBLIC_KEY_PASN_256_MASK = (1 << 5) /* 32 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl
index 45af25d..1a6a13c 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingSecurityConfig.aidl
@@ -38,4 +38,5 @@
byte[32] pmk;
byte[] passphrase;
android.hardware.wifi.NanPairingAkm akm;
+ android.hardware.wifi.NanCipherSuiteType cipherType;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl
index 4d33c10..cf72dce 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRangingIndication.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum NanRangingIndication {
- CONTINUOUS_INDICATION_MASK = (1 << 0),
- INGRESS_MET_MASK = (1 << 1),
- EGRESS_MET_MASK = (1 << 2),
+ CONTINUOUS_INDICATION_MASK = (1 << 0) /* 1 */,
+ INGRESS_MET_MASK = (1 << 1) /* 2 */,
+ EGRESS_MET_MASK = (1 << 2) /* 4 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl
index c558716..508e920 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NpkSecurityAssociation.aidl
@@ -38,4 +38,5 @@
byte[16] localNanIdentityKey;
byte[32] npk;
android.hardware.wifi.NanPairingAkm akm;
+ android.hardware.wifi.NanCipherSuiteType cipherType;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl
index 93e337e..249d876 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaBackgroundScanBucketEventReportSchemeMask.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum StaBackgroundScanBucketEventReportSchemeMask {
- EACH_SCAN = (1 << 0),
- FULL_RESULTS = (1 << 1),
- NO_BATCH = (1 << 2),
+ EACH_SCAN = (1 << 0) /* 1 */,
+ FULL_RESULTS = (1 << 1) /* 2 */,
+ NO_BATCH = (1 << 2) /* 4 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl
index fbd2d75..0ca4b4b 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaScanDataFlagMask.aidl
@@ -34,5 +34,5 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum StaScanDataFlagMask {
- INTERRUPTED = (1 << 0),
+ INTERRUPTED = (1 << 0) /* 1 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl
index 22327e5..e6ea642 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiChannelWidthInMhz.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum WifiChannelWidthInMhz {
- WIDTH_INVALID = (-1),
+ WIDTH_INVALID = (-1) /* -1 */,
WIDTH_20 = 0,
WIDTH_40 = 1,
WIDTH_80 = 2,
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl
index 9eac85d..9ababc3 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiDebugRingBufferFlags.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum WifiDebugRingBufferFlags {
- HAS_BINARY_ENTRIES = (1 << 0),
- HAS_ASCII_ENTRIES = (1 << 1),
- HAS_PER_PACKET_ENTRIES = (1 << 2),
+ HAS_BINARY_ENTRIES = (1 << 0) /* 1 */,
+ HAS_ASCII_ENTRIES = (1 << 1) /* 2 */,
+ HAS_PER_PACKET_ENTRIES = (1 << 2) /* 4 */,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl
index 2ac0c2d..557cef4 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/WifiIfaceMode.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum WifiIfaceMode {
- IFACE_MODE_STA = (1 << 0),
- IFACE_MODE_SOFTAP = (1 << 1),
- IFACE_MODE_IBSS = (1 << 2),
- IFACE_MODE_P2P_CLIENT = (1 << 3),
- IFACE_MODE_P2P_GO = (1 << 4),
- IFACE_MODE_NAN = (1 << 5),
- IFACE_MODE_MESH = (1 << 6),
- IFACE_MODE_TDLS = (1 << 7),
+ IFACE_MODE_STA = (1 << 0) /* 1 */,
+ IFACE_MODE_SOFTAP = (1 << 1) /* 2 */,
+ IFACE_MODE_IBSS = (1 << 2) /* 4 */,
+ IFACE_MODE_P2P_CLIENT = (1 << 3) /* 8 */,
+ IFACE_MODE_P2P_GO = (1 << 4) /* 16 */,
+ IFACE_MODE_NAN = (1 << 5) /* 32 */,
+ IFACE_MODE_MESH = (1 << 6) /* 64 */,
+ IFACE_MODE_TDLS = (1 << 7) /* 128 */,
}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
index 870c3d8..5f3ce6c 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIface.aidl
@@ -336,4 +336,16 @@
* |WifiStatusCode.ERROR_UNKNOWN|
*/
void respondToBootstrappingIndicationRequest(in char cmdId, in NanBootstrappingResponse msg);
+
+ /**
+ * Aware pairing termination request. Executed by either the Initiator or Responder.
+ * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTerminatePairingResponse|.
+ *
+ * @param cmdId Command Id to use for this invocation.
+ * @param pairingInstanceId Pairing instance ID to be terminated.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void terminatePairingRequest(in char cmdId, in int pairingInstanceId);
}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
index 3fd37a7..edca1d5 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiNanIfaceEventCallback.aidl
@@ -440,4 +440,18 @@
* |NanStatusCode.INVALID_NDP_ID|
*/
void notifyRespondToBootstrappingIndicationResponse(in char id, in NanStatus status);
+
+ /**
+ * Callback invoked in response to a terminate pairing request
+ * |IWifiNanIface.terminatePairingRequest|.
+ *
+ * @param id Command Id corresponding to the original request.
+ * @param status NanStatus of the operation. Possible status codes are:
+ * |NanStatusCode.SUCCESS|
+ * |NanStatusCode.INVALID_ARGS|
+ * |NanStatusCode.INTERNAL_FAILURE|
+ * |NanStatusCode.PROTOCOL_FAILURE|
+ * |NanStatusCode.INVALID_PAIRING_ID|
+ */
+ void notifyTerminatePairingResponse(in char id, in NanStatus status);
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
index 5a539ee..7d7a436 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingConfirmInd.aidl
@@ -17,6 +17,7 @@
package android.hardware.wifi;
import android.hardware.wifi.NanBootstrappingMethod;
+import android.hardware.wifi.NanBootstrappingResponseCode;
import android.hardware.wifi.NanStatus;
@VintfStability
@@ -30,10 +31,20 @@
/**
* Indicate whether the bootstrapping method negotiation accept or not
*/
- boolean acceptRequest;
+ NanBootstrappingResponseCode responseCode;
/**
* Failure reason if |acceptRequest| is false.
*/
NanStatus reasonCode;
+
+ /**
+ * The delay of bootstrapping in seconds for the follow up request.
+ */
+ int comeBackDelay;
+
+ /**
+ * Cookie received from the comeback response.
+ */
+ byte[] cookie;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
index d553245..5297b9f 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
@@ -37,4 +37,9 @@
* Bootstrapping method in the request, one of the |NanBootstrappingMethod|
*/
NanBootstrappingMethod requestBootstrappingMethod;
+
+ /**
+ * Cookie for the follow up request
+ */
+ byte[] cookie;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponseCode.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponseCode.aidl
new file mode 100644
index 0000000..17076bf
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponseCode.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2023 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;
+
+/**
+ * Response code from peer NAN Bootstrapping request
+ */
+@VintfStability
+@Backing(type="int")
+enum NanBootstrappingResponseCode {
+ NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0,
+ NAN_BOOTSTRAPPING_REQUEST_REJECT,
+ NAN_BOOTSTRAPPING_REQUEST_COMEBACK,
+}
diff --git a/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl b/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl
index 9e3d684..0d2fc99 100644
--- a/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanCipherSuiteType.aidl
@@ -17,7 +17,7 @@
package android.hardware.wifi;
/**
- * Cipher suite flags.
+ * Cipher suite flags. Wi-Fi Aware Specification 4.0 section 7.1.2
*/
@VintfStability
@Backing(type="int")
@@ -26,11 +26,19 @@
SHARED_KEY_128_MASK = 1 << 0,
SHARED_KEY_256_MASK = 1 << 1,
/**
- * NCS-PK-128
+ * NCS-PK-2WDH-128
*/
- PUBLIC_KEY_128_MASK = 1 << 2,
+ PUBLIC_KEY_2WDH_128_MASK = 1 << 2,
/**
- * NCS-PK-256
+ * NCS-PK-2WDH-256
*/
- PUBLIC_KEY_256_MASK = 1 << 3,
+ PUBLIC_KEY_2WDH_256_MASK = 1 << 3,
+ /**
+ * NCS-PK-PASN-128
+ */
+ PUBLIC_KEY_PASN_128_MASK = 1 << 4,
+ /**
+ * NCS-PK-PASN-256
+ */
+ PUBLIC_KEY_PASN_256_MASK = 1 << 5,
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl b/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl
index 273c07e..7384e1a 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingSecurityConfig.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi;
+import android.hardware.wifi.NanCipherSuiteType;
import android.hardware.wifi.NanPairingAkm;
import android.hardware.wifi.NanPairingSecurityType;
@@ -47,4 +48,9 @@
* The AKM for key exchange
*/
NanPairingAkm akm;
+ /**
+ * Cipher type for pairing. Need to be one of the |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK|
+ * or |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|
+ */
+ NanCipherSuiteType cipherType;
}
diff --git a/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl b/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl
index 42612c0..32e8409 100644
--- a/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl
+++ b/wifi/aidl/android/hardware/wifi/NpkSecurityAssociation.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi;
+import android.hardware.wifi.NanCipherSuiteType;
import android.hardware.wifi.NanPairingAkm;
/**
@@ -39,4 +40,9 @@
* The AKM is used for key exchange in this security sssociation
*/
NanPairingAkm akm;
+ /**
+ * Cipher type for pairing. Need to one of the |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK| or
+ * |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|
+ */
+ NanCipherSuiteType cipherType;
}
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 8463eac..2d745dc 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -1250,7 +1250,7 @@
LOG(FATAL);
}
-legacy_hal::Akm convertAidlAkmTypeToLegacy(NanPairingAkm type) {
+legacy_hal::NanAkm convertAidlAkmTypeToLegacy(NanPairingAkm type) {
switch (type) {
case NanPairingAkm::SAE:
return legacy_hal::SAE;
@@ -1260,7 +1260,7 @@
LOG(FATAL);
}
-NanPairingAkm convertLegacyAkmTypeToAidl(legacy_hal::Akm type) {
+NanPairingAkm convertLegacyAkmTypeToAidl(legacy_hal::NanAkm type) {
switch (type) {
case legacy_hal::SAE:
return NanPairingAkm::SAE;
@@ -1384,6 +1384,7 @@
aidl_npsa->npk = std::array<uint8_t, 32>();
std::copy(legacy_npsa.npk.pmk, legacy_npsa.npk.pmk + 32, std::begin(aidl_npsa->npk));
aidl_npsa->akm = convertLegacyAkmTypeToAidl(legacy_npsa.akm);
+ aidl_npsa->cipherType = (NanCipherSuiteType)legacy_npsa.cipher_type;
return true;
}
@@ -3070,6 +3071,7 @@
aidl_request.securityConfig.securityType == NanPairingSecurityType::OPPORTUNISTIC ? 1
: 0;
legacy_request->akm = convertAidlAkmTypeToLegacy(aidl_request.securityConfig.akm);
+ legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType;
if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PMK) {
legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
legacy_request->key_info.body.pmk_info.pmk_len = aidl_request.securityConfig.pmk.size();
@@ -3127,6 +3129,7 @@
aidl_request.securityConfig.securityType == NanPairingSecurityType::OPPORTUNISTIC ? 1
: 0;
legacy_request->akm = convertAidlAkmTypeToLegacy(aidl_request.securityConfig.akm);
+ legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType;
legacy_request->rsp_code =
aidl_request.acceptRequest ? NAN_PAIRING_REQUEST_ACCEPT : NAN_PAIRING_REQUEST_REJECT;
if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PMK) {
@@ -3178,6 +3181,9 @@
memcpy(legacy_request->peer_disc_mac_addr, aidl_request.peerDiscMacAddr.data(), 6);
legacy_request->request_bootstrapping_method =
convertAidlBootstrappingMethodToLegacy(aidl_request.requestBootstrappingMethod);
+ legacy_request->cookie_length = aidl_request.cookie.size();
+
+ memcpy(legacy_request->cookie, aidl_request.cookie.data(), legacy_request->cookie_length);
return true;
}
@@ -3272,8 +3278,11 @@
*aidl_ind = {};
aidl_ind->bootstrappingInstanceId = legacy_ind.bootstrapping_instance_id;
- aidl_ind->acceptRequest = legacy_ind.rsp_code == NAN_BOOTSTRAPPING_REQUEST_ACCEPT;
+ aidl_ind->responseCode = static_cast<NanBootstrappingResponseCode>(legacy_ind.rsp_code);
aidl_ind->reasonCode.status = convertLegacyNanStatusTypeToAidl(legacy_ind.reason_code);
+ aidl_ind->comeBackDelay = legacy_ind.come_back_delay;
+ aidl_ind->cookie =
+ std::vector<uint8_t>(legacy_ind.cookie, legacy_ind.cookie + legacy_ind.cookie_length);
return true;
}
diff --git a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
index 878c29b..fc58c3e 100644
--- a/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
+++ b/wifi/aidl/default/tests/wifi_nan_iface_unit_tests.cpp
@@ -136,6 +136,7 @@
ndk::ScopedAStatus(char16_t, const NanStatus&));
MOCK_METHOD2(notifySuspendResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
MOCK_METHOD2(notifyResumeResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
+ MOCK_METHOD2(notifyTerminatePairingResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
};
class WifiNanIfaceTest : public Test {
diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp
index 43a71cc..6436fb7 100644
--- a/wifi/aidl/default/wifi_legacy_hal.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal.cpp
@@ -1559,6 +1559,15 @@
return status;
}
+wifi_error WifiLegacyHal::nanPairingEnd(const std::string& iface_name, transaction_id id,
+ uint32_t pairingId) {
+ NanPairingEndRequest msg;
+ msg.pairing_instance_id = pairingId;
+ wifi_error status =
+ global_func_table_.wifi_nan_pairing_end(id, getIfaceHandle(iface_name), &msg);
+ return status;
+}
+
wifi_error WifiLegacyHal::nanSuspendRequest(const std::string& iface_name, transaction_id id,
const NanSuspendRequest& msg) {
NanSuspendRequest msg_internal(msg);
diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h
index a066ea6..468d8d7 100644
--- a/wifi/aidl/default/wifi_legacy_hal.h
+++ b/wifi/aidl/default/wifi_legacy_hal.h
@@ -36,7 +36,6 @@
namespace legacy_hal {
// Import all the types defined inside the legacy HAL header files into this
// namespace.
-using ::Akm;
using ::chre_nan_rtt_state;
using ::frame_info;
using ::frame_type;
@@ -68,6 +67,7 @@
using ::NAN_MATCH_ALG_MATCH_CONTINUOUS;
using ::NAN_MATCH_ALG_MATCH_NEVER;
using ::NAN_MATCH_ALG_MATCH_ONCE;
+using ::NAN_PAIRING_END;
using ::NAN_PAIRING_INITIATOR_RESPONSE;
using ::NAN_PAIRING_RESPONDER_RESPONSE;
using ::NAN_PAIRING_SETUP;
@@ -125,6 +125,7 @@
using ::NAN_TX_TYPE_BROADCAST;
using ::NAN_TX_TYPE_UNICAST;
using ::NAN_USE_SRF;
+using ::NanAkm;
using ::NanBeaconSdfPayloadInd;
using ::NanBootstrappingConfirmInd;
using ::NanBootstrappingIndicationResponse;
@@ -152,6 +153,7 @@
using ::NanMatchInd;
using ::NanPairingConfig;
using ::NanPairingConfirmInd;
+using ::NanPairingEndRequest;
using ::NanPairingIndicationResponse;
using ::NanPairingRequest;
using ::NanPairingRequestInd;
@@ -703,6 +705,7 @@
wifi_error nanBootstrappingIndicationResponse(const std::string& iface_name, transaction_id id,
const NanBootstrappingIndicationResponse& msg);
wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId);
+ wifi_error nanPairingEnd(const std::string& iface_name, transaction_id id, uint32_t pairingId);
wifi_error nanSuspendRequest(const std::string& iface_name, transaction_id id,
const NanSuspendRequest& msg);
wifi_error nanResumeRequest(const std::string& iface_name, transaction_id id,
diff --git a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
index fa87772..42743df 100644
--- a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
@@ -131,6 +131,7 @@
populateStubFor(&hal_fn->wifi_nan_bootstrapping_request);
populateStubFor(&hal_fn->wifi_nan_bootstrapping_indication_response);
populateStubFor(&hal_fn->wifi_nan_data_end);
+ populateStubFor(&hal_fn->wifi_nan_pairing_end);
populateStubFor(&hal_fn->wifi_get_packet_filter_capabilities);
populateStubFor(&hal_fn->wifi_set_packet_filter);
populateStubFor(&hal_fn->wifi_read_packet_filter);
diff --git a/wifi/aidl/default/wifi_nan_iface.cpp b/wifi/aidl/default/wifi_nan_iface.cpp
index 7138e41..0d53803 100644
--- a/wifi/aidl/default/wifi_nan_iface.cpp
+++ b/wifi/aidl/default/wifi_nan_iface.cpp
@@ -224,6 +224,14 @@
}
break;
}
+ case legacy_hal::NAN_PAIRING_END: {
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->notifyTerminatePairingResponse(id, nanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ break;
+ }
case legacy_hal::NAN_BOOTSTRAPPING_INITIATOR_RESPONSE: {
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
if (!callback->notifyInitiateBootstrappingResponse(
@@ -743,6 +751,13 @@
in_msg);
}
+ndk::ScopedAStatus WifiNanIface::terminatePairingRequest(char16_t in_cmdId,
+ int32_t in_ndpInstanceId) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::terminatePairingRequestInternal, in_cmdId,
+ in_ndpInstanceId);
+}
+
ndk::ScopedAStatus WifiNanIface::initiateBootstrappingRequest(
char16_t in_cmdId, const NanBootstrappingRequest& in_msg) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
@@ -919,6 +934,12 @@
legacy_hal_.lock()->nanPairingIndicationResponse(ifname_, cmd_id, legacy_msg);
return createWifiStatusFromLegacyError(legacy_status);
}
+ndk::ScopedAStatus WifiNanIface::terminatePairingRequestInternal(char16_t cmd_id,
+ int32_t ndpInstanceId) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanPairingEnd(ifname_, cmd_id, ndpInstanceId);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
ndk::ScopedAStatus WifiNanIface::initiateBootstrappingRequestInternal(
char16_t cmd_id, const NanBootstrappingRequest& msg) {
legacy_hal::NanBootstrappingRequest legacy_msg;
diff --git a/wifi/aidl/default/wifi_nan_iface.h b/wifi/aidl/default/wifi_nan_iface.h
index 3b93c28..a49ae8c 100644
--- a/wifi/aidl/default/wifi_nan_iface.h
+++ b/wifi/aidl/default/wifi_nan_iface.h
@@ -82,6 +82,7 @@
const NanPairingRequest& in_msg) override;
ndk::ScopedAStatus respondToPairingIndicationRequest(
char16_t in_cmdId, const NanRespondToPairingIndicationRequest& in_msg) override;
+ ndk::ScopedAStatus terminatePairingRequest(char16_t in_cmdId, int32_t in_pairingId) override;
ndk::ScopedAStatus initiateBootstrappingRequest(char16_t in_cmdId,
const NanBootstrappingRequest& in_msg) override;
ndk::ScopedAStatus respondToBootstrappingIndicationRequest(
@@ -125,6 +126,7 @@
const NanPairingRequest& msg);
ndk::ScopedAStatus respondToPairingIndicationRequestInternal(
char16_t cmd_id, const NanRespondToPairingIndicationRequest& msg);
+ ndk::ScopedAStatus terminatePairingRequestInternal(char16_t cmd_id, int32_t pairingId);
ndk::ScopedAStatus initiateBootstrappingRequestInternal(char16_t cmd_id,
const NanBootstrappingRequest& msg);
ndk::ScopedAStatus respondToBootstrappingIndicationRequestInternal(
diff --git a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
index ae5040f..d2c3235 100644
--- a/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_nan_iface_aidl_test.cpp
@@ -106,6 +106,7 @@
NOTIFY_RESPOND_TO_BOOTSTRAPPING_INDICATION_RESPONSE,
NOTIFY_SUSPEND_RESPONSE,
NOTIFY_RESUME_RESPONSE,
+ NOTIFY_TERMINATE_PAIRING_RESPONSE,
EVENT_CLUSTER_EVENT,
EVENT_DISABLED,
@@ -416,6 +417,14 @@
parent_.notify();
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus notifyTerminatePairingResponse(char16_t id,
+ const NanStatus& status) override {
+ parent_.callback_type_ = NOTIFY_TERMINATE_PAIRING_RESPONSE;
+ parent_.id_ = id;
+ parent_.status_ = status;
+ parent_.notify();
+ return ndk::ScopedAStatus::ok();
+ }
private:
WifiNanIfaceAidlTest& parent_;