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

Commit 9484e48e authored by Xiao Ma's avatar Xiao Ma
Browse files

Add DHCP Rapid Commit FILS support.

Bug: 140223017
Test: atest FrameworksNetTests NetworkStackTests
Test: atest NetworkStackIntegrationTests
Test: manual

Change-Id: Ia73e92058f30acee16eff27e05ec53d2eb0e7110
parent afb05a64
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
/**
 *
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net;

@JavaOnlyStableParcelable parcelable MacAddress;
+8 −0
Original line number Diff line number Diff line
@@ -17,8 +17,11 @@
package android.net.ip;

import android.net.DhcpResults;
import android.net.Layer2PacketParcelable;
import android.net.LinkProperties;

import java.util.List;

/**
 * Callbacks for handling IpClient events.
 *
@@ -116,4 +119,9 @@ public class IpClientCallbacks {
     * whenever 464xlat is being started or stopped.
     */
    public void setNeighborDiscoveryOffload(boolean enable) {}

    /**
     * Invoked on starting preconnection process.
     */
    public void onPreconnectionStart(List<Layer2PacketParcelable> packets) {}
}
+19 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ public class IpClientManager {
                    slot, KeepalivePacketDataUtil.toStableParcelable(pkt));
            return true;
        } catch (RemoteException e) {
            log("Error adding Keepalive Packet Filter ", e);
            log("Error adding NAT-T Keepalive Packet Filter ", e);
            return false;
        } finally {
            Binder.restoreCallingIdentity(token);
@@ -272,4 +272,22 @@ public class IpClientManager {
            Binder.restoreCallingIdentity(token);
        }
    }

    /**
     * Notify IpClient that preconnection is complete and that the link is ready for use.
     * The success parameter indicates whether the packets passed in by 'onPreconnectionStart'
     * were successfully sent to the network or not.
     */
    public boolean notifyPreconnectionComplete(boolean success) {
        final long token = Binder.clearCallingIdentity();
        try {
            mIpClient.notifyPreconnectionComplete(success);
            return true;
        } catch (RemoteException e) {
            log("Error notifying IpClient Preconnection completed", e);
            return false;
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -20,12 +20,14 @@ import static android.net.shared.IpConfigurationParcelableUtil.fromStableParcela

import android.content.Context;
import android.net.DhcpResultsParcelable;
import android.net.Layer2PacketParcelable;
import android.net.LinkProperties;
import android.net.NetworkStackClient;
import android.os.ConditionVariable;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;


/**
@@ -176,6 +178,12 @@ public class IpClientUtil {
            mCb.setNeighborDiscoveryOffload(enable);
        }

        // Invoked on starting preconnection process.
        @Override
        public void onPreconnectionStart(List<Layer2PacketParcelable> packets) {
            mCb.onPreconnectionStart(packets);
        }

        @Override
        public int getInterfaceVersion() {
            return this.VERSION;