Introduce a shim into DevicePolicyManagerInternal &
DevicePolicyManagerService so that NetworkStatsAccessTest would not
diverge from internal development branches.
The DevicePolicyManagerService refactoring on the internal branch
removed isActiveAdminWithPolicy in favour of isActiveDeviceOwner and
isActiveProfileOwner.
These methods are being made available in AOSP for
NetworkStatsAccessTest.
Bug: 170459325
Test: atest NetworkStatsAccessTest
Change-Id: Ic7e0898989fb8222aaba2b35436765c04eb3250c
Connectivity service module is using some Context @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
Test: Manully check that receiving intent and starting activity
can work normally.
Change-Id: I0f5b53ce0da4e3fc0f927896e9a9e444048401bd
Connectivity service module is using some AppOpsManager @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: I51f66b64fcc3ebdbc2fddff8371eb8d9ff134137
It's confusing that NetworkNotificationManager uses
NotificationManager to put up notifcation which is passed from
ConnectivityService. And that NotificationManager should be
gotten from a context with UserHandle.ALL because the
notification should notify to all users. But the future developer
may not know this and pass incorrect NotificationManager
probably. Therefore, adjust the design that
NetworkNotificationManager will get NotificationManager locally.
Bug: 170593746
Test: atest FrameworksNetTests
Change-Id: Id65c998052b7b223171c5194ea46b49d7e84729d
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
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
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
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
Currently, NetworkStatsSubscriptionsMonitor will skip the
listener registration until the IMSI is available to deal
with SIM PIN locked case. However, this solution can only
handle the case that IMSI changes from/to null. And it also
relies on the assumption that IMSI never changes for a subId.
Thus, support dynamically update IMSI to handle IMSI changes
more robustly.
This patch also address leftover comments at ag/12400327.
Test: enable SIM PIN and manually test
Test: atest NetworkStatsSubscriptionsMonitorTest#testSubscriberIdUnavailable
Test: atest NetworkStatsSubscriptionsMonitorTest#testSubscriberIdChanged
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Bug: 160941101
Change-Id: I625a5b10ee4806f6fee99c2d9d6c5e7977ff785e
The method checkInterfacePresent seems that should return if the
interface is present or not, but it actually return an opposite
result. It may confuse the caller. E.g. The override method in
VpnTest assume it always returns true in the test. It will fail
the vpn start flow due to interface gone.
Bug: 169215213
Test: atest FrameworksNetTess
Change-Id: I3e9a64f0900336b8205674b94db68f090b4e9ff9
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.
Bug: 168868607
Test: m && atest NetworkStaticLibTests
Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c
This change reduces MTU/MRU values for racoon/pppd from 1400 to 1388 in
an attempt to fix keepalive issues experienced in the field.
Bug: 119076193
Test: Speculative change, original issues were not reproducible.
Change-Id: I7731503260fdc8bcbc6c5fcda6991ead6fb7c52e
This change updates the VPN state when IKEv2 sessions fail, and when
configuration errors occur.
Bug: 162289824
Test: Manual testing with IKEv2/PSK
Change-Id: I2e8c6f421d2898f97b0ac422b2276edf9ef923f1
In current design, crash has been generated when stop function
has been re-entered to catch unexpected behavior. However,
it is possible to re-enter stop function if the network
disconnection occurs after stopping.
Thus, skip stop if keepalive is already in stopping state.
Test: atest ConnectivityServiceTest#testNattSocketKeepalives \
--rerun-until-failure 60000
Bug: 167332570
Change-Id: Ic7068ad3dc990e957c37b8d87d48ebb6469b101f
Currently, if SIM is inserted but IMSI is not available, such
as SIM PIN locked state. Information of such SIM will still
be available but IMSI is not. Which makes
NetworkStatsSubscriptionMonitor failed to store IMSI locally
for later RAT type query. Hence, NETWORK_TYPE_UNKNOWN is
always returned for such SIM.
Skip the registration until the IMSI is available. This is safe
since there will be another onSubscriptionsChanged event when
that happens.
Test: enable SIM PIN and manually test
Test: atest NetworkStatsSubscriptionsMonitorTest#testSubscriberIdUnavailable
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Bug: 160941101
Merged-In: I408379b3c432d9e62e0837d6b4f6551cc7838e29
Change-Id: I408379b3c432d9e62e0837d6b4f6551cc7838e29
(cherry-picked from ag/12400327)
This reverts commit ab4ad20eef8cb3176801f3a2a08ae635d869fa53.
Reason for revert: Regression in SW. Bug:162499840
Change-Id: Ic93e762e41a728f66e200e5bc8e40ebe4c7b44f7
This reverts commit 29100e889200c6d74ee7a120a1c356e2c89e48e2.
Reason for revert: Regression in SW. Bug:162499840
Change-Id: I96bf28ffc9f2d8f3838cb6d2dac16f89a70177ed
This reverts commit 26263b3cd0f6855f6e38ab22da7d8e883133a5f4.
Reason for revert: Regression in SW. Bug:162499840
Change-Id: I0e846efcc4fc06b53d97b2007e0d8e8f97c6ac10
Currently, the callbacks of stopping were fired when stop procedure
is started, because the upper layer apps only care about the reason
of stopping instead of stopping result. Thus, there is no need to
wait for the result comes back. However, this behavior generates
races if apps want to re-start keepalive immediately since the
resources are not released yet.
Fix: 134891441
Fix: 140305589
Test: atest com.android.server.ConnectivityServiceTest#testPacketKeepalives \
--rerun-until-failure 1000
Change-Id: I987776a9211a50e964c4675b747bc10e203750f1
Add UidNetdPermissionInfo class to store netd permission info of
each uid. Use the bit mask for combining all netd permission into
one value which can update and get the uid permission easily.
Moreover, aosp/1340042 add carryover package info into this class
which centralizes all netd permissions relevant data.
Bug: 132784544
Test: atest FrameworksNetTests
Change-Id: I3b81ea2a5017e8f4d0d603144a33c9b08640d7ba