Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 246e87d0 authored by Sunil Ravi's avatar Sunil Ravi
Browse files

wifi: API to Notify the IP address of connected client

When the wpa_supplicant assigns the IP address
(WFA EAPOL IP address allocation feature),
the assigned IP address of the client on the GO side
is notified in the AP-STA-CONNECTED event.
So to obtain the IP info to framework , modified the
AIDL SupplicantP2pIfaceCallback#onStaAuthorized to
include group interface name and the assigned IP of client.

Bug: 291202830
Test: Establish P2P connection and verified from the logs that
      the P2P Client IP address is received to framework via new
      HAL API.
Test: vts test
Change-Id: Ie7b6944e88c3962c9d2b4a223cd383077e59f4a8
parent d139f8a7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -48,9 +48,17 @@ interface ISupplicantP2pIfaceCallback {
  oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, in android.hardware.wifi.supplicant.P2pProvDiscStatusCode status, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in String generatedPin);
  oneway void onR2DeviceFound(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);
  oneway void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs);
  /**
   * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onPeerClientJoined()
   */
  oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
  /**
   * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onPeerClientDisconnected()
   */
  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);
  oneway void onPeerClientJoined(in android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams clientJoinedEventParams);
  oneway void onPeerClientDisconnected(in android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
}
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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 P2pPeerClientDisconnectedEventParams {
  String groupInterfaceName;
  byte[6] clientInterfaceAddress;
  byte[6] clientDeviceAddress;
}
+41 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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 P2pPeerClientJoinedEventParams {
  String groupInterfaceName;
  byte[6] clientInterfaceAddress;
  byte[6] clientDeviceAddress;
  int clientIpAddress;
}
+24 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.hardware.wifi.supplicant;

import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.P2pGroupStartedEventParams;
import android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams;
import android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams;
import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
import android.hardware.wifi.supplicant.P2pStatusCode;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -192,6 +194,9 @@ oneway interface ISupplicantP2pIfaceCallback {

    /**
     * Used to indicate when a STA device is connected to this device.
     * <p>
     * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
     * onPeerClientJoined()
     *
     * @param srcAddress MAC address of the device that was authorized.
     * @param p2pDeviceAddress P2P device address.
@@ -200,6 +205,9 @@ oneway interface ISupplicantP2pIfaceCallback {

    /**
     * Used to indicate when a STA device is disconnected from this device.
     * <p>
     * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
     * onPeerClientDisconnected()
     *
     * @param srcAddress MAC address of the device that was deauthorized.
     * @param p2pDeviceAddress P2P device address.
@@ -251,4 +259,20 @@ oneway interface ISupplicantP2pIfaceCallback {
     * @param groupStartedEventParams Parameters describing the P2P group.
     */
    void onGroupStartedWithParams(in P2pGroupStartedEventParams groupStartedEventParams);

    /**
     * Used to indicate that a P2P client has joined this device group owner.
     *
     * @param clientJoinedEventParams Parameters associated with peer client joined event.
     */
    void onPeerClientJoined(in P2pPeerClientJoinedEventParams clientJoinedEventParams);

    /**
     * Used to indicate that a P2P client has disconnected from this device group owner.
     *
     * @param clientDisconnectedEventParams Parameters associated with peer client disconnected
     *         event.
     */
    void onPeerClientDisconnected(
            in P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
}
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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 a part of P2P peer client disconnected event.
 */
@VintfStability
parcelable P2pPeerClientDisconnectedEventParams {
    /** Interface name of this device group owner. (For ex: p2p-p2p0-1) */
    String groupInterfaceName;

    /** P2P group interface MAC address of the client that disconnected. */
    byte[6] clientInterfaceAddress;

    /** P2P device interface MAC address of the client that disconnected. */
    byte[6] clientDeviceAddress;
}
Loading