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

Commit 8f24cd9d authored by David Su's avatar David Su
Browse files

Expose getters for WifiP2pConfig fields

CTS cannot test @hide fields, need public getters.

Bug: 146463839
Test: atest WifiP2pConfigTest
Change-Id: Iaa6cb069fb445d65778c8c6b6a238a82160d376f
parent 3d374500
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -30646,6 +30646,10 @@ package android.net.wifi.p2p {
    ctor public WifiP2pConfig();
    ctor public WifiP2pConfig(android.net.wifi.p2p.WifiP2pConfig);
    method public int describeContents();
    method public int getGroupOwnerBand();
    method public int getNetworkId();
    method @Nullable public String getNetworkName();
    method @Nullable public String getPassphrase();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pConfig> CREATOR;
    field public static final int GROUP_OWNER_BAND_2GHZ = 1; // 0x1
@@ -30719,6 +30723,8 @@ package android.net.wifi.p2p {
    method public boolean isGroupOwner();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pGroup> CREATOR;
    field public static final int PERSISTENT_NET_ID = -2; // 0xfffffffe
    field public static final int TEMPORARY_NET_ID = -1; // 0xffffffff
  }
  public class WifiP2pInfo implements android.os.Parcelable {
+26 −9
Original line number Diff line number Diff line
@@ -48,21 +48,29 @@ public class WifiP2pConfig implements Parcelable {
     */
    public WpsInfo wps;

    /**
     * The network name of a group, should be configured by helper method
     */
    /** Get the network name of this P2P configuration, or null if unset. */
    @Nullable
    public String getNetworkName() {
        return networkName;
    }

    /** @hide */
    public String networkName = "";

    /**
     * The passphrase of a group, should be configured by helper method
     */
    /** Get the passphrase of this P2P configuration, or null if unset. */
    @Nullable
    public String getPassphrase() {
        return passphrase;
    }

    /** @hide */
    public String passphrase = "";

    /**
     * The required band for Group Owner
     */
    /** Get the required band for the group owner. */
    public int getGroupOwnerBand() {
        return groupOwnerBand;
    }

    /** @hide */
    public int groupOwnerBand = GROUP_OWNER_BAND_AUTO;

@@ -123,6 +131,15 @@ public class WifiP2pConfig implements Parcelable {
    @UnsupportedAppUsage
    public int netId = WifiP2pGroup.PERSISTENT_NET_ID;

    /**
     * Get the network ID of this P2P configuration.
     * @return either a non-negative network ID, or one of {@link WifiP2pGroup#PERSISTENT_NET_ID} or
     * {@link WifiP2pGroup#TEMPORARY_NET_ID}.
     */
    public int getNetworkId() {
        return netId;
    }

    public WifiP2pConfig() {
        //set defaults
        wps = new WpsInfo();
+2 −5
Original line number Diff line number Diff line
@@ -39,18 +39,15 @@ public class WifiP2pGroup implements Parcelable {

    /**
     * The temporary network id.
     *
     * @hide
     * @see #getNetworkId()
     */
    @UnsupportedAppUsage
    public static final int TEMPORARY_NET_ID = -1;

    /**
     * The persistent network id.
     * If a matching persistent profile is found, use it.
     * Otherwise, create a new persistent profile.
     *
     * @hide
     * @see #getNetworkId()
     */
    public static final int PERSISTENT_NET_ID = -2;