Commit Graph

1701 Commits

Author SHA1 Message Date
Junyu Lai
e0873a4c09 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 38ec07ff9e am: 63fbab6e6a am: 99b7bcd09c am: 62229d3d33
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I2c5895c223a5843cfe11a1736a243b6847ad1b9a
2020-11-12 10:19:29 +00:00
junyulai
2fae9c3667 Add hardware tethering traffic in testTethering test
Test: atest com.android.server.net.NetworkStatsServiceTest#testTethering
Bug: 162292214
Change-Id: Ifec6bde5fd3231f2135f12536c42e42ec6b707de
2020-11-12 14:22:31 +08:00
junyulai
10b443adbb Remove unused getTetherStats
Before Android R, getTetherStats were used to collect tethering
iface stats of all clients who extends ITetheringStatsProvider,
which typically contains NetdTetheringStatsProvider and
OffloadController.

However, this always returns 0 since Android R, because:
  1. OffloadController implemented NetworkStatsProvider and no
     longer reports stats through getTetherStats.
  2. NetdTetheringStatsProvider always return 0 by design since
     non-offloaded iface tethering stats are already included
     in native iface stats.

This change is a no-op refactoring to remove unused
getTetherStats and update test which is not pratical.
Fix for offloaded tethering stats will be in follow-up CLs.

Test: atest FrameworksNetTests TetheringTests
Bug: 162292214
Change-Id: Icd0717c5c2807ae3bd98626b897e4b148f142815
2020-11-06 19:02:44 +08:00
Paul Hu
5202e6b0c3 Merge "Replace Context @hide APIs" am: f021a81854 am: 8fabfb25c3 am: fe50f2ab24 am: bbc5a2473f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458063

Change-Id: I5241814fffc4ef794c07abca748d650c720576eb
2020-11-05 09:51:13 +00:00
Paul Hu
3a7da1101b Merge "Replace AppOpsManager @hide APIs" am: 12e9b2ecb5 am: 0631c7bc98 am: 35e3902531 am: c34ced274a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1469126

Change-Id: I3edb79a9e05efb0c898a393a7ab98cd9d3305466
2020-11-05 09:50:51 +00:00
Paul Hu
f021a81854 Merge "Replace Context @hide APIs" 2020-11-05 08:05:09 +00:00
Paul Hu
12e9b2ecb5 Merge "Replace AppOpsManager @hide APIs" 2020-11-05 08:03:55 +00:00
Eran Messeri
5c91bdecce DO NOT MERGE: Introduce DPMS shim for active DO/PO check
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
2020-11-04 10:07:06 +00:00
paulhu
fa229ae8a5 Replace Context @hide APIs
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
2020-11-04 00:02:42 +08:00
paulhu
1c15b17d78 Replace AppOpsManager @hide APIs
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
2020-11-03 22:27:16 +08:00
Chalard Jean
863fb9b9d9 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-11-02 10:01:30 +09:00
Treehugger Robot
2e6e66df94 Merge "NetworkNotificationManager gets NotificationManager locally" am: a13966feea am: d0034c56c1 am: 0776d454a2 am: 29001506d8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459882

Change-Id: Ib82fdb4eb61b7d52e0011271da81c30606dbe3c3
2020-10-30 11:54:12 +00:00
Paul Hu
e5fcad7f3b Merge "Replace NotificationManager @hide APIs" am: 39516dec37 am: 9fead7cb6e am: 91bf3e71e3 am: 6818725de8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1452435

Change-Id: Iaf9363492fb24714750314765439a4edec7d948c
2020-10-30 05:04:17 +00:00
paulhu
13cafd92b9 NetworkNotificationManager gets NotificationManager locally
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
2020-10-30 03:37:50 +00:00
Paul Hu
39516dec37 Merge "Replace NotificationManager @hide APIs" 2020-10-30 03:36:40 +00:00
Xiao Ma
e75400be3d Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ" am: 780d3d2115 am: ee3d2e049d am: f7808179b4 am: c95be48120
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460265

Change-Id: I5c6bf738b8fc24c65e0ac256ed4b595cfb8a34fe
2020-10-29 07:28:15 +00:00
Xiao Ma
eeafbc5738 Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4 am: 8323b72ef0 am: c1d48c0444 am: 9180884b13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: I0c28f689e056dc4ac5d6750c9f5c74ce49c8a103
2020-10-29 07:27:51 +00:00
Chiachang Wang
1d6fc4f622 Merge changes I6a51d803,I162fae5c am: b75c584971 am: 18013cefe3 am: 2d6e0ab8e7 am: fa1fc27d9b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473228

Change-Id: I40ff3cfcb4dbe7dc036eaa87df2fa192aee3f016
2020-10-29 06:19:52 +00:00
Chiachang Wang
671a480929 Merge "Replace hidden NMS interface to network API" am: 689399aa75 am: 667b09128d am: cf129dae9f am: 054053a6ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473224

Change-Id: Id97da9dda9bed8c182ea2fcd92c79d94bc619d52
2020-10-29 06:19:30 +00:00
Xiao Ma
8323b72ef0 Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes""" am: ef20ba23a4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460264

Change-Id: Ie13b2bb8037d85ab4782e06cfc31e108397fc78b
2020-10-29 06:09:44 +00:00
Xiao Ma
780d3d2115 Merge changes from topic "revert-1353490-revert-1323251-ipv6_prov_loss_quirk_parcelable-DVBHZDYMHA-MDHWFKJABZ"
* changes:
  Add jarjar rule for IPv6ProvisioningLossQuirk.
  Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes"""
2020-10-29 05:39:16 +00:00
Chiachang Wang
b75c584971 Merge changes I6a51d803,I162fae5c
* changes:
  Replace hidden NMS API for setting MTU
  Replace hidden NMS default network configuration API
2020-10-29 05:03:43 +00:00
Chiachang Wang
689399aa75 Merge "Replace hidden NMS interface to network API" 2020-10-29 05:02:21 +00:00
paulhu
e7a50004d8 Replace NotificationManager @hide APIs
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
2020-10-28 16:24:37 +08:00
Chiachang Wang
a93ddb250b Replace hidden NMS interface to network API
Replace the hidden NMS addInterfaceToNetwork and
removeInterfaceFromNetwork with calling INetd directly for
incoming ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Test: manually connect and disconnect network
Change-Id: I0f1f866be2f8084b992b340aeabfb5d62420686b
2020-10-28 14:38:18 +08:00
Chiachang Wang
c1fe7a0a37 Replace hidden NMS default network configuration API
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
2020-10-28 14:38:18 +08:00
Xiao Ma
1cd2532d26 Add jarjar rule for IPv6ProvisioningLossQuirk.
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
2020-10-27 08:04:29 +00:00
Xiao Ma
ef20ba23a4 Revert "Revert "Test IPv6ProvisioningLossParcelable in the NetworkAttributes"""
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
2020-10-27 07:49:05 +00:00
Lucas Lin
752bba2382 Merge "Using Context#getSystemService instead of ServiceManager#checkService" am: d769b3863e am: bb6fc081c2 am: 884546597e am: c93771dde5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1463902

Change-Id: If50e3be30fa1ba34c945736ed9a8a83fbe122b48
2020-10-23 05:01:48 +00:00
lucaslin
f0d393d530 Using Context#getSystemService instead of ServiceManager#checkService
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
2020-10-23 03:07:07 +00:00
Chiachang Wang
4dae969c59 Merge "Do not use hidden SystemProperties.set" am: 93961f7b21 am: d7146b6742 am: b2d82398a6 am: 84ea88acb2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460971

Change-Id: Ie125f2d0d5605180189fa1dfbef70286ad79c23e
2020-10-21 08:31:09 +00:00
Chiachang Wang
93961f7b21 Merge "Do not use hidden SystemProperties.set" 2020-10-21 07:00:56 +00:00
Chiachang Wang
a6d08e9723 Merge "Remove unused MockableSystemProperties from DnsManager constructor" am: 3e23d7271b am: 250a9d3d20 am: 672ee3eef5 am: 67fcddf4f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466231

Change-Id: Id0b0b33e8156831222968ca68f289d206787d635
2020-10-20 21:22:27 +00:00
Chiachang Wang
c43d68f0d0 Do not use hidden SystemProperties.set
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
2020-10-20 19:35:01 +08:00
Chiachang Wang
6710686910 Remove unused MockableSystemProperties from DnsManager constructor
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
2020-10-20 15:46:30 +08:00
Aaron Huang
4a19a57729 Merge "Create service-connectivity.jar" 2020-10-20 06:09:41 +00:00
Yan Yan
85c79d51d4 Merge changes from topic "new-ipsec-api" am: 644a034eed am: e0dd7159d5 am: 24c72089d7 am: a818c55e65
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398433

Change-Id: I18748127d0c97d9473c96678d556b03ad6048808
2020-10-17 00:09:20 +00:00
Yan Yan
644a034eed Merge changes from topic "new-ipsec-api"
* changes:
  Expose new algorithms as public API
  Add new mandatory IPsec algorithms
2020-10-16 22:30:37 +00:00
Bernie Innocenti
26b8ea83f0 Merge "Stop setting the legacy net.dnsX system properties" am: 61da71aa03 am: ab60aa4add am: 5e29d0c679 am: d8422c8eb4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1229561

Change-Id: I78ef627fdf0312cf84de53aa8da5f0bca466a6f3
2020-10-16 15:23:18 +00:00
Aaron Huang
925d09b779 Create service-connectivity.jar
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
2020-10-16 22:46:14 +08:00
Chiachang Wang
e62f378b9c Stop setting the legacy net.dnsX system properties
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
2020-10-16 08:19:25 +00:00
Yan Yan
2274995a29 Add new mandatory IPsec algorithms
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
2020-10-15 17:35:17 -07:00
Aaron Huang
dfba5d17fe Create service-connectivity.jar
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: Ie732bfaf381404af0bb599ca2f421a96e7aa4257
2020-10-16 02:29:04 +08:00
Junyu Lai
4475546bb0 Merge "Support dynamically update IMSI" am: 2d74c2e267 am: e981a87c00 am: 36b8c1d919 am: a33114824f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418348

Change-Id: I5e5fc106aaab1b55302c38717cad9dbf1281baec
2020-10-13 04:46:38 +00:00
Junyu Lai
2d74c2e267 Merge "Support dynamically update IMSI" 2020-10-13 02:41:47 +00:00
junyulai
c822fe5e07 Support dynamically update IMSI
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
2020-10-12 15:31:02 +08:00
Lorenzo Colitti
052fe66496 Merge "Speculatively fix L2TP keepalive issues by reducing mtu" am: f67e00b803 am: d3bf9a15a0 am: 23a036cd42 am: e9e92b80ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1399646

Change-Id: Iba6098badc018fa64b1c5fc20177b97a81a2e685
2020-10-12 01:48:18 +00:00
Lorenzo Colitti
f67e00b803 Merge "Speculatively fix L2TP keepalive issues by reducing mtu" 2020-10-12 00:40:44 +00:00
Chiachang Wang
9611a3ad54 Merge "Update to positive logic to better match the method naming" am: 1c7bc039ea am: 37fc16ad0a am: 656901d024 am: 40bf5f95e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1450336

Change-Id: I111b7fa8eaecbec7e65357f7b9aa9b3f369d00c9
2020-10-07 10:19:15 +00:00
Chiachang Wang
8cdc2856b7 Update to positive logic to better match the method naming
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
2020-10-07 06:48:15 +00:00