Commit Graph

1630 Commits

Author SHA1 Message Date
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
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
Chalard Jean
c029c1e928 Merge "Add a test for starting the legacy VPN." 2020-08-06 12:50:50 +00:00
Chalard Jean
180d580dc2 Resolve the endpoint in legacy VPN
This adds code to resolve the endpoint in the legacy VPN
runner if it was specified as a hostname, and enables the
previously added test that was disabled because this was
broken until this patch. See the linked bug for details.

This patch uses the async DNS API to do the resolution.
This lets the resolution be fully cancellable, though the
code is more complex than with the non-interruptible
getByName.

Test: VpnTest and in particular VpnTest#testStartRacoon
      Fixes the test meant to test this
      Also manual testing that resolution of a real
      hostname works as expected, that failure to resolve
      returns correctly, and that cancellation/interruption
      will unblock the thread and terminate immediately.
Bug: 158974172
Change-Id: I714985f3c7919dad9c1854830c50f29c1f94a21e
2020-08-06 17:29:59 +09:00
Chalard Jean
ceacf96547 Add a test for starting the legacy VPN.
The legacy VPN has, among many parameters, a host to connect to.
This host can be specified as a numeric address, or as a hostname.
When it's a name, resolution is required. Currently, name
resolution is performed by the native VPN daemons racoon and
mtpd. When a hostname is used, the framework does not know the
IP address of the VPN server and does not add a throw route for
the VPN server IP address. On older kernels this does not matter
because the legacy PPP kernel code binds the PPP socket to the
right network, but on newer devices that use the upstream PPP
code, this does not work. See b/133797637.

This patch instruments the legacy VPN code so that it can be
run in tests, and uses this instrumentation to simulate passing
a configuration that contains a host, and verifies that the
arguments passed to the mptd and racoon daemons receive the
expected server address, and that the expected throw route is
correctly installed.
It then adds two tests : one specifying the server as a numeric
address, and one as a hostname. As the resolution is currently
broken, the latter of these tests is added disabled, and the
followup fix to the issue enables it.

This test is basic and very targeted, but it's what we need right
now. Also there are plans to remove this entire code path in S, so
the test being ad-hoc is not much of a problem.

Test: this
Bug: 158974172
Change-Id: I420b63db03a58e8c67a98a85c9f4c2d6ed7ad078
(cherry picked from commit 45846a03051a13d667732288e457eab4336a691e)
2020-08-06 17:16:00 +09:00
Paul Hu
067f1a64a9 Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" am: cb4e4712b8 am: 296741de68 am: 715a48b386 am: 0f9b51cb06 am: 8ac1f7d5de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1321322

Change-Id: I6b0e7531effbb8c627697b3d7c475de3394b7f52
2020-08-03 12:20:18 +00:00
Paul Hu
715a48b386 Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" am: cb4e4712b8 am: 296741de68
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1321322

Change-Id: Id91c6de75e524080d15e2508007d5de997c7fd92
2020-08-03 11:18:31 +00:00
Paul Hu
cb4e4712b8 Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" 2020-08-03 10:37:52 +00:00
Peter Wang
617ea90340 Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" 2020-07-31 08:43:44 +00:00
Chalard Jean
2090fe9e2a Merge "Move utils from network stack to libs." am: 21be4fabb5 am: d065a0a4e6 am: 642beae1fd am: 475d83afd8 am: af3cafb891
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: I55c36bb60ea81f86daa193e9dff738846984e1e7
2020-07-31 01:34:46 +00:00
Chalard Jean
642beae1fd Merge "Move utils from network stack to libs." am: 21be4fabb5 am: d065a0a4e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: Ia163bc416e16ce56fc96855c1111a9905b712843
2020-07-31 01:09:46 +00:00
Chalard Jean
2156153db4 Move utils from network stack to libs.
This package is using some common utilities from
a library that used to live in the network stack.
A better home for these utilities is frameworks/libs,
so this topic moves the files ther and also changes
the package of some utilities.

See aosp/1350222 and aosp/1350182 for a detailed
description of the specific files that moved.

Test: checkbuild
Change-Id: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
2020-07-29 21:15:48 +09:00
Paul Hu
35c33c109b Merge "[RFPM03] Check permission by uid." am: 629f681106 am: 31dd6c3fd7 am: d091e8ff6e am: 405271b652 am: 5280e52f78
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1320375

Change-Id: Iee10248986fe1bda9fa97e6ae387e5ca4ec557c6
2020-07-29 06:46:16 +00:00
paulhu
bfa9f182b0 [RFPM04] Adjust hasRestrictedNetworkPermission method
There are two parts in hasRestrictedNetworkPermission method.
One is carryover package check and one is uid permission
check. Seperate carryover package check part to another method
to be clearer the usage of hasRestrictedNetworkPermission method.

Bug: 132784544
Test: atest FrameworksNetTests
Change-Id: Iab0609fcaa52acb0dfcb31ca957f22bfe8d62392
2020-07-29 14:14:27 +08:00
Paul Hu
d091e8ff6e Merge "[RFPM03] Check permission by uid." am: 629f681106 am: 31dd6c3fd7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1320375

Change-Id: I80406643e4797b1e269b4f7c5711339371fa533b
2020-07-29 05:53:25 +00:00
Paul Hu
629f681106 Merge "[RFPM03] Check permission by uid." 2020-07-29 05:41:32 +00:00
Junyu Lai
0806839c8c Merge "Gracefully handle integer overflows." am: 71fdf4ab8d am: 10c70fd2dd am: 42a12b57f2 am: 811fee2a2a am: 2f5d9400f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1316217

Change-Id: I7c04b66f75f64c214bd0c8d27bb5dbeda13094ce
2020-07-29 02:58:33 +00:00
Junyu Lai
42a12b57f2 Merge "Gracefully handle integer overflows." am: 71fdf4ab8d am: 10c70fd2dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1316217

Change-Id: I0bba17d0367ebf4e1c868a8cc7471366bc7a4408
2020-07-29 01:55:23 +00:00
Junyu Lai
71fdf4ab8d Merge "Gracefully handle integer overflows." 2020-07-29 01:19:07 +00:00
Chiachang Wang
d3bd1a5cf2 Merge "Update language to comply with Android's inclusive language guidance" am: 7c1142d4ad am: 261dd20290 am: f61e400585 am: 0b63167552 am: 1411f69053
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1373160

Change-Id: Ideecaaaa12e82c5771e75d0c743228f6478e1ca3
2020-07-28 12:03:04 +00:00
Chiachang Wang
f61e400585 Merge "Update language to comply with Android's inclusive language guidance" am: 7c1142d4ad am: 261dd20290
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1373160

Change-Id: I9318abb0233e7b8847466914724eeaae769ea9c8
2020-07-28 11:19:47 +00:00