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

Commit b9a3ea2f authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge changes from topic "wificond"

* changes:
  [WIFICOND][API] Update channel API from array to list
  [WIFICOND][API] Expose public constructor for data classes.
parents 56cf26ef 98b1d8d5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -8197,6 +8197,7 @@ package android.net.wifi.wificond {
  }
  public final class NativeScanResult implements android.os.Parcelable {
    ctor public NativeScanResult();
    method public int describeContents();
    method @NonNull public byte[] getBssid();
    method @NonNull public java.util.BitSet getCapabilities();
@@ -8212,6 +8213,7 @@ package android.net.wifi.wificond {
  }
  public final class NativeWifiClient implements android.os.Parcelable {
    ctor public NativeWifiClient(@NonNull byte[]);
    method public int describeContents();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.wificond.NativeWifiClient> CREATOR;
@@ -8249,6 +8251,7 @@ package android.net.wifi.wificond {
  }
  public final class RadioChainInfo implements android.os.Parcelable {
    ctor public RadioChainInfo(int, int);
    method public int describeContents();
    method public int getChainId();
    method public int getLevelDbm();
@@ -8259,7 +8262,7 @@ package android.net.wifi.wificond {
  public class WifiCondManager {
    method public void abortScan(@NonNull String);
    method public void enableVerboseLogging(boolean);
    method @NonNull public int[] getChannelsMhzForBand(int);
    method @NonNull public java.util.List<java.lang.Integer> getChannelsMhzForBand(int);
    method @Nullable public android.net.wifi.wificond.DeviceWiphyCapabilities getDeviceWiphyCapabilities(@NonNull String);
    method @NonNull public java.util.List<android.net.wifi.wificond.NativeScanResult> getScanResults(@NonNull String, int);
    method @Nullable public android.net.wifi.wificond.WifiCondManager.TxPacketCounters getTxPacketCounters(@NonNull String);
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public final class NativeScanResult implements Parcelable {
    }

    /**
     * @hide
     * Construct an empty native scan result.
     */
    public NativeScanResult() { }

+1 −2
Original line number Diff line number Diff line
@@ -36,8 +36,7 @@ public final class NativeWifiClient implements Parcelable {
    @NonNull public final byte[] macAddress;

    /**
     * public constructor
     * @hide
     * Construct a native Wi-Fi client.
     */
    public NativeWifiClient(@NonNull byte[] macAddress) {
        this.macAddress = macAddress;
+3 −1
Original line number Diff line number Diff line
@@ -61,7 +61,9 @@ public final class RadioChainInfo implements Parcelable {
        return level;
    }

    /** @hide */
    /**
     * Construct a RadioChainInfo.
     */
    public RadioChainInfo(int chainId, int level) {
        this.chainId = chainId;
        this.level = level;
+10 −7
Original line number Diff line number Diff line
@@ -41,16 +41,19 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;

/**
 * This class encapsulates the interface the wificond daemon presents to the Wi-Fi framework. The
 * interface is only for use by the Wi-Fi framework and access is protected by SELinux permissions.
 * This class encapsulates the interface the wificond (Wi-Fi Conductor) daemon presents to the
 * Wi-Fi framework. The interface is only for use by the Wi-Fi framework and access is protected
 * by SELinux permissions: only the system server and wpa_supplicant can use WifiCondManager.
 *
 * @hide
 */
@@ -1011,13 +1014,13 @@ public class WifiCondManager {
     * WifiScanner.WIFI_BAND_5_GHZ
     * WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY
     * WifiScanner.WIFI_BAND_6_GHZ
     * @return frequencies vector of valid frequencies (MHz), or an empty array for error.
     * @return frequencies List of valid frequencies (MHz), or an empty list for error.
     * @throws IllegalArgumentException if band is not recognized.
     */
    public @NonNull int[] getChannelsMhzForBand(@WifiAnnotations.WifiBandBasic int band) {
    public @NonNull List<Integer> getChannelsMhzForBand(@WifiAnnotations.WifiBandBasic int band) {
        if (mWificond == null) {
            Log.e(TAG, "No valid wificond scanner interface handler");
            return new int[0];
            return Collections.emptyList();
        }
        int[] result = null;
        try {
@@ -1041,9 +1044,9 @@ public class WifiCondManager {
            Log.e(TAG, "Failed to request getChannelsForBand due to remote exception");
        }
        if (result == null) {
            result = new int[0];
            return Collections.emptyList();
        }
        return result;
        return Arrays.stream(result).boxed().collect(Collectors.toList());
    }

    /** Helper function to look up the interface handle using name */
Loading