OSDN Git Service

Implement TestNetworkService
authorBenedict Wong <benedictwong@google.com>
Thu, 15 Nov 2018 01:53:19 +0000 (17:53 -0800)
committerBenedict Wong <benedictwong@google.com>
Wed, 6 Mar 2019 23:37:52 +0000 (15:37 -0800)
commit6c24213d2e430eaf7d541814484510128800d90f
treef0901d4847a7c30abd2c1971d3f900a989069ead
parente40eab608af245357705852cdad52b6d615ff518
Implement TestNetworkService

This change adds the relevant JNI implementations, as well as the
implementations and NetworkAgent tracking code in the TestNetworkService.

TestNetworkService (And Manager) is designed for use exclusively in
testing code, allowing for the creation of TUN and IPsec backed networks
in test code. Specifically, this allows for testing of components such
as IP, DHCP, or DNS clients, as well as kernel features such as IPsec.

Access to the TestNetworkService will be conditioned upon the
MANAGE_TEST_NETWORKS permission that will be granted only to the Shell.
CTS will use UiAutomation.adoptShellPermissionIdentity() to gain the
ability to use this service.

Bug: 72950854
Test: CTS tests passing
Change-Id: Ie66ba631a548b5f9c6b5ed0797582f86688debe5
services/core/java/com/android/server/TestNetworkService.java
services/core/jni/Android.bp
services/core/jni/com_android_server_TestNetworkService.cpp [new file with mode: 0644]
services/core/jni/onload.cpp