Loading api/system-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -3196,6 +3196,10 @@ package android.net { field public static final String EXTRA_PACKAGE_NAME = "packageName"; field public static final String EXTRA_PACKAGE_NAME = "packageName"; } } public class NetworkStack { field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK"; } public final class RouteInfo implements android.os.Parcelable { public final class RouteInfo implements android.os.Parcelable { ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); method public int getType(); method public int getType(); Loading api/test-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -669,6 +669,10 @@ package android.net { method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities); method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities); } } public class NetworkStack { field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK"; } public final class RouteInfo implements android.os.Parcelable { public final class RouteInfo implements android.os.Parcelable { ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); method public int getType(); method public int getType(); Loading core/java/android/net/NetworkStack.java +20 −0 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,9 @@ import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.ComponentName; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; Loading @@ -46,9 +48,22 @@ import java.util.ArrayList; * @hide * @hide */ */ @SystemService(Context.NETWORK_STACK_SERVICE) @SystemService(Context.NETWORK_STACK_SERVICE) @SystemApi @TestApi public class NetworkStack { public class NetworkStack { private static final String TAG = NetworkStack.class.getSimpleName(); private static final String TAG = NetworkStack.class.getSimpleName(); /** * Permission granted only to the NetworkStack APK, defined in NetworkStackStub with signature * protection level. * @hide */ @SystemApi @TestApi public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK"; /** @hide */ public static final String NETWORKSTACK_PACKAGE_NAME = "com.android.mainline.networkstack"; public static final String NETWORKSTACK_PACKAGE_NAME = "com.android.mainline.networkstack"; private static final int NETWORKSTACK_TIMEOUT_MS = 10_000; private static final int NETWORKSTACK_TIMEOUT_MS = 10_000; Loading @@ -66,12 +81,14 @@ public class NetworkStack { void onNetworkStackConnected(INetworkStackConnector connector); void onNetworkStackConnected(INetworkStackConnector connector); } } /** @hide */ public NetworkStack() { } public NetworkStack() { } /** /** * Create a DHCP server according to the specified parameters. * Create a DHCP server according to the specified parameters. * * * <p>The server will be returned asynchronously through the provided callbacks. * <p>The server will be returned asynchronously through the provided callbacks. * @hide */ */ public void makeDhcpServer(final String ifName, final DhcpServingParamsParcel params, public void makeDhcpServer(final String ifName, final DhcpServingParamsParcel params, final IDhcpServerCallbacks cb) { final IDhcpServerCallbacks cb) { Loading @@ -88,6 +105,7 @@ public class NetworkStack { * Create an IpClient on the specified interface. * Create an IpClient on the specified interface. * * * <p>The IpClient will be returned asynchronously through the provided callbacks. * <p>The IpClient will be returned asynchronously through the provided callbacks. * @hide */ */ public void makeIpClient(String ifName, IIpClientCallbacks cb) { public void makeIpClient(String ifName, IIpClientCallbacks cb) { requestConnector(connector -> { requestConnector(connector -> { Loading @@ -103,6 +121,7 @@ public class NetworkStack { * Create a NetworkMonitor. * Create a NetworkMonitor. * * * <p>The INetworkMonitor will be returned asynchronously through the provided callbacks. * <p>The INetworkMonitor will be returned asynchronously through the provided callbacks. * @hide */ */ public void makeNetworkMonitor( public void makeNetworkMonitor( NetworkParcelable network, String name, INetworkMonitorCallbacks cb) { NetworkParcelable network, String name, INetworkMonitorCallbacks cb) { Loading Loading @@ -153,6 +172,7 @@ public class NetworkStack { * the system server on devices that do not support the network stack module. The network stack * the system server on devices that do not support the network stack module. The network stack * connector will then be delivered asynchronously to clients that requested it before it was * connector will then be delivered asynchronously to clients that requested it before it was * started. * started. * @hide */ */ public void start(Context context) { public void start(Context context) { mNetworkStackStartRequested = true; mNetworkStackStartRequested = true; Loading packages/NetworkStack/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -41,4 +41,5 @@ android_app { "NetworkStackLib" "NetworkStackLib" ], ], manifest: "AndroidManifest.xml", manifest: "AndroidManifest.xml", required: ["NetworkStackPermissionStub"], } } No newline at end of file packages/NetworkStack/AndroidManifest.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" /> <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <!-- Signature permission defined in NetworkStackStub --> <uses-permission android:name="android.permission.MAINLINE_NETWORK_STACK" /> <!-- Launch captive portal app as specific user --> <!-- Launch captive portal app as specific user --> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.NETWORK_STACK" /> <uses-permission android:name="android.permission.NETWORK_STACK" /> Loading Loading
api/system-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -3196,6 +3196,10 @@ package android.net { field public static final String EXTRA_PACKAGE_NAME = "packageName"; field public static final String EXTRA_PACKAGE_NAME = "packageName"; } } public class NetworkStack { field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK"; } public final class RouteInfo implements android.os.Parcelable { public final class RouteInfo implements android.os.Parcelable { ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); method public int getType(); method public int getType(); Loading
api/test-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -669,6 +669,10 @@ package android.net { method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities); method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities); } } public class NetworkStack { field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK"; } public final class RouteInfo implements android.os.Parcelable { public final class RouteInfo implements android.os.Parcelable { ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int); method public int getType(); method public int getType(); Loading
core/java/android/net/NetworkStack.java +20 −0 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,9 @@ import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.ComponentName; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; Loading @@ -46,9 +48,22 @@ import java.util.ArrayList; * @hide * @hide */ */ @SystemService(Context.NETWORK_STACK_SERVICE) @SystemService(Context.NETWORK_STACK_SERVICE) @SystemApi @TestApi public class NetworkStack { public class NetworkStack { private static final String TAG = NetworkStack.class.getSimpleName(); private static final String TAG = NetworkStack.class.getSimpleName(); /** * Permission granted only to the NetworkStack APK, defined in NetworkStackStub with signature * protection level. * @hide */ @SystemApi @TestApi public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK"; /** @hide */ public static final String NETWORKSTACK_PACKAGE_NAME = "com.android.mainline.networkstack"; public static final String NETWORKSTACK_PACKAGE_NAME = "com.android.mainline.networkstack"; private static final int NETWORKSTACK_TIMEOUT_MS = 10_000; private static final int NETWORKSTACK_TIMEOUT_MS = 10_000; Loading @@ -66,12 +81,14 @@ public class NetworkStack { void onNetworkStackConnected(INetworkStackConnector connector); void onNetworkStackConnected(INetworkStackConnector connector); } } /** @hide */ public NetworkStack() { } public NetworkStack() { } /** /** * Create a DHCP server according to the specified parameters. * Create a DHCP server according to the specified parameters. * * * <p>The server will be returned asynchronously through the provided callbacks. * <p>The server will be returned asynchronously through the provided callbacks. * @hide */ */ public void makeDhcpServer(final String ifName, final DhcpServingParamsParcel params, public void makeDhcpServer(final String ifName, final DhcpServingParamsParcel params, final IDhcpServerCallbacks cb) { final IDhcpServerCallbacks cb) { Loading @@ -88,6 +105,7 @@ public class NetworkStack { * Create an IpClient on the specified interface. * Create an IpClient on the specified interface. * * * <p>The IpClient will be returned asynchronously through the provided callbacks. * <p>The IpClient will be returned asynchronously through the provided callbacks. * @hide */ */ public void makeIpClient(String ifName, IIpClientCallbacks cb) { public void makeIpClient(String ifName, IIpClientCallbacks cb) { requestConnector(connector -> { requestConnector(connector -> { Loading @@ -103,6 +121,7 @@ public class NetworkStack { * Create a NetworkMonitor. * Create a NetworkMonitor. * * * <p>The INetworkMonitor will be returned asynchronously through the provided callbacks. * <p>The INetworkMonitor will be returned asynchronously through the provided callbacks. * @hide */ */ public void makeNetworkMonitor( public void makeNetworkMonitor( NetworkParcelable network, String name, INetworkMonitorCallbacks cb) { NetworkParcelable network, String name, INetworkMonitorCallbacks cb) { Loading Loading @@ -153,6 +172,7 @@ public class NetworkStack { * the system server on devices that do not support the network stack module. The network stack * the system server on devices that do not support the network stack module. The network stack * connector will then be delivered asynchronously to clients that requested it before it was * connector will then be delivered asynchronously to clients that requested it before it was * started. * started. * @hide */ */ public void start(Context context) { public void start(Context context) { mNetworkStackStartRequested = true; mNetworkStackStartRequested = true; Loading
packages/NetworkStack/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -41,4 +41,5 @@ android_app { "NetworkStackLib" "NetworkStackLib" ], ], manifest: "AndroidManifest.xml", manifest: "AndroidManifest.xml", required: ["NetworkStackPermissionStub"], } } No newline at end of file
packages/NetworkStack/AndroidManifest.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" /> <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <!-- Signature permission defined in NetworkStackStub --> <uses-permission android:name="android.permission.MAINLINE_NETWORK_STACK" /> <!-- Launch captive portal app as specific user --> <!-- Launch captive portal app as specific user --> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.NETWORK_STACK" /> <uses-permission android:name="android.permission.NETWORK_STACK" /> Loading