This is needed by NetworkStatsService and
NetworkPolicyManagerService to utilize the snapshots of
information of networks that grabbed from ConnectivityService.
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I7e974ef7b23ba9ba6ee775eed9899b0c0e2eca55
This change migrates NetworkStatsService and related code to use
NetworkStateSnapshot which is used for replacing the NetworkState.
This patch also changes some formating which is suggested by
the linter.
Test: FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I547da8f411cb45bdadc376ac3cadf3f3c55bb282
UidRange is a data class that is an implementation detail of
Connectivity. Move it to the connectivity boundary.
Remaining usages of UidRange outside of Connectivity (in VPN) should be
migrated to other classes, like Range<Integer> or UidRangeParcel.
Bug: 181512874
Test: m
Change-Id: I6f2e3685ad1c07171dd90480d1e546329de8732d
Since NetworkState has UnsupportedAppUsage APIs that cannot
be changed, create another class for follow-up patches
to expose as system API.
Test: NetworkStateSnapshotTest
Bug: 174123988
Change-Id: I54ef872847f34166aa34a79f6178c90ac12b6c72
Adds support for tracking oemManagedNetwork types (OEM_PAID and
OEM_PRIVATE).
Bug: 174485293
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
NetworkStatsObserversTest NetworkStatsServiceTest NetworkIdentityTest
Test: verify that the bytes go up in PansTest app only when
`ping -I eth2 8.8.8.8` is run as root.
Change-Id: I78660a835f16265ba8e44bb84332c6633dd72b84
The one-line "parcelable X" files need to be imported by targets that do
not build against SDK (the SDK has prebuilt definitions), so prepare a
dedicated directory for them.
This avoids having users of the classes include the whole src/
directory, which could contain definitions for classes that are not part
of the public API, so should not be imported.
Also move back to frameworks/base/core some .aidl definitions that
were separated from their associated class.
Bug: 171540887
Test: m
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
Change-Id: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
This API is required to perform MOBIKE. This API allows an IPsec
peer to change the underlying network of its established IPsec
tunnel without re-establishing the tunnel.
Bug: 169855650
Test: atest IpSecManagerTunnelTest (new tests added)
Change-Id: Ifc8ad902cbfbe4ad07e715f2fef0faa1bf9d68f3
* changes:
[FUI07] Stop making NetworkState with NetworkInfo from external callers
[FUI06] Stop using NetworkInfo in NetworkState from external callers
This is achieved by:
1. Use legacy network type inside NetworkState to replace the
needs of referencing NetworkInfo.getType().
2. Let getAllNetworkState only return networks with isConnected()
equals true. This allows callers such as NPMS or NSS does not
have to reference to NetworkInfo.isConnected().
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I1c4eb08d18ca973eb8f41d06258872eabc0006b8
This is a partial cherry-pick of change:
I5eedb571c9d78862115dfdc5dae1cf2a35343580
for connectivity classes.
Bug: 170883422
Test: m
Merged-In: I5eedb571c9d78862115dfdc5dae1cf2a35343580
Change-Id: I7dc661863b73f4198ddb4f3a1566583d0f07db3c
This patch also removes the functionality of returning
original subscriberId in eng build since it is not really useful.
Test: atest NetworkIdentityUtilsTest
Bug: 174123988
Change-Id: I721457e571aa9403a2200b3e4261b4895e4f7a3e
This reverts commit 4715a5c382.
Reason for revert: not necessary, since VCN already has access to system APIs
Bug: 174606949
Test: revert with no conflicts
Change-Id: Ife2d0fc08c540265d52cdf930d0b6df005990ac8
Files that are planned to be part of the connectivity module are grouped
in packages/Connectivity, so they can be built separately and moved in
one operation with their history into packages/modules/Connectivity.
This places the files in the existing framework-connectivity-sources
filegroup instead of the current framework-core-sources filegroup. Both
are used the same way in framework-non-updatable-sources.
Bug: 171540887
Test: m
Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
1. Change raw arrays into lists according to API guidelines.
2. Write test.
3. Rename class to UnderlyingNetworkInfo.
4. Rename vpnIface to iface.
5. Make underlyingIfaces @NonNull in order to adapt new
unparceling code.
6. implement equals and hashCode for testing.
Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988
Change-Id: I405c21e57c4af8a12a9dd0a1749b9e6690f87045
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
1. Move VpnInfo to android.net
2. Add nullability annotations
3. Make members final
Bug: 174123988
Test: TH
Change-Id: I1530bb45d0e84c28c6deac33596bc686058afc0d
ConnectivityManager.createSocketKeepalive() will need to get
the socket resource ID as a parameter for creating a new
NattSocketKeepalive. ConnectivityManager is a part of incoming
ConnectivityService mainline, so expose getResourceId() as an
API since the hidden APIs are not accessible for a mainline
module. This API should not be exposed to apps, so make it a
MODULE_LIBRARIES system API.
Bug: 172183305
Test: make update-api
Change-Id: Ic0722352ea186fcb18a2d91cc3969f771fde9e86
This allows subsequent patches to remove the need of exposing
SSID in NetworkState.
Test: atest NetworkStatsServiceTest
Bug: 174123988
Change-Id: Ib9ab07c9610954c9a5de035a3aefbf6d0bb0b53b
Since IKE APIs to negotiate IPsec tunnel migration (MOBIKE) are
public, all IPsec tunnel APIs should also be public so that public
callers are able to create, manage and migrate IPsec tunnels
Bug: 174606949
Test: atest IpSecManagerTunnelTest
Change-Id: I86aec334cfc937953f9c2b411cc55862032aae4d
Using these generalized interfaces is more flexible, since it enables
us to pivot the implementation being used internally. In particular,
an upcoming CL will pivot them to use a more efficient alternative.
This is a no-op refactoring.
Bug: 176777285
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibd4717174cf1f136e9d5d80172ecb6e493265306
Have users of EthernetManager#addListener specify an Executor instead of
running callbacks on ConnectivityThread.
For existing clients, run callbacks on the common BackgroundThread.
This change in behavior is fine because addListener is not an API, the
threading model in Q was to run callbacks on the looper of the thread
that first created EthernetManager (so there is already no guarantee on
which thread is used), and the only users are in Settings.
ConnectivityThread is moving to a connectivity-specific JAR, so it
should not be used by external classes.
Bug: 174436414
Test: Ethernet client / tethering working
atest TetheringIntegrationTests
Change-Id: Ic9a959f89915329f79eeeaa0a210ad50811d1291
NetworkUtils is planned to move to a dedicated JAR for connectivity
classes, while NetworkUtilsInternal would stay in the
frameworks-minus-apex JAR, in the com.android.internal.net package.
Bug: 171540887
Test: m, boots, wifi working
atest FrameworksNetTests
Change-Id: I3d38d72ad23a4bf84af823c7baeb6fed25c0665f
Instead of setting NetworkIdentity.subscriberId only on telephony
networks, set it when provided on any network. At the moment only
telephony is expected to have a subscriberId in its NetworkState anyway,
and while there are plans for other network agents (wifi) to have a
subscriberId, it should also be set in that case.
This allows NetworkIdentity to stop depending on hidden network type
APIs to determine if the network is mobile.
Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I4f09987f8737d1801342eb5d6d7c2b9968b466b0
Remove usage of hidden NetworkType, transport APIs in toString()
implementations of metrics and data usage classes.
The toString implementations can log the transports or network type as
hex or raw indices. While slightly less readable, the metrics classes
and network type APIs are deprecated.
Bug: 174436414
Test: m
Change-Id: I79239a540b66dadd3bbe0a997960530878331358
The code is unused, and based on ConnectivityManager#startNattKeepalive,
which is deprecated.
Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I08c6c1baec668a304d971bb6f2328891a5611e6a
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.
sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java
Test: make
Exempt-From-Owner-Approval: No-op change
Merged-In: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
* changes:
Remove unused variables
Return offloaded traffic when querying from TrafficStats API
Add hardware tethering traffic in testTethering test
Remove unused getTetherStats
TrafficStats API are being used for querying realtime network
statistics for years. However, on certain devices, some network
traffic are produced by hardware components and not be
able to seen by kernel counters.
Thus, include statistics for those missing network traffic is
necessary. Note that the included statistics might be stale
since polling newest stats from hardware might impact system
health and not suitable for TrafficStats API use cases.
Test: atest FrameworksNetTests TetheringTests
Bug: 16229221
Change-Id: I6741c41cb5145ca8748f9b083b9c15e7e2735681
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
It is safe because these mandatory algorithms are already required
before new algorithms are added
It is also a quick fix to unblock b/171279612, whose root cause is
the device first sdk is wrong
Bug: 171279612
Test: atest CtsNetTestCases:IpSecManagerTest
Change-Id: I5b9d85b2bc8f13f54467c97160d138a4628265f7
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, getAllCollapsedRatTypes is used to retrieve
all RAT types which will be recorded into NetworkStatsService.
However, there is a missing part that 5G NSA virtual RAT type
is not added into this list. This makes callers such as statsd
do not aware of 5G NSA RAT type and missed to collect data
usage of it.
Test: atest NetworkStatsSubscriptionsMonitorTest#test5g
Test: adb shell cmd stats pull-source 10082
Test: ./out/host/linux-x86/bin/statsd_testdrive 10082
Test: atest UidAtomTests#testMobileBytesTransfer \
UidAtomTests#testMobileBytesTransferByFgBg \
UidAtomTests#testDataUsageBytesTransfer
Bug: 163021464
Change-Id: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
Merged-In: I0faeda20f0506a48ac1131b234c5fc40d95dfbe0
(cherry-picked from ag/12355984)
This is a partial cherry-pick of ag/10293594
Test: TH
Bug: 129082217
Merged-In: I726e74f5c63a6ed456cb13ea259b58c7a33bec76
Change-Id: I726e74f5c63a6ed456cb13ea259b58c7a33bec76
Avoid recording negative data by doing integer-based
math as much as possible, but switch to double-based
math if we detect that we'd end up causing an overflow.
Test :
- Builds, Boots
- High data throughput scenarios
- NetworkStatsHistoryTest, NetworkStatsCollectionTest,
NetworkStatsTest
Bug: 119527458
Change-Id: I55d4aa649bea3ae201ad513074ff2b71cb918dad