Commit Graph

1247 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
junyulai
e30a5c2730 Skip stop if keepalive is already in stopping state
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
2020-09-17 19:51:34 +08:00
Xin Li
4037c36d47 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Junyu Lai
37f7a3e160 Merge "Notify the keepalive is stopped after the slot has been released" am: 09a0f57f87 am: b5e1feccbe am: d1804f87dc am: c1d0f670f5 am: 0453d9b955
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1112851

Change-Id: I86b9c01f99eaa9497acbd4e3e481c7330cf05667
2020-08-28 12:30:17 +00:00
Junyu Lai
d1804f87dc Merge "Notify the keepalive is stopped after the slot has been released" am: 09a0f57f87 am: b5e1feccbe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1112851

Change-Id: Icdd61fb39ebd14963f4ec6e591b3a245e6b999b2
2020-08-28 11:09:43 +00:00
Junyu Lai
09a0f57f87 Merge "Notify the keepalive is stopped after the slot has been released" 2020-08-28 10:12:44 +00:00
TreeHugger Robot
f5b68cda29 Merge "Deprecated UserManager.getUsers(excludeDying) / added getAliveUsers()" 2020-08-26 05:37:22 +00:00
Treehugger Robot
b54db4b9fa Merge "Skip RAT type listener registration if IMSI is not available" am: 1e9c48bfec am: a2f81d1442
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1409907

Change-Id: I34de6bc6dd862f8042489f60f4b6be76af7c961e
2020-08-25 20:49:04 +00:00
Treehugger Robot
1e9c48bfec Merge "Skip RAT type listener registration if IMSI is not available" 2020-08-25 19:55:09 +00:00
junyulai
8c91a5f6cf Skip RAT type listener registration if IMSI is not available
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)
2020-08-25 18:03:38 +08:00
Felipe Leme
72eeb557e7 Deprecated UserManager.getUsers(excludeDying) / added getAliveUsers()
The existing method is confusing (the argument used to be called
includeDying) and it puts the burden on the caller (which need to
understand what the parameter means).

Furthermore:

- The majority of calls are for getUsers(excludeDying=true).
- The calls for getUsers(excludeDying=false) are equivalent to
  calls to getUsers()

Test: m
Test: a VpnTest ConnectivityServiceTest PermissionMonitorTest

Bug: 157921703
Change-Id: Ife767a40b7b7790ba28b5377046de822ddbf275c
2020-08-24 16:19:26 -07:00
Paul Hu
f343f4cb68 Merge "Revert "[RFPM03] Check permission by uid."" am: 0925015de5 am: b2982a0643 am: ab51b37a2b am: d001d445d5 am: d68ba4feaf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404654

Change-Id: I3f6108034a4dfcbae9e5d5cf466e924229f33965
2020-08-20 09:48:16 +00:00
Paul Hu
60af908939 Merge "Revert "[RFPM04] Adjust hasRestrictedNetworkPermission method"" am: bddd412feb am: 9f33dbb509 am: 9ea57d25d8 am: a370cac809 am: 8fa30d7651
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404653

Change-Id: Id24e6a79676aebfcc61f9b507ad8fca25b35b424
2020-08-20 09:47:22 +00:00
Paul Hu
ab51b37a2b Merge "Revert "[RFPM03] Check permission by uid."" am: 0925015de5 am: b2982a0643
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404654

Change-Id: I393e91873923d7b6601d4e8c863cca6986f66f23
2020-08-20 08:52:04 +00:00
Paul Hu
9ea57d25d8 Merge "Revert "[RFPM04] Adjust hasRestrictedNetworkPermission method"" am: bddd412feb am: 9f33dbb509
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404653

Change-Id: Ifa19cb8fce8dca66ac5f4ecc7737c1c095b7b35b
2020-08-20 08:51:45 +00:00
Paul Hu
892a312be5 Merge "Revert "[RFPM05] Add UidNetdPermissionInfo class"" am: 324af52c7a am: 701cd3908e am: 99653eada1 am: a484db66e9 am: 5a93858eb3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404652

Change-Id: I10a4be2a1b88ddcc67d0b3467f9288b9c36f3b18
2020-08-20 08:27:03 +00:00
Paul Hu
0925015de5 Merge "Revert "[RFPM03] Check permission by uid."" 2020-08-20 08:24:30 +00:00