Merge "Add DHCP Rapid Commit FILS support." am: 488c2b03d7 am: 2000a1410f

am: 9b115791e5

Change-Id: I6e782e27e195d81e14269e12f715dce92052e604
This commit is contained in:
Xiao Ma
2019-12-05 00:42:35 -08:00
committed by android-build-merger
4 changed files with 55 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
/**
*
* 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;

View File

@@ -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) {}
}

View File

@@ -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);
}
}
}

View File

@@ -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;