From 121a034d3ccf38067e0e340d0b4885ebef02a1b1 Mon Sep 17 00:00:00 2001 From: lesl Date: Wed, 14 Oct 2020 17:36:31 +0800 Subject: [PATCH] wifi: make BAND_ANY to deprecated Require to use bands bit mask to replace BAND_ANY. The current bands are a bit mask. It already supported multi-bands setting. The BAND_ANY will causes limitation when adding the new band setting. Mark BAND_ANY to deprecated and replace all of the test code to use bit mask. Bug: 162899642 Test: atest FrameworksWifiApiTests Change-Id: I0d379e60ed52e569a992ee566e4281cffa42aec9 --- api/system-current.txt | 2 +- wifi/api/system-current.txt | 2 +- wifi/java/android/net/wifi/SoftApConfiguration.java | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 1404f7e1c554b..df6e71877b7da 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -7292,7 +7292,7 @@ package android.net.wifi { field public static final int BAND_2GHZ = 1; // 0x1 field public static final int BAND_5GHZ = 2; // 0x2 field public static final int BAND_6GHZ = 4; // 0x4 - field public static final int BAND_ANY = 7; // 0x7 + field @Deprecated public static final int BAND_ANY = 7; // 0x7 field public static final int RANDOMIZATION_NONE = 0; // 0x0 field public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1 } diff --git a/wifi/api/system-current.txt b/wifi/api/system-current.txt index 98cb849084d42..3615416480e17 100644 --- a/wifi/api/system-current.txt +++ b/wifi/api/system-current.txt @@ -263,7 +263,7 @@ package android.net.wifi { field public static final int BAND_2GHZ = 1; // 0x1 field public static final int BAND_5GHZ = 2; // 0x2 field public static final int BAND_6GHZ = 4; // 0x4 - field public static final int BAND_ANY = 7; // 0x7 + field @Deprecated public static final int BAND_ANY = 7; // 0x7 field public static final int RANDOMIZATION_NONE = 0; // 0x0 field public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1 } diff --git a/wifi/java/android/net/wifi/SoftApConfiguration.java b/wifi/java/android/net/wifi/SoftApConfiguration.java index 237922a6fe1ea..2649b66c703fe 100644 --- a/wifi/java/android/net/wifi/SoftApConfiguration.java +++ b/wifi/java/android/net/wifi/SoftApConfiguration.java @@ -90,6 +90,9 @@ public final class SoftApConfiguration implements Parcelable { * Device is allowed to choose the optimal band (2Ghz, 5Ghz, 6Ghz) based on device capability, * operating country code and current radio conditions. * @hide + * + * @deprecated The bands are a bit mask - use any combination of {@code BAND_}, + * for instance {@code BAND_2GHZ | BAND_5GHZ | BAND_6GHZ}. */ @SystemApi public static final int BAND_ANY = BAND_2GHZ | BAND_5GHZ | BAND_6GHZ;