From 338dbe004627ed7fa34dab313a467c63daccea61 Mon Sep 17 00:00:00 2001 From: Vinay Gannevaram Date: Fri, 12 Jan 2024 16:32:04 +0530 Subject: [PATCH] Add p2p methods for add group, go Negotiation and Invitation Add addGroupWithParams, onGoNegotiationRequestWithParams and onInvitationReceivedWithParams to P2P Supplicant interface with vendor data as an optional parameter. Also deprecates the previous addGroup, onGoNegotiationRequest and onInvitationReceived. Bug: 296069900 Test: Build successfully Change-Id: I475df52fe087aff39728e2567583b48b7484a7ee --- .../wifi/supplicant/ISupplicantP2pIface.aidl | 4 ++ .../ISupplicantP2pIfaceCallback.aidl | 8 +++ .../P2pAddGroupConfigurationParams.aidl | 1 + .../supplicant/P2pCreateGroupOwnerInfo.aidl | 40 +++++++++++++ .../P2pGoNegotiationReqEventParams.aidl | 40 +++++++++++++ .../supplicant/P2pInvitationEventParams.aidl | 43 ++++++++++++++ .../wifi/supplicant/ISupplicantP2pIface.aidl | 23 +++++++- .../ISupplicantP2pIfaceCallback.aidl | 23 ++++++++ .../P2pAddGroupConfigurationParams.aidl | 7 +++ .../supplicant/P2pCreateGroupOwnerInfo.aidl | 42 ++++++++++++++ .../P2pGoNegotiationReqEventParams.aidl | 42 ++++++++++++++ .../supplicant/P2pInvitationEventParams.aidl | 56 +++++++++++++++++++ .../supplicant_p2p_iface_aidl_test.cpp | 10 ++++ 13 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 3babbe0c6b..0b068e001f 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -35,6 +35,9 @@ package android.hardware.wifi.supplicant; @VintfStability interface ISupplicantP2pIface { void addBonjourService(in byte[] query, in byte[] response); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use createGroupOwner. + */ void addGroup(in boolean persistent, in int persistentNetworkId); /** * @deprecated This method is deprecated from AIDL v3, newer HALs should use addGroupWithConfigurationParams. @@ -119,4 +122,5 @@ interface ISupplicantP2pIface { void findWithParams(in android.hardware.wifi.supplicant.P2pDiscoveryInfo discoveryInfo); void configureExtListenWithParams(in android.hardware.wifi.supplicant.P2pExtListenInfo extListenInfo); void addGroupWithConfigurationParams(in android.hardware.wifi.supplicant.P2pAddGroupConfigurationParams groupConfigurationParams); + void createGroupOwner(in android.hardware.wifi.supplicant.P2pCreateGroupOwnerInfo groupOwnerInfo); } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 4811565b44..65ad4c1407 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -41,11 +41,17 @@ interface ISupplicantP2pIfaceCallback { oneway void onDeviceLost(in byte[] p2pDeviceAddress); oneway void onFindStopped(); oneway void onGoNegotiationCompleted(in android.hardware.wifi.supplicant.P2pStatusCode status); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use onGoNegotiationRequestWithParams. + */ oneway void onGoNegotiationRequest(in byte[] srcAddress, in android.hardware.wifi.supplicant.WpsDevPasswordId passwordId); oneway void onGroupFormationFailure(in String failureReason); oneway void onGroupFormationSuccess(); oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner); oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid, in int frequency, in byte[] psk, in String passphrase, in byte[] goDeviceAddress, in boolean isPersistent); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use onInvitationReceivedWithParams. + */ oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, in int persistentNetworkId, in int operatingFrequency); oneway void onInvitationResult(in byte[] bssid, in android.hardware.wifi.supplicant.P2pStatusCode status); /** @@ -72,4 +78,6 @@ interface ISupplicantP2pIfaceCallback { oneway void onPeerClientDisconnected(in android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams); oneway void onProvisionDiscoveryCompletedEvent(in android.hardware.wifi.supplicant.P2pProvisionDiscoveryCompletedEventParams provisionDiscoveryCompletedEventParams); oneway void onDeviceFoundWithParams(in android.hardware.wifi.supplicant.P2pDeviceFoundEventParams deviceFoundEventParams); + oneway void onGoNegotiationRequestWithParams(in android.hardware.wifi.supplicant.P2pGoNegotiationReqEventParams params); + oneway void onInvitationReceivedWithParams(in android.hardware.wifi.supplicant.P2pInvitationEventParams params); } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl index 8e6c5a05e5..ff73f84f24 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl @@ -41,4 +41,5 @@ parcelable P2pAddGroupConfigurationParams { byte[6] goInterfaceAddress; boolean joinExistingGroup; int keyMgmtMask; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl new file mode 100644 index 0000000000..4451fb55ef --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl @@ -0,0 +1,40 @@ +/* + * 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 -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; +@VintfStability +parcelable P2pCreateGroupOwnerInfo { + boolean persistent; + int persistentNetworkId; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl new file mode 100644 index 0000000000..ba10b3ee64 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl @@ -0,0 +1,40 @@ +/* + * 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 -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; +@VintfStability +parcelable P2pGoNegotiationReqEventParams { + byte[6] srcAddress; + android.hardware.wifi.supplicant.WpsDevPasswordId passwordId; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl new file mode 100644 index 0000000000..541ee4f93d --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl @@ -0,0 +1,43 @@ +/* + * 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 -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; +@VintfStability +parcelable P2pInvitationEventParams { + byte[6] srcAddress; + byte[6] goDeviceAddress; + byte[6] bssid; + int persistentNetworkId; + int operatingFrequencyMHz; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 96239097ea..12307935ac 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -24,6 +24,7 @@ import android.hardware.wifi.supplicant.IfaceType; import android.hardware.wifi.supplicant.MiracastMode; import android.hardware.wifi.supplicant.P2pAddGroupConfigurationParams; import android.hardware.wifi.supplicant.P2pConnectInfo; +import android.hardware.wifi.supplicant.P2pCreateGroupOwnerInfo; import android.hardware.wifi.supplicant.P2pDiscoveryInfo; import android.hardware.wifi.supplicant.P2pExtListenInfo; import android.hardware.wifi.supplicant.P2pFrameTypeMask; @@ -53,6 +54,9 @@ interface ISupplicantP2pIface { * negotiation with a specific peer). This is also known as autonomous * group owner. Optional |persistentNetworkId| may be used to specify * restart of a persistent group. + *

+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * createGroupOwner. * * @param persistent Used to request a persistent group to be formed. * @param persistentNetworkId Used to specify the restart of a persistent @@ -909,8 +913,11 @@ interface ISupplicantP2pIface { void configureExtListenWithParams(in P2pExtListenInfo extListenInfo); /** - * Set up a P2P group owner or join a group as a group client - * with the specified configuration. + * Set up a P2P group owner or join a group as a group client with the + * specified configuration. The group configurations required to establish + * a connection(SSID, password, channel, etc) are shared out of band. + * So the connection process doesn't require a P2P provision discovery or + * invitation message exchange. * * @param groupConfigurationParams Parameters associated with this add group operation. * @throws ServiceSpecificException with one of the following values: @@ -919,4 +926,16 @@ interface ISupplicantP2pIface { */ void addGroupWithConfigurationParams( in P2pAddGroupConfigurationParams groupConfigurationParams); + + /** + * Set up a P2P group owner on this device. This is also known as autonomous + * group owner. The connection process requires P2P provision discovery + * message or invitation message exchange. + * + * @param groupOwnerInfo Parameters associated with this create group owner operation. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + */ + void createGroupOwner(in P2pCreateGroupOwnerInfo groupOwnerInfo); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index b9273a83ea..44a54652b2 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -17,8 +17,10 @@ package android.hardware.wifi.supplicant; import android.hardware.wifi.supplicant.P2pDeviceFoundEventParams; +import android.hardware.wifi.supplicant.P2pGoNegotiationReqEventParams; import android.hardware.wifi.supplicant.P2pGroupCapabilityMask; import android.hardware.wifi.supplicant.P2pGroupStartedEventParams; +import android.hardware.wifi.supplicant.P2pInvitationEventParams; import android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams; import android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams; import android.hardware.wifi.supplicant.P2pProvDiscStatusCode; @@ -88,6 +90,10 @@ oneway interface ISupplicantP2pIfaceCallback { * @param srcAddress MAC address of the device that initiated the GO * negotiation request. * @param passwordId Type of password. + * + *

+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * onGoNegotiationRequestWithParams. */ void onGoNegotiationRequest(in byte[] srcAddress, in WpsDevPasswordId passwordId); @@ -135,6 +141,9 @@ oneway interface ISupplicantP2pIfaceCallback { * @param bssid Bssid of the group. * @param persistentNetworkId Persistent network Id of the group. * @param operatingFrequency Frequency on which the invitation was received. + *

+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * onInvitationReceivedWithParams. */ void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, in int persistentNetworkId, in int operatingFrequency); @@ -302,4 +311,18 @@ oneway interface ISupplicantP2pIfaceCallback { * @param deviceFoundEventParams Parameters associated with the device found event. */ void onDeviceFoundWithParams(in P2pDeviceFoundEventParams deviceFoundEventParams); + + /** + * Used to indicate the reception of a P2P Group Owner negotiation request. + * + * @param params Parameters associated with the GO negotiation request event. + */ + void onGoNegotiationRequestWithParams(in P2pGoNegotiationReqEventParams params); + + /** + * Used to indicate the reception of a P2P invitation. + * + * @param params Parameters associated with the invitation request event. + */ + void onInvitationReceivedWithParams(in P2pInvitationEventParams params); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl index 1374f41ba6..15f2733b32 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.common.OuiKeyedData; import android.hardware.wifi.supplicant.KeyMgmtMask; /** @@ -65,4 +66,10 @@ parcelable P2pAddGroupConfigurationParams { * */ int keyMgmtMask; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl new file mode 100644 index 0000000000..51e6ed9c5c --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl @@ -0,0 +1,42 @@ +/* + * 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.supplicant; + +import android.hardware.wifi.common.OuiKeyedData; + +/** + * Parameters used for |ISupplicantP2pIface.createGroupOwner| + */ +@VintfStability +parcelable P2pCreateGroupOwnerInfo { + /** + * Used to request a persistent group to be formed. + */ + boolean persistent; + + /** + * Optional parameter. Used to specify the restart of a persistent + * group. Set to UINT32_MAX for a non-persistent group. + */ + int persistentNetworkId; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl new file mode 100644 index 0000000000..3480734c58 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl @@ -0,0 +1,42 @@ +/* + * 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.supplicant; + +import android.hardware.wifi.common.OuiKeyedData; +import android.hardware.wifi.supplicant.WpsDevPasswordId; + +/** + * Parameters used for |ISupplicantP2pIfaceCallback.onGoNegotiationRequestWithParams| + */ +@VintfStability +parcelable P2pGoNegotiationReqEventParams { + /** + * MAC address of the device that sent the Go negotiation request. + */ + byte[6] srcAddress; + + /** + * Type of password. + */ + WpsDevPasswordId passwordId; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl new file mode 100644 index 0000000000..4295c40f3e --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl @@ -0,0 +1,56 @@ +/* + * 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.supplicant; + +import android.hardware.wifi.common.OuiKeyedData; + +/** + * Parameters used for |ISupplicantP2pIfaceCallback.onInvitationReceivedWithParams| + */ +@VintfStability +parcelable P2pInvitationEventParams { + /** + * MAC address of the device that sent the invitation. + */ + byte[6] srcAddress; + + /** + * P2P device MAC Address of the group owner. + */ + byte[6] goDeviceAddress; + + /** + * BSSID of the group. + */ + byte[6] bssid; + + /** + * Persistent network ID of the group. + */ + int persistentNetworkId; + + /** + * Frequency on which the invitation was received. + */ + int operatingFrequencyMHz; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp index 3f96414a0e..2d6823f207 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp @@ -37,8 +37,10 @@ using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface; using aidl::android::hardware::wifi::supplicant::MiracastMode; using aidl::android::hardware::wifi::supplicant::P2pDeviceFoundEventParams; using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask; +using aidl::android::hardware::wifi::supplicant::P2pGoNegotiationReqEventParams; using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask; using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams; +using aidl::android::hardware::wifi::supplicant::P2pInvitationEventParams; using aidl::android::hardware::wifi::supplicant::P2pPeerClientDisconnectedEventParams; using aidl::android::hardware::wifi::supplicant::P2pPeerClientJoinedEventParams; using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode; @@ -204,6 +206,14 @@ class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback { const P2pDeviceFoundEventParams& /* deviceFoundEventParams */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onGoNegotiationRequestWithParams( + const P2pGoNegotiationReqEventParams& /* goNegotiationReqEventParams */) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onInvitationReceivedWithParams( + const P2pInvitationEventParams& /* invitationEventParams */) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantP2pIfaceAidlTest : public testing::TestWithParam {