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

Commit d629395f authored by Sunil Ravi's avatar Sunil Ravi Committed by Android (Google) Code Review
Browse files

Merge changes from topic "driver-cross-akm-feature" into main

* changes:
  Get the device support for cross-akm roaming
  Add aconfig for Wifi non-updatable part
parents 4d39576d 6b5104cf
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ aconfig_srcjars = [
    ":android.multiuser.flags-aconfig-java{.generated_srcjars}",
    ":android.net.platform.flags-aconfig-java{.generated_srcjars}",
    ":android.net.vcn.flags-aconfig-java{.generated_srcjars}",
    ":android.net.wifi.flags-aconfig-java{.generated_srcjars}",
    ":android.nfc.flags-aconfig-java{.generated_srcjars}",
    ":android.os.flags-aconfig-java{.generated_srcjars}",
    ":android.os.vibrator.flags-aconfig-java{.generated_srcjars}",
@@ -111,6 +112,7 @@ stubs_defaults {
        "android.multiuser.flags-aconfig",
        "android.net.platform.flags-aconfig",
        "android.net.vcn.flags-aconfig",
        "android.net.wifi.flags-aconfig",
        "android.nfc.flags-aconfig",
        "android.os.flags-aconfig",
        "android.os.vibrator.flags-aconfig",
@@ -1103,3 +1105,21 @@ java_aconfig_library {
    aconfig_declarations: "backup_flags",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Wifi
aconfig_declarations {
    name: "android.net.wifi.flags-aconfig",
    package: "android.net.wifi.flags",
    srcs: ["wifi/*.aconfig"],
}

java_aconfig_library {
    name: "android.net.wifi.flags-aconfig-java",
    aconfig_declarations: "android.net.wifi.flags-aconfig",
    min_sdk_version: "30",
    apex_available: [
        "//apex_available:platform",
        "com.android.wifi",
    ],
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
+1 −0
Original line number Diff line number Diff line
@@ -9658,6 +9658,7 @@ package android.net.wifi.nl80211 {
  public final class DeviceWiphyCapabilities implements android.os.Parcelable {
    ctor public DeviceWiphyCapabilities();
    method public int describeContents();
    method @FlaggedApi("android.net.wifi.flags.get_device_cross_akm_roaming_support") public int getMaxNumberAkms();
    method public int getMaxNumberRxSpatialStreams();
    method public int getMaxNumberTxSpatialStreams();
    method public boolean isChannelWidthSupported(int);
+29 −2
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@

package android.net.wifi.nl80211;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiAnnotations.ChannelWidth;
import android.net.wifi.WifiAnnotations.WifiStandard;
import android.net.wifi.flags.Flags;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
@@ -48,6 +50,7 @@ public final class DeviceWiphyCapabilities implements Parcelable {
    private boolean mChannelWidth320MhzSupported;
    private int mMaxNumberTxSpatialStreams;
    private int mMaxNumberRxSpatialStreams;
    private int mMaxNumberAkms;


    /** public constructor */
@@ -61,6 +64,7 @@ public final class DeviceWiphyCapabilities implements Parcelable {
        mChannelWidth320MhzSupported = false;
        mMaxNumberTxSpatialStreams = 1;
        mMaxNumberRxSpatialStreams = 1;
        mMaxNumberAkms = 1;
    }

    /**
@@ -198,6 +202,25 @@ public final class DeviceWiphyCapabilities implements Parcelable {
        return mMaxNumberRxSpatialStreams;
    }

    /**
     * Get the maximum number of AKM suites supported in the connection request to the driver.
     *
     * @return maximum number of AKMs
     */
    @FlaggedApi(Flags.FLAG_GET_DEVICE_CROSS_AKM_ROAMING_SUPPORT)
    public int getMaxNumberAkms() {
        return mMaxNumberAkms;
    }

    /**
     * Set the maximum number of AKM suites supported in the connection request to the driver.
     *
     * @hide
     */
    public void setMaxNumberAkms(int akms) {
        mMaxNumberAkms = akms;
    }

    /**
     * Set maximum number of receive spatial streams
     *
@@ -226,7 +249,8 @@ public final class DeviceWiphyCapabilities implements Parcelable {
                && mChannelWidth80p80MhzSupported == capa.mChannelWidth80p80MhzSupported
                && mChannelWidth320MhzSupported == capa.mChannelWidth320MhzSupported
                && mMaxNumberTxSpatialStreams == capa.mMaxNumberTxSpatialStreams
                && mMaxNumberRxSpatialStreams == capa.mMaxNumberRxSpatialStreams;
                && mMaxNumberRxSpatialStreams == capa.mMaxNumberRxSpatialStreams
                && mMaxNumberAkms == capa.mMaxNumberAkms;
    }

    /** override hash code */
@@ -235,7 +259,7 @@ public final class DeviceWiphyCapabilities implements Parcelable {
        return Objects.hash(m80211nSupported, m80211acSupported, m80211axSupported,
                m80211beSupported, mChannelWidth160MhzSupported, mChannelWidth80p80MhzSupported,
                mChannelWidth320MhzSupported, mMaxNumberTxSpatialStreams,
                mMaxNumberRxSpatialStreams);
                mMaxNumberRxSpatialStreams, mMaxNumberAkms);
    }

    /** implement Parcelable interface */
@@ -259,6 +283,7 @@ public final class DeviceWiphyCapabilities implements Parcelable {
        out.writeBoolean(mChannelWidth320MhzSupported);
        out.writeInt(mMaxNumberTxSpatialStreams);
        out.writeInt(mMaxNumberRxSpatialStreams);
        out.writeInt(mMaxNumberAkms);
    }

    @Override
@@ -276,6 +301,7 @@ public final class DeviceWiphyCapabilities implements Parcelable {
                .append(mChannelWidth320MhzSupported ? "Yes" : "No");
        sb.append("mMaxNumberTxSpatialStreams: ").append(mMaxNumberTxSpatialStreams);
        sb.append("mMaxNumberRxSpatialStreams: ").append(mMaxNumberRxSpatialStreams);
        sb.append("mMaxNumberAkms: ").append(mMaxNumberAkms);

        return sb.toString();
    }
@@ -298,6 +324,7 @@ public final class DeviceWiphyCapabilities implements Parcelable {
            capabilities.mChannelWidth320MhzSupported = in.readBoolean();
            capabilities.mMaxNumberTxSpatialStreams = in.readInt();
            capabilities.mMaxNumberRxSpatialStreams = in.readInt();
            capabilities.mMaxNumberAkms = in.readInt();
            return capabilities;
        }

+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public class DeviceWiphyCapabilitiesTest {
        capa.setChannelWidthSupported(ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ, false);
        capa.setMaxNumberTxSpatialStreams(2);
        capa.setMaxNumberRxSpatialStreams(1);
        capa.setMaxNumberAkms(2);

        Parcel parcel = Parcel.obtain();
        capa.writeToParcel(parcel, 0);
+1 −0
Original line number Diff line number Diff line
@@ -1130,6 +1130,7 @@ public class WifiNl80211ManagerTest {
        capaExpected.setChannelWidthSupported(ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ, false);
        capaExpected.setMaxNumberTxSpatialStreams(2);
        capaExpected.setMaxNumberRxSpatialStreams(1);
        capaExpected.setMaxNumberAkms(2);

        when(mWificond.getDeviceWiphyCapabilities(TEST_INTERFACE_NAME))
                .thenReturn(capaExpected);
Loading