Inform p2p framework about the channel change event

Added a callback function to indicate that the p2p
operating frequency has been changed.

Bug: 202758240
Test: vts test
Test: Manually triggered channel switch through hostapd command
    and verified the new frequency in logs.
Change-Id: I5814a108c77478cf96bc88f2d8fd8193bd8168be
This commit is contained in:
Sunil Ravi
2021-12-08 18:54:10 -08:00
parent 962deadfd2
commit 189cf702db
3 changed files with 13 additions and 0 deletions

View File

@@ -50,4 +50,5 @@ interface ISupplicantP2pIfaceCallback {
oneway void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs);
oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);
}

View File

@@ -205,4 +205,12 @@ interface ISupplicantP2pIfaceCallback {
* @param p2pDeviceAddress P2P device address.
*/
oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
/**
* Used to indicate that operating frequency has changed for this P2P group interface.
*
* @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
* @param frequency New operating frequency in MHz.
*/
oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);
}

View File

@@ -159,6 +159,10 @@ class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback {
const std::vector<uint8_t>& /* p2pDeviceAddress */) override {
return ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus onGroupFrequencyChanged(const std::string& /* groupIfname */,
int32_t /* frequency */) override {
return ndk::ScopedAStatus::ok();
}
};
class SupplicantP2pIfaceAidlTest : public testing::TestWithParam<std::string> {