Add a method to apply a set of network preferences to a user profile
Bug: 194332512
CTS-Coverage-Bug: 211133973
Test: CTS
Change-Id: I97730ea14e7c96922236fd77a591e5acadd875ba
To deprecated below netd binder interfaces and move the functionality to
tethering(connectivity) mainline module:
bandwidthAddNaughtyApp
bandwidthRemoveNaughtyApp
bandwidthAddNiceApp
bandwidthRemoveNiceApp
Expose updateMeteredNetwork{Allow, Deny}List APIs to support the caller
outside the module. Currently the two APIs are still call to INetd
binders. Once functionality is moved to mainline module, will switch to
use them.
Bug: 209935649
Test: m
Change-Id: I8df720935748c2587f91a7b760cfd5a93a0fa852
As API review feedback, setting allowed on restricted networks
should be by uid instead of package name for security reason.
Thus, update the getter/setter to return/accept set of uids.
Bug: 188085693
Test: atest FrameworksNetTests
Merged-In: I979bf98075e6c9c0ed7e891582843fddb62643cb
Change-Id: I979bf98075e6c9c0ed7e891582843fddb62643cb
- Rename [set|get]RestrictedAllowedApps to
[set|get]AppsAllowedOnRestrictedNetworks
- Remove the regex of validate package name check
Bug: 188085693
Test: m update-api && m
Change-Id: I07966fb66093523a67e1e6a1ecfa05cc399e22f2
To satisfy OEM's requests, setting mobile data preference
should be by uid. Thus, update the getter/setter to
return/accept set of uids that need to apply mobile data
preference.
Bug: 171872461
Test: atest FrameworksNetTests
Change-Id: Id44efd2a6d820867f4405426c91e65b9ef155898
This setting is OEM upstream requirement for third party apps
using restricted networks.
Bug: 185149952
Test: atests FrameworksNetTests
Change-Id: I5e16b46cf2935f38ee1e516bb8b85fa487cf9f61
Addresses API council feedback.
Bug: 184890428
Test: atest FrameworksNetTests CtsNetTestCases
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest on R device
Change-Id: Id7c68fbf56ee08fcad8e8e3aacf037fa1885936b
Update PrivateDnsMode from StringDef to IntDef because IntDef is
the normal way of representing multiple choices in public API.
Also update other related files.
Bug: 185311744
Test: 1. make update-api
2. atest FrameworksNetTests CtsNetTestCases CtsNetTestCasesLatestSdk
3. atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I23e7ec140066979726d769cabc5f7057bb2167e6
Merged-In: I23e7ec140066979726d769cabc5f7057bb2167e6
(Cherry-picked from ag/14227609)
Address API review feedback to:
- Rename NetworkAgent#setTeardownDelayMs to
NetworkAgent#setTeardownDelayMillis
- Use getters instead of fields in VpnTransportInfo
- Rename registerDefaultNetworkCallbackAsUid to
registerDefaultNetworkCallbackForUid in ConnectiivityManager
Bug: 183972850
Bug: 185246410
Fix: 184735863
Test: make update-api
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
Merged-In: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
Address API review feedback, ConnectivityManager#getAllNetworkStateSnapshot
should be pluralized so rename the method to getAllNetworkStateSnapshots
(cherry picked from ag/14221105)
Bug: 183972554
Test: make, FrameworksNetTests
FrameworksServicesTests
Merged-In: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
Change-Id: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
Both TcpRepairWindow and TcpKeepaliveController(user) are in the
connectivity module, so TcpRepairWindow doesn't need to be
the module-lib API. Thus, remove TcpRepairWindow from
module-lib API.
Bug: 172183305
Test: m update-api
Change-Id: I8fde726f8ad73637e6deab69ea83b3699bb2cf45
All API methods in TestNetworkManager require the MANAGE_TEST_NETWORKS
permission.
Fixes: 183972672
Test: m
Change-Id: Ic5929c24ea88d7259d367a81fec8f223a2e3ecb0
As there is no strong reason to keep the constructors module-lib, set
them as public API.
This is in response to API feedback.
Fixes: 183446251
Test: m
Change-Id: I01daa6f6f8095f7a4db94d1ca05f913166939df3
The callers cannot call the hidden APIs after ConnectivityManager
became a part of mainline module, so expose them for callers.
Also change the value of ACTION_PROMPT_PARTIAL_CONNECTIVITY,
ACTION_PROMPT_LOST_VALIDATION and ACTION_PROMPT_UNVALIDATED because
of API lint errors.
Bug: 172183305
Test: Check private DNS settings is normal, and test NO_INTERNET
notification can be shown normally.
Change-Id: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
Merged-In: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
- This will be visible only to apps with the NETWORK_SETTINGS
permissions (signature), and will be redacted for all other callers.
- This string is expected to be the same as set by
VpnService#setSession, and in general, VpnConfig.session. But it
will be a general API that Vpn.java can call when setting the
VpnTransportInfo.
- This string cannot be updated once the VPN NetworkAgent is connected.
Bug: 171872481
Test: atest ConnectivityServiceTest
atest VpnTransportInfoTest
atest android.net.cts.NetworkAgentTest
Change-Id: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d
Merged-In: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d
(cherry-picked from ag/14011912)
The Connectivity service will become the mainline module.
Therefore, remove the caller of using Connectivity's
hidden API outside the module and expose the required
connectivity API used in Jobscheduler.
Bug: 183456204
CTS-Coverage-Bug: 170598012
Test: atest JobStoreTest
Change-Id: Ie6bc81ff382fb242b98f35d28a96defc207c7987
Merged-In: Ie6bc81ff382fb242b98f35d28a96defc207c7987
(cherry-picked from ag/13946348)
This is similar to onBlockedStatusChanged(Network, boolean) but
it allows the callback holder to know the exact reason why
networking was blocked. It is useful to privileged system
components such as JobScheduler that are able to ignore some
blocked reasons but not others.
Also add a new BLOCKED_REASON_LOCKDOWN_VPN that is used when
networking is blocked because an always-on VPN is in
lockdown mode.
Also move BLOCKED_METERED_REASON_MASK to ConnectivityManager.
This is necessary because ConnectivityService must ensure that
the blocked status callbacks are correctly sent when meteredness
changes (e.g., a UID that is blocked on metered networks will
become unblocked on a network that becomes unmetered). In order
to do this it needs to know which reasons apply only on metered
networks.
Bug: 165835257
Test: unit tests in subsequent CLs in the stack
Change-Id: I647db4f5a01280be220288e73ffa85c15bec9370
This setting is OEM upstream requirement for mobile data
preferred apps feature.
Bug: 171872461
Test: atest FrameworksNetTests
Merged-In: Ic5e0515b2b948de3d333c8d8e073d0b15514562a
Change-Id: Iba17bf68cffbe39d1c08ad94364b41bbf851bf57
Have getter/setter methods for external modules that can
get/set the setting values.
Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: I82225a43f95e3e1d3e52c4e7a0fc541c0087292e
Change-Id: I61cb00216494e35b6e0dfe444b177cad36ad8afb
These constants will now be including all the reasons for why an
uid's network access can be blocked, instead of only the
restrictions that could be imposed by NPMS.
Bug: 183473548
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Merged-In: I4c544415e12adf442fd2415c371b1b70a39c3aa4
Change-Id: I6dcea43fbefa9eac8b5a971b822a5be5422a54b4
Have a new method in NetworkAgentConfig.Builder for Vpn to set
allowBypass.
Bug: 182963397
Test: m
Change-Id: I3f244464438325ee7f8a1b953d3fb28186293628
* changes:
TransportInfo: Add a generic redaction mechanism
Revert "Revert "Expose uids related APIs in NetworkRequest and N..."
Revert^2 "Replace the usage of UidRange"
This replaces the existing mechanism for redacting location sensitive
fields with a more extensible mechanism. Currently supported redactions
are for the following permissions:
i. ACCESS_FINE_LOCATION
ii. LOCAL_MAC_ADDRESS
iii. NETWORK_SETTINGS
Also, removed WifiInfo from ConnectivityServiceTest to reduce cross
dependencies on wifi code.
Bug: 156867433
Bug: 162602799
Test: atest android.net
Test: atest com.android.server
Change-Id: I2bb980c624667a55c1383f13ab71b9b97ed6eeab
Revert^2 "Add shims for NetworkRequest"
b72b3ca768fc25ef72dc78f1396b08447b8ef5c6
NetworkRequest is moving into the incoming connectivity mainline
module. The hidden setUids becomes inaccessible outside the
module. Shims for support cts in different API levels will need
to use it to verify the behavior of NetworkRequest. Thus, expose
it to the API surface.
Also, VPN uses getUids and setUids to control network
capabilities. Networkcapabilities is a part of incoming
connectivity mainline module but VPN is not. Thus, exposing these
two methods are needed to allow VPN to continue using it.
Test: make update-api
Bug: 172183305
Change-Id: I4b8e1aa558e3459a932535f9901f4ae86b0ecb67
Merged-In: I107c329d4d7130d488772166eae8b5e7aaa2ff04
Revert "Add shims for NetworkRequest"
Revert submission 1626206-replaceUidRange
Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...
Change-Id: I45e08f89533af0d6851add38fecb5c6c114615ae
The API is already used by settings and should be usable by setup
wizards. It is the only way for a caller outside of the system_server to
trigger the captive portal application.
The API is already CTS tested in android.net.cts.CaptivePortalTest.
Fixes: 182871577
Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest
Change-Id: Ie8d9a546b54524ba837715baa94a07d1f993d8d3
ConnectivityManager will be a part of incoming connectivity
mainline. Settings will no longer to access the hidden methods.
For those methods that accept the interaction from users, they
should be exposed as formal interface to allow the
functionality. Expose them to API surface.
Bug: 172183305
Test: make update-api
Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd