Commit Graph

1691 Commits

Author SHA1 Message Date
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
Eran Messeri
ab20969835 Refactoring: Use explicit methods for checking DO/PO
Do not use USES_POLICY_PROFILE_OWNER / USES_POLICY_DEVICE_OWNER.
Instead, use explicit methods for checking if the caller is
the Device Owner or Profile Owner.

USES_POLICY_PROFILE_OWNER is confusing since internally in the
DevicePolicyManagerService, it implied a Device Owner is also a
Profile Owner, which is not always what the caller expected.

This is the first phase of the refactoring, removing external calles'
dependency on these constants. The next phase will remove them
internally completely in favour of an implementation that
accesses mOwners directly.

There are no functional changes in this CL.

Bug: 163028934
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I57c8465d190a3b4b130d57fd622cc93eaeb9c717
2020-10-06 10:34:23 +01:00
TreeHugger Robot
59c9b6e8ef Merge "Revert "Move module utils to the module package."" 2020-10-02 03:54:37 +00:00
Hridya Valsaraju
33b04d38e6 Revert "Move module utils to the module package."
Revert "Move util classes to their destination package"

Revert "Move PacketReader and FdEventReader"

Revert "Move static utils to a module package"

Revert "Move static utils to a module package"

Revert submission 12698912-move_packetreader

Reason for revert: Broke presubmit on git_master, b/169861635
Reverted Changes:
If5d1e4a58:Move module utils to the module package.
I44ffaad3d:Move PacketReader and FdEventReader
I93e9cfd96:Move util classes to their destination package
Ia84d64130:Move static utils to a module package
Iaac2810c7:Move static utils to a module package

Change-Id: Ibbe59075cd7bc4c38e0707ea6ae3b3703b40986f
2020-10-01 20:12:46 +00:00
Benedict Wong
b29fb3654a Speculatively fix L2TP keepalive issues by reducing mtu
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
2020-09-28 20:55:55 -07:00
Chalard Jean
1ebc5306ab Merge "Move module utils to the module package." 2020-09-28 13:22:23 +00:00
Chalard Jean
9db4f74fb8 Move module utils to the module package.
Test: builds
Change-Id: If5d1e4a58fb2d6d9544e6d01995dabe445cf1f25
(cherry picked from commit 046bf639eb7728504be35e30e3dd49af3d029728)
2020-09-26 14:12:10 +09:00
Benedict Wong
fe2e477071 Merge "Provide more feedback to Settings when sessions fail" am: d8957b5481 am: abed0e275d am: 38c5012bfa am: 707f9b2d1e am: a8f5cba0d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1399645

Change-Id: I9a2a801100d3965d38e95c80ece5f4bc0b35cbc8
2020-09-25 19:51:16 +00:00
Benedict Wong
d8957b5481 Merge "Provide more feedback to Settings when sessions fail" 2020-09-25 17:25:02 +00:00
Benedict Wong
fdebd3d644 Provide more feedback to Settings when sessions fail
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
2020-09-24 23:32:09 -07:00
Junyu Lai
6f0864e3be Merge "Skip stop if keepalive is already in stopping state" am: 57b79f463d am: e1d31ea908 am: 4a3701853a am: 58caa343cb am: 01851b58ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1424190

Change-Id: I46a3c91dd56d806fc06388ad448bd641a0db0ae4
2020-09-24 04:52:57 +00:00