ConnectivityService mainline module cannot call the members
inside SystemNotificationChannels.java. So use the local defined
constants instead.
Bug: 172040168
Test: atest FrameworksNetTests
Test: Manual test NO_INTERNET, SIGN_IN, PARTIAL_CONNECTIVITY,
VPN_ALWAYS_ON notifications.
Change-Id: I223b207c4346e8239dee78e50dd2b0532a3e55b0
Modern network agents are supposed to have the following
lifecycle :
• Construct the agent
• Declare itself to connectivity by calling #register()
• Possibly do some setup
• Declare connected by calling #markConnected()
• Declare disconnected by calling #unregister()
Internally ConnectivityService still manages the state
with deprecated NetworkInfo, which has a lot of possible
detailed states, most of which are now unused. Internally,
the steps above translate to the states below :
• When the agent calls #register() it starts in state
CONNECTING
• When it calls #markConnected() it goes to CONNECTED
• When it calls #unregister() it goes to DISCONNECTED which
triggers the flow that disconnects it immediately
• ConnectivityService also synthesizes the SUSPENDED state
under some situations, but that's not relevant here.
The translation above is done by the NetworkAgent class,
which translates #register(), #markConnected() and
The only valid lifecyle for new agents is thus :
CONNECTING → CONNECTED → disconnect
↕ ↑
SUSPENDED ───┘
Note that in the above scheme, there is no space for the
UNKNOWN state, which is only used by legacy network agents.
However, the constructor for NetworkInfo still starts with
UNKNOWN. Ideally the constructor for NetworkInfo would set
the info to CONNECTING instead, but this would be a very
visible change in behavior affecting many apps (especially
their tests), so for backward compatibility we can't do
that.
New network agents however don't expose their NetworkInfo
to the client code, so they can just be made to start in
CONNECTING the way it was meant.
Note that this didn't really have a concrete impact beyond
printing some logs as by and large the ConnectivityService
code handles UNKNOWN and CONNECTING the same way, or more
exactly it handles transitions to CONNECTED from UNKNOWN
and CONNECTING in the same way. The exception to this is
VPNs, which are not using the new agent API yet, and the
upcoming conversion is why this fix is actually needed now.
Bug: 170904131
Test: FrameworksNetTests NetworkStackTests
Test: new test in aosp/1460705
Change-Id: Ib7d906a7b29a0b9f000b90bc78558a7402852fa3
Connectivity service module is using some NotificationManager
@hide APIs but they are not able to call after CS become a
mainline module. Thus, replace them with similar System APIs.
Bug: 170593746
Test: atest FrameworksNetTests
Change-Id: I2644867cfc01d8d651c7029134294a9d44fdb471
Replace the hidden setDefaultNetId and clearDefaultNetId NMS
APIs with accessing INetd directly for the incoming
ConnectivityService mainline.
Bug: 170598012
Test: atest FrameworksNetTests
Test: manually connect and disconnect wifi
Change-Id: I162fae5ca444207a037e5ac4bf8fa0a77a648ca1
Adding network capability to be used with networks to be only used by
OEM apps.
Bug: 171505922
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ib55ebec0e178b6317d92f17e1aff060dacdfb2b1
A new stable parcelable IPv6ProvisioningLossQuirk added in network
stack module, which is used to record the network quirk info which
causes IPv6 provisioning loss, e.g. the router lifetime in RA is 0
and the default route will be removed from LinkProperties.
Previously this change breaks CtsStrictJavaPackagesTestCases due to
a jarjar rule is missed. Also rename the package name based on the
revert change.
Also include slight stable AIDL package and variable rename.
Bug: 157534516
Test: atest CtsStrictJavaPackagesTestCases FrameworksNetTests
Change-Id: Ic2f6b75beefb574f7e2fb4c157667e7734eccd05
Test IPv6ProvisioningLossParcelable in the NetworkAttributes.
Bug: 157534516
Test: atest NetworkStackTests
This reverts commit_3740bfadadaaf268f92aaf35dd92e4ce432b39cb
Reason for revert:
Roll forward the previous change, as the CtsStrictJavaPackagesTestCases
breakage has been addressed by adding the jarjar rule in wifi module.
Change-Id: Ib4d70ce557cad98643c811b219f51e9b68179ee8
ConnectivityService is going to be a mainline module, it can only
use formal APIs or @SystemApi. So use public API -
Context#getSystemService() instead of hidden API -
ServiceManager#checkService().
Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I9824caa7aec57e70f0ba405fcce39f9bc068732d
Adds the necessary jarjar rules to FrameworksTestNet and
removes the test for CompareResult which has moved to its
right place.
Test: FrameworksTestNet
Change-Id: I50e51e72268e432a65a831aa5eebd606584ac721
ConnectivityService is going to become a mainline module, and
it will not able to use hidden method anymore. Thus, use
alternative new sysprop as API to control the tcp init rwnd
value.
Bug: 170917042
Test: adb shell getprop net.tcp_def_init_rwnd and check if
value is set correctly
Test: atest FrameworksNetTests
Change-Id: If9e99c88de50b6829721b0dfacc430a3b53c7728
DnsManager does not use MockableSystemProperties to communicate
with netd to configure the dns server anymore. ConnectivityService
does not need to take it into DnsManager as a parameter. Thus,
clean up the unused code.
Bug: 33308258
Test: atest FrameworksNetTests
Change-Id: I2ac89944391f7d1fd5d67f26cf7f2b11a4a4cf84
Create a new target service-connectivity to split
ConnectivityService from services.core.
Add ConnectivityServiceInitializer for initializing
ConnectivityService and add systemReady() in
ConnectivityManager so that SystemServer can call systemReady()
through ConnectivityManager which won't change current behavior.
Bug: 158268939
Test: make target-java, make host-java
atest FrameworksNetIntegrationTests
atest FrameworksNetTests
make, device can boot,
atest CtsStrictJavaPackagesTestCases
wifi and mobile data work.
Change-Id: I99401772ba9c1c34adca20040da3c7c72d86ddd9
Merged-In: Ie732bfaf381404af0bb599ca2f421a96e7aa4257
These have been locked down via SELinux for a while and thus
they should be safe to delete at this point.
Test: atest FrameworksNetTest
Bug: 33308258
Bug: 148724751
Change-Id: I3a1e9c6ad92c8d2367e0048e5d6cd7d06bbc6e80
LinkProperties.compare{Dnses,ValidatedPrivateDnses,AllRoutes,
AllInterfaceNames} actually have no users.
Test: LinkPropertiesTest
Change-Id: Ic54ab3c5520fbbc2be1309aeaf1e5a7857dbd194
This CL adds new mandatory IPsec algorithms and allows
OEM to enable them on old devices using resource overlay
Bug: 161716062
Test: FrameworksNetTests:IpSecAlgorithmTest
Change-Id: Ib827b05ea27dbe61b14ad236e858f825293ed994
Ensure that appropriate networking tests are triggered when submitting
changes in the frameworks/base directories.
Change-Id: Ibf8b567fa7721299120b0a6c6836dd770d92a9fc
Test: treehugger runs TEST_MAPPING tests
Connectivity service module is using some PendingIntent @hide
APIs but they are not able to call after CS becomes a mainline
module. Thus, replace them with similar System APIs.
Bug: 170593746
Test: atest FrameworksNetTests
Manually test notifications can show normally.
Change-Id: I92ab7216f5fd46d449b6d8f80d3441f8966ac890
It's soon going to be required for apps targeting S+ to specify
explicitly either FLAG_MUTABLE or FLAG_IMMUTABLE when creating
a PendingIntent. Thus, add a mutability flag to the
PendingIntent that doesn't specify it before.
Bug: 170602021
Bug: 170766590
Test: atest FrameworksNetTests
Change-Id: I56581033c0a1b450b6626112cdae5e5d9aac873f
ConnectivityService should not use ShellCommand since it's @hide
which does not accessible in mainline modules. Replace it with
system api for mainline.
Bug: 170598012
Test: adb shell cmd connectivity airplane-mode enable
Test: adb shell cmd connectivity airplane-mode disable
Change-Id: I47e7a371c19eb18eac643fe9a2ab481bec5743c2