Commit Graph

10218 Commits

Author SHA1 Message Date
Chiachang Wang
e07b484c22 Merge "Use system api for shell command handling" 2020-10-13 08:41:40 +00:00
Chiachang Wang
77ae8a0bca Use system api for shell command handling
ConnectivityService should not use ShellCommand since it's @hide
which does not accessible in mainline modules. Replace it with
system api for mainline.

Bug: 170598012
Test: adb shell cmd connectivity airplane-mode enable
Test: adb shell cmd connectivity airplane-mode disable
Change-Id: I47e7a371c19eb18eac643fe9a2ab481bec5743c2
2020-10-13 08:41:24 +00:00
Junyu Lai
59f6e81b10 Merge "Support dynamically update IMSI" 2020-10-13 02:41:47 +00:00
junyulai
430e11a9f0 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
7ade6140ea Merge "Speculatively fix L2TP keepalive issues by reducing mtu" 2020-10-12 00:40:44 +00:00
Treehugger Robot
4fb14d85ce Merge "Don't let NAW.mNetworkInfo escape" 2020-10-09 10:33:47 +00:00
Chalard Jean
ae98b5f35f Don't let NAW.mNetworkInfo escape
Thankfully this has no users.

This agent needs to be migrated to the modern API for
NetworkAgent, which does not have NetworkInfo at all
so this would be a hindrance

Test: FrameworksNetTests NetworkStackTests
Change-Id: I091a6ca8cdf18860f23832ae1008fa02cf0472e8
2020-10-09 17:06:30 +09:00
Remi NGUYEN VAN
39b995b2e1 Merge "Move IpUtils to frameworks/libs/net" 2020-10-09 00:13:40 +00:00
Paul Hu
19ef22905d Merge "Remove unused ACTION_PACKAGE_ADDED intent." 2020-10-08 02:05:17 +00:00
Chiachang Wang
974fc87852 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
paulhu
00cd326271 Remove unused ACTION_PACKAGE_ADDED intent.
ConnectivityService doesn't handle ACTION_PACKAGE_ADDED intent
now. So remove the intent from filter to prevent wtf log
happened.

Bug: 169573829
Test: atest FrameworksNetTests
Change-Id: Ifb0ae0b2e811defdecb37d3489ab3208db397331
2020-10-06 14:48:29 +08:00
Remi NGUYEN VAN
7f3a7512b5 Move IpUtils to frameworks/libs/net
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.

Bug: 168868607
Test: m && atest NetworkStaticLibTests
Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c
2020-10-05 14:38:19 +09:00
Benedict Wong
7d5baee37f 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
6194869dfb Merge "Provide more feedback to Settings when sessions fail" 2020-09-25 17:25:02 +00:00
Benedict Wong
20f3d02a1a 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
719a65577d Merge "Skip stop if keepalive is already in stopping state" 2020-09-24 02:45:09 +00:00
Bill Yi
5e81d0d348 Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" 2020-09-18 18:47:48 +00:00
Bill Yi
8469743b49 Merge mainline-release 6664920 to master - DO NOT MERGE
Merged-In: Id04ea331831e8b26ba99478848392b40a92548d5
Change-Id: I888da0c9475f2d00602d917d2f58169f8d7c93a4
2020-09-17 21:56:59 -07:00
junyulai
65f64a9731 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
Treehugger Robot
2a22f2d1d0 Merge "Remove a useless method" 2020-09-16 05:58:01 +00:00
Chalard Jean
563aaaba91 Remove a useless method
No seriously ?

Test: builds
Change-Id: Ie1508ce50a39e4c69a4b238067bab1e83ddaf019
2020-09-15 16:18:56 +09:00
Jeff Sharkey
9cf5f56268 Merge changes from topic "sep11"
* changes:
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
  Update language to comply with Android's inclusive language guidance
2020-09-14 21:52:13 +00:00
Jeff Sharkey
39f8e97c7a Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: If75259aab72329f9f8b0e1972a96370ca5134e2c
2020-09-14 10:00:10 -06:00
Jeff Sharkey
4610b32762 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
2020-09-14 09:59:01 -06:00
Junyu Lai
68bbf71c37 Merge "Handle lockdown VPN reset intent in ConnectivityService" 2020-09-14 03:14:51 +00:00
junyulai
d91e70589d Handle lockdown VPN reset intent in ConnectivityService
Currently, LockdownVpnTracker handles lockdown VPN reset intent.
Which will grab VPN object as a lock, then calls into
ConnectivityService to grab mVpn lock when querying NetworkInfo.
However, the order of grabing locks differs from ConnectivityService
and will causes deadlock if ConnectivityService grabs locks in
the other order.

Thus, make ConnectivityService handles reset intent so the
order of grabing locks can be consistent.

Test: atest FrameworksNetTests
Bug: 147403549
Change-Id: Ia10a3ef6f1e20d092a17313935083a84860961aa
2020-09-11 11:43:51 +08:00
Xin Li
a3e6d6bb64 Merge Android R
Bug: 168057903
Merged-In: Ice3e441cc9c0df8d0a6acc016bb74375e081bd67
Change-Id: I1d85742f594be2007c99841b290e502b6ede624e
2020-09-09 20:21:10 -07:00
Xin Li
37db1eb217 Merge RP1A.200720.011
Bug: 167588565
Merged-In: Iec7a26ecd68aca9c7a38cc8f441197a8237b0c8c
Change-Id: Ia8f5f008bc1f77115b644ab996aedc892fab68e7
2020-09-02 12:34:37 -07:00
Xin Li
6d805206fa Mark RP1A.200720.001 as merged
Bug: 167588565
Merged-In: I608df7327b8366fd365b11c6bdff9ed28fde99b0
Change-Id: Ie293ab2bcba5f778a7cac8476e226dc7c15e000f
2020-09-02 11:44:54 -07:00
Xin Li
4afc1e6669 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
c4aaac8af6 Merge "Notify the keepalive is stopped after the slot has been released" 2020-08-28 10:12:44 +00:00
Treehugger Robot
e26f9b879f Merge "Skip RAT type listener registration if IMSI is not available" am: 7d9554c8c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1409907

Change-Id: Ie24dee18456ee0741dbcd9330664398f0492c644
2020-08-25 20:27:30 +00:00
Treehugger Robot
7d9554c8c0 Merge "Skip RAT type listener registration if IMSI is not available" 2020-08-25 19:55:09 +00:00
junyulai
f91b0237fe 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
Paul Hu
f8f45a92f5 Merge "Revert "[RFPM03] Check permission by uid."" am: fc98e38215
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404654

Change-Id: I51b37f8e717123a2725ade859d5b9dcff19ef484
2020-08-20 08:33:41 +00:00
Paul Hu
d22d125329 Merge "Revert "[RFPM04] Adjust hasRestrictedNetworkPermission method"" am: c45d2d3848
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404653

Change-Id: I35fe76f9cfedf0619f64023e9111d9a50cc3c41c
2020-08-20 08:27:16 +00:00
Paul Hu
fc98e38215 Merge "Revert "[RFPM03] Check permission by uid."" 2020-08-20 08:24:30 +00:00
Paul Hu
c45d2d3848 Merge "Revert "[RFPM04] Adjust hasRestrictedNetworkPermission method"" 2020-08-20 08:14:48 +00:00
Paul Hu
6a6253cddd Merge "Revert "[RFPM05] Add UidNetdPermissionInfo class"" am: 07c54c9804
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404652

Change-Id: I8cef4a21aa8fd1923334c2a99e4ff2e864f516a5
2020-08-20 06:44:04 +00:00
Paul Hu
07c54c9804 Merge "Revert "[RFPM05] Add UidNetdPermissionInfo class"" 2020-08-20 06:25:06 +00:00
Paul Hu
9c60af3743 Revert "[RFPM03] Check permission by uid."
This reverts commit 8adb39a688.

Reason for revert: Regression in SW.  Bug:162499840

Change-Id: Ic93e762e41a728f66e200e5bc8e40ebe4c7b44f7
2020-08-20 06:23:16 +00:00
Paul Hu
b275ee6f41 Revert "[RFPM04] Adjust hasRestrictedNetworkPermission method"
This reverts commit de5b46c10b.

Reason for revert: Regression in SW.  Bug:162499840

Change-Id: I96bf28ffc9f2d8f3838cb6d2dac16f89a70177ed
2020-08-20 06:23:00 +00:00
Paul Hu
dfb26833f0 Revert "[RFPM05] Add UidNetdPermissionInfo class"
This reverts commit 1daf973605.

Reason for revert: Regression in SW.  Bug:162499840

Change-Id: I0e846efcc4fc06b53d97b2007e0d8e8f97c6ac10
2020-08-20 03:10:08 +00:00
junyulai
75125f2131 Notify the keepalive is stopped after the slot has been released
Currently, the callbacks of stopping were fired when stop procedure
is started, because the upper layer apps only care about the reason
of stopping instead of stopping result. Thus, there is no need to
wait for the result comes back. However, this behavior generates
races if apps want to re-start keepalive immediately since the
resources are not released yet.

Fix: 134891441
Fix: 140305589
Test: atest com.android.server.ConnectivityServiceTest#testPacketKeepalives \
      --rerun-until-failure 1000

Change-Id: I987776a9211a50e964c4675b747bc10e203750f1
2020-08-20 11:00:08 +08:00
Chalard Jean
05784f0a5a Merge "Rename Kotlin util files to not include the Kt suffix" am: 9f2f0ce903
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350084

Change-Id: I7e1f015c21d54591a1a25b5fa461e751bc707509
2020-08-13 04:09:27 +00:00
Chalard Jean
9f2f0ce903 Merge "Rename Kotlin util files to not include the Kt suffix" 2020-08-13 03:52:47 +00:00
Chiachang Wang
bafca91de9 Merge "Update language to comply with Android's inclusive language guidance" am: e559544470
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1379156

Change-Id: Iecf8601b2f9e286cefca0675476d0892436d5e5b
2020-08-12 09:52:30 +00:00
Chiachang Wang
e559544470 Merge "Update language to comply with Android's inclusive language guidance" 2020-08-12 09:30:11 +00:00
Paul Hu
e173360f82 Merge "[RFPM05] Add UidNetdPermissionInfo class" am: 829abbcb31
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1322556

Change-Id: I91a603d8b37ee750c3f582363bec94977d70014e
2020-08-12 06:37:34 +00:00
Paul Hu
829abbcb31 Merge "[RFPM05] Add UidNetdPermissionInfo class" 2020-08-12 06:17:46 +00:00