Add HAL API to pass GO interface MAC address in GC from supplicant

The GO interface MAC address would be used to calculate the link-local
IPv6 address of the GO in the GC side.

Test: m
Bug: 233912758
Change-Id: I8cdae90a2703d446dafbdfba8f99c191b751f552
This commit is contained in:
Biswarup Pal
2022-11-05 14:13:09 +00:00
parent df17bd36e6
commit 76514ebd34
6 changed files with 113 additions and 3 deletions

View File

@@ -52,4 +52,5 @@ interface ISupplicantP2pIfaceCallback {
oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);
oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes);
oneway void onGroupStartedWithParams(in android.hardware.wifi.supplicant.P2pGroupStartedEventParams groupStartedEventParams);
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2022 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 P2pGroupStartedEventParams {
String groupInterfaceName;
boolean isGroupOwner;
byte[] ssid;
int frequencyMHz;
byte[] psk;
String passphrase;
boolean isPersistent;
byte[] goDeviceAddress;
byte[] goInterfaceAddress;
}

View File

@@ -17,6 +17,7 @@
package android.hardware.wifi.supplicant;
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.P2pGroupStartedEventParams;
import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
import android.hardware.wifi.supplicant.P2pStatusCode;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -243,4 +244,11 @@ oneway interface ISupplicantP2pIfaceCallback {
in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods,
in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities,
in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes);
/**
* Used to indicate the start of a P2P group, with some parameters describing the group.
*
* @param groupStartedEventParams Parameters describing the P2P group.
*/
void onGroupStartedWithParams(in P2pGroupStartedEventParams groupStartedEventParams);
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2022 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;
/**
* Parameters passed as part of Wifi P2P group start event.
*/
@VintfStability
parcelable P2pGroupStartedEventParams {
/** Interface name of the group (For ex: p2p-p2p0-1). */
String groupInterfaceName;
/** Whether this device is owner of the group. */
boolean isGroupOwner;
/** SSID of the group. */
byte[] ssid;
/** Frequency in MHz on which this group is created. */
int frequencyMHz;
/** PSK used to secure the group. */
byte[] psk;
/** PSK passphrase used to secure the group. */
String passphrase;
/** Whether this group is persisted or not. */
boolean isPersistent;
/** MAC Address of the owner of this group. */
byte[/* 6 */] goDeviceAddress;
/** MAC Address of the P2P interface of the owner of this group. */
byte[/* 6 */] goInterfaceAddress;
}

View File

@@ -44,7 +44,7 @@ cc_test {
"android.hardware.wifi@1.5",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V1-ndk",
"android.hardware.wifi.supplicant-V2-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
@@ -78,7 +78,7 @@ cc_test {
"android.hardware.wifi@1.5",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V1-ndk",
"android.hardware.wifi.supplicant-V2-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
@@ -112,7 +112,7 @@ cc_test {
"android.hardware.wifi@1.5",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
"android.hardware.wifi.supplicant-V1-ndk",
"android.hardware.wifi.supplicant-V2-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",

View File

@@ -37,6 +37,7 @@ using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface;
using aidl::android::hardware::wifi::supplicant::MiracastMode;
using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams;
using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode;
using aidl::android::hardware::wifi::supplicant::P2pStatusCode;
using aidl::android::hardware::wifi::supplicant::SupplicantStatusCode;
@@ -177,6 +178,10 @@ class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback {
const std::vector<uint8_t>& /* vendorElemBytes */) override {
return ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus onGroupStartedWithParams(
const P2pGroupStartedEventParams& /* groupStartedEventParams */) override {
return ndk::ScopedAStatus::ok();
}
};
class SupplicantP2pIfaceAidlTest : public testing::TestWithParam<std::string> {