Commit Graph

1649 Commits

Author SHA1 Message Date
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
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
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
Paul Hu
bddd412feb Merge "Revert "[RFPM04] Adjust hasRestrictedNetworkPermission method"" 2020-08-20 08:14:48 +00:00
Paul Hu
99653eada1 Merge "Revert "[RFPM05] Add UidNetdPermissionInfo class"" am: 324af52c7a am: 701cd3908e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404652

Change-Id: I9edf5bfaa9cbc037e87f5781ba07a2c87932f3aa
2020-08-20 07:04:43 +00:00
Paul Hu
324af52c7a Merge "Revert "[RFPM05] Add UidNetdPermissionInfo class"" 2020-08-20 06:25:06 +00:00
Paul Hu
fe640c8708 Revert "[RFPM03] Check permission by uid."
This reverts commit f1e343c1c3.

Reason for revert: Regression in SW.  Bug:162499840

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

Reason for revert: Regression in SW.  Bug:162499840

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

Reason for revert: Regression in SW.  Bug:162499840

Change-Id: I0e846efcc4fc06b53d97b2007e0d8e8f97c6ac10
2020-08-20 03:10:08 +00:00
junyulai
72d2bd016b 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
Junyu Lai
0784a6c992 Merge "Skip RAT type listener registration if IMSI is not available" 2020-08-20 02:20:31 +00:00
junyulai
ee98d66dea 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
Change-Id: I408379b3c432d9e62e0837d6b4f6551cc7838e29
2020-08-19 15:15:51 +08:00
Chalard Jean
991b07f8bc Merge "Rename Kotlin util files to not include the Kt suffix" am: 6a8da60a32 am: 97cda73a1c am: 97c4e1a647 am: bda6506a01 am: a9b3729c3a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350084

Change-Id: I89b50df2ea418f609d4ce7919f3154f54a1379b1
2020-08-13 05:14:14 +00:00
Chalard Jean
97c4e1a647 Merge "Rename Kotlin util files to not include the Kt suffix" am: 6a8da60a32 am: 97cda73a1c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350084

Change-Id: I6362695120ea8669e1da84bb686e886b85efd6a3
2020-08-13 04:26:11 +00:00
Chalard Jean
6a8da60a32 Merge "Rename Kotlin util files to not include the Kt suffix" 2020-08-13 03:52:47 +00:00
Chiachang Wang
6c1c1023e3 Merge "Update language to comply with Android's inclusive language guidance" am: 64f9851e3a am: 6afddeb044 am: 148be57009 am: 3db81f877e am: 89e9d75d7d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1379156

Change-Id: Ib455b42f7f360b75a295f86fd5166125fd0f69aa
2020-08-12 10:58:30 +00:00
Chiachang Wang
148be57009 Merge "Update language to comply with Android's inclusive language guidance" am: 64f9851e3a am: 6afddeb044
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1379156

Change-Id: Ibe13b2dad841e2ade2762558d1c3978a89cb825d
2020-08-12 10:10:11 +00:00
Chiachang Wang
64f9851e3a Merge "Update language to comply with Android's inclusive language guidance" 2020-08-12 09:30:11 +00:00
Paul Hu
1bd1ccded2 Merge "[RFPM05] Add UidNetdPermissionInfo class" am: 255bf95e97 am: 1cc0664651 am: e09d3ece31 am: f00246ed26 am: b3ab880007
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1322556

Change-Id: Ibf808ce55a63335a287c34fefee8a0bf50105db4
2020-08-12 07:42:57 +00:00
Paul Hu
e09d3ece31 Merge "[RFPM05] Add UidNetdPermissionInfo class" am: 255bf95e97 am: 1cc0664651
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1322556

Change-Id: I0878281e2033f093f3b9cbf608c30c44bdd99278
2020-08-12 06:53:13 +00:00
Paul Hu
255bf95e97 Merge "[RFPM05] Add UidNetdPermissionInfo class" 2020-08-12 06:17:46 +00:00
Chiachang Wang
e6a0a2b6b9 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code
for reference.

Bug: 161896447
Test: m ; atest FrameworkNetTests
Change-Id: Ib6b4c9526992c31e05e82be80e2b9b86bc0b57ef
2020-08-12 12:23:59 +08:00
paulhu
fbc1f34c22 [RFPM05] Add UidNetdPermissionInfo class
Add UidNetdPermissionInfo class to store netd permission info of
each uid. Use the bit mask for combining all netd permission into
one value which can update and get the uid permission easily.
Moreover, aosp/1340042 add carryover package info into this class
which centralizes all netd permissions relevant data.

Bug: 132784544
Test: atest FrameworksNetTests
Change-Id: I3b81ea2a5017e8f4d0d603144a33c9b08640d7ba
2020-08-12 10:33:18 +08:00
Chalard Jean
e47850dbf2 Rename Kotlin util files to not include the Kt suffix
Callers don't care what language the utilities are written in

Test: builds
Change-Id: Ie212144f36c50db223c05f3fcb6bad745842cb5e
2020-08-12 10:02:50 +09:00
Chalard Jean
4f1881be11 Merge "Resolve the endpoint in legacy VPN" am: c0f31b35d0 am: 0317f66f27 am: 1b74706c24 am: 0bfc7ad392 am: 9d287e8d24
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382496

Change-Id: I90bec6d85706fa9b2f9a01f81701138a54347005
2020-08-06 17:12:16 +00:00
Chalard Jean
ebd815af23 Merge "Add a test for starting the legacy VPN." am: c029c1e928 am: 0cc2c0d906 am: 48ac26604f am: e2bfd0071b am: f2fff2dd40
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372896

Change-Id: I96f4bbb9b109e3e5813d083bed1989d88fb156b8
2020-08-06 17:11:25 +00:00
Chalard Jean
1b74706c24 Merge "Resolve the endpoint in legacy VPN" am: c0f31b35d0 am: 0317f66f27
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382496

Change-Id: If649ab2763c9971c25af7732b32e97bfd50fb6f0
2020-08-06 16:06:20 +00:00
Chalard Jean
48ac26604f Merge "Add a test for starting the legacy VPN." am: c029c1e928 am: 0cc2c0d906
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372896

Change-Id: Idc49c61cc0547cdabe37cfa19b685c2beeda473b
2020-08-06 16:06:08 +00:00
Chalard Jean
c0f31b35d0 Merge "Resolve the endpoint in legacy VPN" 2020-08-06 12:51:50 +00:00