Migrate away from AsyncChannel in NetworkAgent
Use two oneway binder interfaces instead. The interfaces post messages to handlers as was implemented before, but provide a more strictly defined interface, with less hops between NetworkAgent, AsyncChannel, and ConnectivityService. The actual public interface is the NetworkAgent @SystemApi: the binder interface is an internal implementation detail. Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk Bug: 173574274 Merged-In: Ie364ab50f416e7821e70f4539a881eea828e1256 Change-Id: Ie364ab50f416e7821e70f4539a881eea828e1256
This commit is contained in:
parent
090cbf27ab
commit
77b0c1c72c
1 changed files with 557 additions and 206 deletions
|
|
@ -61,6 +61,7 @@ import android.util.ArrayMap;
|
|||
import android.util.Log;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import com.android.connectivity.aidl.INetworkAgent;
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.internal.util.Preconditions;
|
||||
import com.android.internal.util.Protocol;
|
||||
|
|
@ -3287,9 +3288,9 @@ public class ConnectivityManager {
|
|||
@RequiresPermission(anyOf = {
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
|
||||
android.Manifest.permission.NETWORK_FACTORY})
|
||||
public Network registerNetworkAgent(Messenger messenger, NetworkInfo ni, LinkProperties lp,
|
||||
public Network registerNetworkAgent(INetworkAgent na, NetworkInfo ni, LinkProperties lp,
|
||||
NetworkCapabilities nc, int score, NetworkAgentConfig config) {
|
||||
return registerNetworkAgent(messenger, ni, lp, nc, score, config, NetworkProvider.ID_NONE);
|
||||
return registerNetworkAgent(na, ni, lp, nc, score, config, NetworkProvider.ID_NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3300,10 +3301,10 @@ public class ConnectivityManager {
|
|||
@RequiresPermission(anyOf = {
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
|
||||
android.Manifest.permission.NETWORK_FACTORY})
|
||||
public Network registerNetworkAgent(Messenger messenger, NetworkInfo ni, LinkProperties lp,
|
||||
public Network registerNetworkAgent(INetworkAgent na, NetworkInfo ni, LinkProperties lp,
|
||||
NetworkCapabilities nc, int score, NetworkAgentConfig config, int providerId) {
|
||||
try {
|
||||
return mService.registerNetworkAgent(messenger, ni, lp, nc, score, config, providerId);
|
||||
return mService.registerNetworkAgent(na, ni, lp, nc, score, config, providerId);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue