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

Commit fcab444a authored by David Su's avatar David Su Committed by Android (Google) Code Review
Browse files

Merge "Rename PERSISTENT_NET_ID/TEMPORARY_NET_ID"

parents 7dd89e38 4b702336
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31792,8 +31792,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
    field public static final int NETWORK_ID_PERSISTENT = -2; // 0xfffffffe
    field public static final int NETWORK_ID_TEMPORARY = -1; // 0xffffffff
  }
  public class WifiP2pInfo implements android.os.Parcelable {
+6 −6
Original line number Diff line number Diff line
@@ -137,12 +137,12 @@ public class WifiP2pConfig implements Parcelable {

    /** @hide */
    @UnsupportedAppUsage
    public int netId = WifiP2pGroup.PERSISTENT_NET_ID;
    public int netId = WifiP2pGroup.NETWORK_ID_PERSISTENT;

    /**
     * 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}.
     * @return either a non-negative network ID, or one of
     * {@link WifiP2pGroup#NETWORK_ID_PERSISTENT} or {@link WifiP2pGroup#NETWORK_ID_TEMPORARY}.
     */
    public int getNetworkId() {
        return netId;
@@ -280,7 +280,7 @@ public class WifiP2pConfig implements Parcelable {
        private String mPassphrase = "";
        private int mGroupOperatingBand = GROUP_OWNER_BAND_AUTO;
        private int mGroupOperatingFrequency = GROUP_OWNER_BAND_AUTO;
        private int mNetId = WifiP2pGroup.TEMPORARY_NET_ID;
        private int mNetId = WifiP2pGroup.NETWORK_ID_TEMPORARY;

        /**
         * Specify the peer's MAC address. If not set, the device will
@@ -460,9 +460,9 @@ public class WifiP2pConfig implements Parcelable {
         */
        public @NonNull Builder enablePersistentMode(boolean persistent) {
            if (persistent) {
                mNetId = WifiP2pGroup.PERSISTENT_NET_ID;
                mNetId = WifiP2pGroup.NETWORK_ID_PERSISTENT;
            } else {
                mNetId = WifiP2pGroup.TEMPORARY_NET_ID;
                mNetId = WifiP2pGroup.NETWORK_ID_TEMPORARY;
            }
            return this;
        }
+13 −5
Original line number Diff line number Diff line
@@ -41,7 +41,15 @@ public class WifiP2pGroup implements Parcelable {
     * The temporary network id.
     * @see #getNetworkId()
     */
    public static final int TEMPORARY_NET_ID = -1;
    public static final int NETWORK_ID_TEMPORARY = -1;

    /**
     * The temporary network id.
     *
     * @hide
     */
    @UnsupportedAppUsage
    public static final int TEMPORARY_NET_ID = NETWORK_ID_TEMPORARY;

    /**
     * The persistent network id.
@@ -49,7 +57,7 @@ public class WifiP2pGroup implements Parcelable {
     * Otherwise, create a new persistent profile.
     * @see #getNetworkId()
     */
    public static final int PERSISTENT_NET_ID = -2;
    public static final int NETWORK_ID_PERSISTENT = -2;

    /** The network name */
    private String mNetworkName;
@@ -130,13 +138,13 @@ public class WifiP2pGroup implements Parcelable {
            mPassphrase = match.group(4);
            mOwner = new WifiP2pDevice(match.group(5));
            if (match.group(6) != null) {
                mNetId = PERSISTENT_NET_ID;
                mNetId = NETWORK_ID_PERSISTENT;
            } else {
                mNetId = TEMPORARY_NET_ID;
                mNetId = NETWORK_ID_TEMPORARY;
            }
        } else if (tokens[0].equals("P2P-INVITATION-RECEIVED")) {
            String sa = null;
            mNetId = PERSISTENT_NET_ID;
            mNetId = NETWORK_ID_PERSISTENT;
            for (String token : tokens) {
                String[] nameValue = token.split("=");
                if (nameValue.length != 2) continue;
+1 −1
Original line number Diff line number Diff line
@@ -1293,7 +1293,7 @@ public class WifiP2pManager {
    @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
    public void createGroup(Channel c, ActionListener listener) {
        checkChannel(c);
        c.mAsyncChannel.sendMessage(CREATE_GROUP, WifiP2pGroup.PERSISTENT_NET_ID,
        c.mAsyncChannel.sendMessage(CREATE_GROUP, WifiP2pGroup.NETWORK_ID_PERSISTENT,
                c.putListener(listener));
    }