Merge "Add p2p methods for add group, go Negotiation and Invitation" into main

This commit is contained in:
Sunil Ravi
2024-01-13 04:44:48 +00:00
committed by Android (Google) Code Review
13 changed files with 337 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -41,4 +41,5 @@ parcelable P2pAddGroupConfigurationParams {
byte[6] goInterfaceAddress;
boolean joinExistingGroup;
int keyMgmtMask;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}

View File

@@ -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 <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;
@VintfStability
parcelable P2pCreateGroupOwnerInfo {
boolean persistent;
int persistentNetworkId;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}

View File

@@ -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 <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;
@VintfStability
parcelable P2pGoNegotiationReqEventParams {
byte[6] srcAddress;
android.hardware.wifi.supplicant.WpsDevPasswordId passwordId;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}

View File

@@ -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 <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;
@VintfStability
parcelable P2pInvitationEventParams {
byte[6] srcAddress;
byte[6] goDeviceAddress;
byte[6] bssid;
int persistentNetworkId;
int operatingFrequencyMHz;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}

View File

@@ -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.
* <p>
* @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);
}

View File

@@ -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.
*
* <p>
* @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.
* <p>
* @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);
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<std::string> {