Loading wifi/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -633,6 +633,7 @@ package android.net.wifi { method public default void onCapabilityChanged(@NonNull android.net.wifi.SoftApCapability); method public default void onConnectedClientsChanged(@NonNull java.util.List<android.net.wifi.WifiClient>); method public default void onInfoChanged(@NonNull android.net.wifi.SoftApInfo); method public default void onInfoListChanged(@NonNull java.util.List<android.net.wifi.SoftApInfo>); method public default void onStateChanged(int, int); } Loading wifi/java/android/net/wifi/ISoftApCallback.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,12 @@ oneway interface ISoftApCallback */ void onInfoChanged(in SoftApInfo softApInfo); /** * Service to manager callback providing informations of softap. * * @param softApInfoList is the list of the softap informations. {@link SoftApInfo} */ void onInfoListChanged(in List<SoftApInfo> softApInfoList); /** * Service to manager callback providing capability of softap. Loading wifi/java/android/net/wifi/SoftApInfo.java +33 −2 Original line number Diff line number Diff line Loading @@ -96,6 +96,10 @@ public final class SoftApInfo implements Parcelable { @Nullable private MacAddress mBssid; /** The identifier of the AP instance which AP resides on with current info. */ @Nullable private String mApInstanceIdentifier; /** * The operational mode of the AP. */ Loading Loading @@ -186,6 +190,28 @@ public final class SoftApInfo implements Parcelable { return mWifiStandard; } /** * Set the AP instance identifier. * @hide */ public void setApInstanceIdentifier(@NonNull String apInstanceIdentifier) { mApInstanceIdentifier = apInstanceIdentifier; } /** * Get the AP instance identifier. * * The AP instance identifier is a unique identity which can be used to * associate the {@link SoftApInfo} to a specific {@link WifiClient} * - see {@link WifiClient#getApInstanceIdentifier()} * * @hide */ @Nullable public String getApInstanceIdentifier() { return mApInstanceIdentifier; } /** * @hide */ Loading @@ -195,6 +221,7 @@ public final class SoftApInfo implements Parcelable { mBandwidth = source.mBandwidth; mBssid = source.mBssid; mWifiStandard = source.mWifiStandard; mApInstanceIdentifier = source.mApInstanceIdentifier; } } Loading @@ -217,6 +244,7 @@ public final class SoftApInfo implements Parcelable { dest.writeInt(mBandwidth); dest.writeParcelable(mBssid, flags); dest.writeInt(mWifiStandard); dest.writeString(mApInstanceIdentifier); } @NonNull Loading @@ -228,6 +256,7 @@ public final class SoftApInfo implements Parcelable { info.mBandwidth = in.readInt(); info.mBssid = in.readParcelable(MacAddress.class.getClassLoader()); info.mWifiStandard = in.readInt(); info.mApInstanceIdentifier = in.readString(); return info; } Loading @@ -245,6 +274,7 @@ public final class SoftApInfo implements Parcelable { sbuf.append(", frequency= ").append(mFrequency); if (mBssid != null) sbuf.append(",bssid=").append(mBssid.toString()); sbuf.append(", wifiStandard= ").append(mWifiStandard); sbuf.append(", mApInstanceIdentifier= ").append(mApInstanceIdentifier); sbuf.append("}"); return sbuf.toString(); } Loading @@ -257,11 +287,12 @@ public final class SoftApInfo implements Parcelable { return mFrequency == softApInfo.mFrequency && mBandwidth == softApInfo.mBandwidth && Objects.equals(mBssid, softApInfo.mBssid) && mWifiStandard == softApInfo.mWifiStandard; && mWifiStandard == softApInfo.mWifiStandard && Objects.equals(mApInstanceIdentifier, softApInfo.mApInstanceIdentifier); } @Override public int hashCode() { return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard); return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard, mApInstanceIdentifier); } } wifi/java/android/net/wifi/WifiClient.java +24 −5 Original line number Diff line number Diff line Loading @@ -30,6 +30,9 @@ public final class WifiClient implements Parcelable { private final MacAddress mMacAddress; /** The identifier of the AP instance which the client connected. */ private final String mApInstanceIdentifier; /** * The mac address of this client. */ Loading @@ -38,15 +41,30 @@ public final class WifiClient implements Parcelable { return mMacAddress; } /** * Get AP instance identifier. * * The AP instance identifier is a unique identity which can be used to * associate the {@link SoftApInfo} to a specific {@link WifiClient} * - see {@link SoftApInfo#getApInstanceIdentifier()} * @hide */ @NonNull public String getApInstanceIdentifier() { return mApInstanceIdentifier; } private WifiClient(Parcel in) { mMacAddress = in.readParcelable(null); mApInstanceIdentifier = in.readString(); } /** @hide */ public WifiClient(@NonNull MacAddress macAddress) { public WifiClient(@NonNull MacAddress macAddress, @NonNull String apInstanceIdentifier) { Objects.requireNonNull(macAddress, "mMacAddress must not be null."); this.mMacAddress = macAddress; this.mApInstanceIdentifier = apInstanceIdentifier; } @Override Loading @@ -57,6 +75,7 @@ public final class WifiClient implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeParcelable(mMacAddress, flags); dest.writeString(mApInstanceIdentifier); } @NonNull Loading @@ -75,6 +94,7 @@ public final class WifiClient implements Parcelable { public String toString() { return "WifiClient{" + "mMacAddress=" + mMacAddress + "mApInstanceIdentifier=" + mApInstanceIdentifier + '}'; } Loading @@ -83,13 +103,12 @@ public final class WifiClient implements Parcelable { if (this == o) return true; if (!(o instanceof WifiClient)) return false; WifiClient client = (WifiClient) o; return mMacAddress.equals(client.mMacAddress); return Objects.equals(mMacAddress, client.mMacAddress) && mApInstanceIdentifier.equals(client.mApInstanceIdentifier); } @Override public int hashCode() { return Objects.hash(mMacAddress); return Objects.hash(mMacAddress, mApInstanceIdentifier); } } wifi/java/android/net/wifi/WifiManager.java +36 −0 Original line number Diff line number Diff line Loading @@ -4016,12 +4016,35 @@ public class WifiManager { /** * Called when information of softap changes. * * Note: this API is only valid when the Soft AP is configured as a single AP * - not as a bridged AP (2 Soft APs). When the Soft AP is configured as bridged AP * this callback will not be triggered - use the * {@link #onInfoListChanged(List<SoftApInfo>)} callback in bridged AP mode. * * @param softApInfo is the softap information. {@link SoftApInfo} */ default void onInfoChanged(@NonNull SoftApInfo softApInfo) { // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI. } /** * Called when information of softap changes. * * The number of the information elements in the list depends on Soft AP configuration * and state. * For instance, an empty list will be returned when the Soft AP is disabled. * One information element will be returned in the list when the Soft AP is configured * as a single AP, and two information elements will be returned in the list * when the Soft AP is configured in bridged mode. * * See {@link #isBridgedApConcurrencySupported()} for the detail of the bridged AP. * * @param softApInfoList is the list of the softap information elements. {@link SoftApInfo} */ default void onInfoListChanged(@NonNull List<SoftApInfo> softApInfoList) { // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI. } /** * Called when capability of softap changes. * Loading Loading @@ -4101,6 +4124,19 @@ public class WifiManager { }); } @Override public void onInfoListChanged(List<SoftApInfo> softApInfoList) { if (mVerboseLoggingEnabled) { Log.v(TAG, "SoftApCallbackProxy: onInfoListChange: softApInfoList=" + softApInfoList); } Binder.clearCallingIdentity(); mExecutor.execute(() -> { mCallback.onInfoListChanged(softApInfoList); }); } @Override public void onCapabilityChanged(SoftApCapability capability) { if (mVerboseLoggingEnabled) { Loading Loading
wifi/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -633,6 +633,7 @@ package android.net.wifi { method public default void onCapabilityChanged(@NonNull android.net.wifi.SoftApCapability); method public default void onConnectedClientsChanged(@NonNull java.util.List<android.net.wifi.WifiClient>); method public default void onInfoChanged(@NonNull android.net.wifi.SoftApInfo); method public default void onInfoListChanged(@NonNull java.util.List<android.net.wifi.SoftApInfo>); method public default void onStateChanged(int, int); } Loading
wifi/java/android/net/wifi/ISoftApCallback.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,12 @@ oneway interface ISoftApCallback */ void onInfoChanged(in SoftApInfo softApInfo); /** * Service to manager callback providing informations of softap. * * @param softApInfoList is the list of the softap informations. {@link SoftApInfo} */ void onInfoListChanged(in List<SoftApInfo> softApInfoList); /** * Service to manager callback providing capability of softap. Loading
wifi/java/android/net/wifi/SoftApInfo.java +33 −2 Original line number Diff line number Diff line Loading @@ -96,6 +96,10 @@ public final class SoftApInfo implements Parcelable { @Nullable private MacAddress mBssid; /** The identifier of the AP instance which AP resides on with current info. */ @Nullable private String mApInstanceIdentifier; /** * The operational mode of the AP. */ Loading Loading @@ -186,6 +190,28 @@ public final class SoftApInfo implements Parcelable { return mWifiStandard; } /** * Set the AP instance identifier. * @hide */ public void setApInstanceIdentifier(@NonNull String apInstanceIdentifier) { mApInstanceIdentifier = apInstanceIdentifier; } /** * Get the AP instance identifier. * * The AP instance identifier is a unique identity which can be used to * associate the {@link SoftApInfo} to a specific {@link WifiClient} * - see {@link WifiClient#getApInstanceIdentifier()} * * @hide */ @Nullable public String getApInstanceIdentifier() { return mApInstanceIdentifier; } /** * @hide */ Loading @@ -195,6 +221,7 @@ public final class SoftApInfo implements Parcelable { mBandwidth = source.mBandwidth; mBssid = source.mBssid; mWifiStandard = source.mWifiStandard; mApInstanceIdentifier = source.mApInstanceIdentifier; } } Loading @@ -217,6 +244,7 @@ public final class SoftApInfo implements Parcelable { dest.writeInt(mBandwidth); dest.writeParcelable(mBssid, flags); dest.writeInt(mWifiStandard); dest.writeString(mApInstanceIdentifier); } @NonNull Loading @@ -228,6 +256,7 @@ public final class SoftApInfo implements Parcelable { info.mBandwidth = in.readInt(); info.mBssid = in.readParcelable(MacAddress.class.getClassLoader()); info.mWifiStandard = in.readInt(); info.mApInstanceIdentifier = in.readString(); return info; } Loading @@ -245,6 +274,7 @@ public final class SoftApInfo implements Parcelable { sbuf.append(", frequency= ").append(mFrequency); if (mBssid != null) sbuf.append(",bssid=").append(mBssid.toString()); sbuf.append(", wifiStandard= ").append(mWifiStandard); sbuf.append(", mApInstanceIdentifier= ").append(mApInstanceIdentifier); sbuf.append("}"); return sbuf.toString(); } Loading @@ -257,11 +287,12 @@ public final class SoftApInfo implements Parcelable { return mFrequency == softApInfo.mFrequency && mBandwidth == softApInfo.mBandwidth && Objects.equals(mBssid, softApInfo.mBssid) && mWifiStandard == softApInfo.mWifiStandard; && mWifiStandard == softApInfo.mWifiStandard && Objects.equals(mApInstanceIdentifier, softApInfo.mApInstanceIdentifier); } @Override public int hashCode() { return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard); return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard, mApInstanceIdentifier); } }
wifi/java/android/net/wifi/WifiClient.java +24 −5 Original line number Diff line number Diff line Loading @@ -30,6 +30,9 @@ public final class WifiClient implements Parcelable { private final MacAddress mMacAddress; /** The identifier of the AP instance which the client connected. */ private final String mApInstanceIdentifier; /** * The mac address of this client. */ Loading @@ -38,15 +41,30 @@ public final class WifiClient implements Parcelable { return mMacAddress; } /** * Get AP instance identifier. * * The AP instance identifier is a unique identity which can be used to * associate the {@link SoftApInfo} to a specific {@link WifiClient} * - see {@link SoftApInfo#getApInstanceIdentifier()} * @hide */ @NonNull public String getApInstanceIdentifier() { return mApInstanceIdentifier; } private WifiClient(Parcel in) { mMacAddress = in.readParcelable(null); mApInstanceIdentifier = in.readString(); } /** @hide */ public WifiClient(@NonNull MacAddress macAddress) { public WifiClient(@NonNull MacAddress macAddress, @NonNull String apInstanceIdentifier) { Objects.requireNonNull(macAddress, "mMacAddress must not be null."); this.mMacAddress = macAddress; this.mApInstanceIdentifier = apInstanceIdentifier; } @Override Loading @@ -57,6 +75,7 @@ public final class WifiClient implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeParcelable(mMacAddress, flags); dest.writeString(mApInstanceIdentifier); } @NonNull Loading @@ -75,6 +94,7 @@ public final class WifiClient implements Parcelable { public String toString() { return "WifiClient{" + "mMacAddress=" + mMacAddress + "mApInstanceIdentifier=" + mApInstanceIdentifier + '}'; } Loading @@ -83,13 +103,12 @@ public final class WifiClient implements Parcelable { if (this == o) return true; if (!(o instanceof WifiClient)) return false; WifiClient client = (WifiClient) o; return mMacAddress.equals(client.mMacAddress); return Objects.equals(mMacAddress, client.mMacAddress) && mApInstanceIdentifier.equals(client.mApInstanceIdentifier); } @Override public int hashCode() { return Objects.hash(mMacAddress); return Objects.hash(mMacAddress, mApInstanceIdentifier); } }
wifi/java/android/net/wifi/WifiManager.java +36 −0 Original line number Diff line number Diff line Loading @@ -4016,12 +4016,35 @@ public class WifiManager { /** * Called when information of softap changes. * * Note: this API is only valid when the Soft AP is configured as a single AP * - not as a bridged AP (2 Soft APs). When the Soft AP is configured as bridged AP * this callback will not be triggered - use the * {@link #onInfoListChanged(List<SoftApInfo>)} callback in bridged AP mode. * * @param softApInfo is the softap information. {@link SoftApInfo} */ default void onInfoChanged(@NonNull SoftApInfo softApInfo) { // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI. } /** * Called when information of softap changes. * * The number of the information elements in the list depends on Soft AP configuration * and state. * For instance, an empty list will be returned when the Soft AP is disabled. * One information element will be returned in the list when the Soft AP is configured * as a single AP, and two information elements will be returned in the list * when the Soft AP is configured in bridged mode. * * See {@link #isBridgedApConcurrencySupported()} for the detail of the bridged AP. * * @param softApInfoList is the list of the softap information elements. {@link SoftApInfo} */ default void onInfoListChanged(@NonNull List<SoftApInfo> softApInfoList) { // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI. } /** * Called when capability of softap changes. * Loading Loading @@ -4101,6 +4124,19 @@ public class WifiManager { }); } @Override public void onInfoListChanged(List<SoftApInfo> softApInfoList) { if (mVerboseLoggingEnabled) { Log.v(TAG, "SoftApCallbackProxy: onInfoListChange: softApInfoList=" + softApInfoList); } Binder.clearCallingIdentity(); mExecutor.execute(() -> { mCallback.onInfoListChanged(softApInfoList); }); } @Override public void onCapabilityChanged(SoftApCapability capability) { if (mVerboseLoggingEnabled) { Loading