Merge "wifi: Support for P2P Compatibility Mode" into main

This commit is contained in:
Sunil Ravi
2024-09-30 17:45:54 +00:00
committed by Android (Google) Code Review
7 changed files with 47 additions and 0 deletions

View File

@@ -123,4 +123,7 @@ interface ISupplicantP2pIface {
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);
long getFeatureSet();
const long P2P_FEATURE_V2 = (1 << 0) /* 1 */;
const long P2P_FEATURE_PCC_MODE_WPA3_COMPATIBILITY = (1 << 1) /* 2 */;
}

View File

@@ -46,4 +46,5 @@ parcelable P2pGroupStartedEventParams {
boolean isP2pClientEapolIpAddressInfoPresent;
android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo p2pClientIpInfo;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
int keyMgmtMask;
}

View File

@@ -39,4 +39,5 @@ parcelable P2pPeerClientJoinedEventParams {
byte[6] clientDeviceAddress;
int clientIpAddress;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
int keyMgmtMask;
}

View File

@@ -38,6 +38,15 @@ import android.hardware.wifi.supplicant.WpsProvisionMethod;
*/
@VintfStability
interface ISupplicantP2pIface {
/**
* P2P features exposed by wpa_supplicant/chip.
*/
/* Support for P2P2 (Wi-Fi Alliance P2P v2.0) */
const long P2P_FEATURE_V2 = 1 << 0;
/* Support for WPA3 Compatibility Mode in PCC Mode */
const long P2P_FEATURE_PCC_MODE_WPA3_COMPATIBILITY = 1 << 1;
/**
* This command can be used to add a bonjour service.
*
@@ -938,4 +947,14 @@ interface ISupplicantP2pIface {
* |SupplicantStatusCode.FAILURE_IFACE_INVALID|
*/
void createGroupOwner(in P2pCreateGroupOwnerInfo groupOwnerInfo);
/**
* Get the features supported by P2P interface.
*
* @return The bitmask of ISupplicantP2pIface.P2P_FEATURE_* values.
*
* @throws ServiceSpecificException with one of the following values:
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
long getFeatureSet();
}

View File

@@ -70,4 +70,10 @@ parcelable P2pGroupStartedEventParams {
* that no vendor data is provided.
*/
@nullable OuiKeyedData[] vendorData;
/**
* Authentication key management protocol used to secure the group.
* This is a bitmask of |KeyMgmtMask| values.
*/
int keyMgmtMask;
}

View File

@@ -47,4 +47,10 @@ parcelable P2pPeerClientJoinedEventParams {
* that no vendor data is provided.
*/
@nullable OuiKeyedData[] vendorData;
/**
* Authentication key management protocol used in connection.
* This is a bitmask of |KeyMgmtMask| values.
*/
int keyMgmtMask;
}

View File

@@ -814,6 +814,17 @@ TEST_P(SupplicantP2pIfaceAidlTest, SetVendorElements) {
LOG(INFO) << "SupplicantP2pIfaceAidlTest::SetVendorElements end";
}
/*
* getFeatureSet
*/
TEST_P(SupplicantP2pIfaceAidlTest, getFeatureSet) {
if (interface_version_ < 4) {
GTEST_SKIP() << "getFeatureSet is available as of Supplicant V4";
}
int64_t featureSet;
EXPECT_TRUE(p2p_iface_->getFeatureSet(&featureSet).isOk());
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantP2pIfaceAidlTest);
INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantP2pIfaceAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(