Commit Graph

27 Commits

Author SHA1 Message Date
Lorenzo Colitti
66d8c7028c Merge "Allow unprivileged NetworkCallbacks to see other UIDs' networks." into sc-dev am: 846ae25be5 am: 30a5c3cca5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14597477

Change-Id: Icf9516c8f236d6e53f4816c7be67686498d25e4b
2021-05-19 23:49:05 +00:00
Paul Hu
de804f11da Merge "Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer" am: accfb247b2 am: 993aaedf1e am: 21860ce119
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689573

Change-Id: Ie76502bc49a20ceafc9ab9a6a448a0b1a178b37a
2021-05-19 22:49:34 +00:00
Paul Hu
9bea12fcda Merge "Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor" am: dec7232c75 am: 6d8b78770a am: 70c7639228
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689572

Change-Id: I6bfca3977345a57da6dc7938911fa3e26ea543e8
2021-05-19 22:48:36 +00:00
Junyu Lai
de07af947a Merge changes I3ba50cbd,I970ee365 am: 260b398281 am: c3fde912c6 am: ae76c2c199
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620859

Change-Id: I9ce9369b30bc568a63321de8764bd49c263b9ea6
2021-05-19 22:47:04 +00:00
Nikita Iashchenko
1cc81ac920 Move IoUtils#deleteContents from CorePlatformApi set to framework
As a part of internal core libraries cleanup move usages of
IoUtils#deleteContents from CorePlatformApi set to framework.

Bug: 154796679
Test: m update-api
Change-Id: If7037029026b6753ab64be09aa52c40e04d5c7b1
(cherry picked from commit 09b5e4a00f)
2021-05-19 14:40:05 -07:00
Lorenzo Colitti
30a5c3cca5 Merge "Allow unprivileged NetworkCallbacks to see other UIDs' networks." into sc-dev am: 846ae25be5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14597477

Change-Id: I83b704af8a5ee4a132030e973d301539c2e57fc3
2021-05-18 07:12:50 +00:00
Lorenzo Colitti
d82c1ec110 Allow unprivileged NetworkCallbacks to see other UIDs' networks.
Currently, unprivileged apps can call getAllNetworks() to see
all networks on the system, even networks that do not apply to
them. Allow them to do this via NetworkCallbacks as well.

This is the last piece of information that was only available
through getAllNetworks, so this CL deprecates that API.

Bug: 187921303
Test: new unit tests
Test: CTS test in other CL in topic
Change-Id: I30f1021927d3c8eae6525116c61ff4a4acecff6d
2021-05-18 12:24:07 +09:00
Paul Hu
21860ce119 Merge "Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer" am: accfb247b2 am: 993aaedf1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689573

Change-Id: Ide30d62481724f0c93b6302ddc871ef7fe10cfd8
2021-05-17 08:06:08 +00:00
Paul Hu
accfb247b2 Merge "Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer" 2021-05-17 06:45:52 +00:00
Paul Hu
70c7639228 Merge "Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor" am: dec7232c75 am: 6d8b78770a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689572

Change-Id: I216224011720d64316b9801ef54859b8de2bdb89
2021-05-17 03:52:42 +00:00
Paul Hu
dec7232c75 Merge "Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor" 2021-05-17 03:04:59 +00:00
paulhu
0d9553a5c1 Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer
PermissionMonitor register APPS_ALLOWED_ON_RESTRICTED_NETWORKS
setting observer to listen setting changed callback. Then update
or revoke permission for those apps.

Bug: 185149952
Test: atest FrameworksNetTests
Change-Id: I4b6a21bd3f47b7bcaac36fcabf1202a5a84a4520
2021-05-16 15:52:36 +00:00
paulhu
5d847b19cd Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting from PermissionMonitor
Let PermissionMonitor read APPS_ALLOWED_ON_RESTRICTED_NETWORKS
setting and grant netd system permission to uids whose package
name is listed in setting.

Bug: 185149952
Test: atest FrameworksNetTests
Change-Id: I856b545c0339a262abbe9d432cfda125bc82dc12
2021-05-16 23:48:55 +08:00
Junyu Lai
ae76c2c199 Merge changes I3ba50cbd,I970ee365 am: 260b398281 am: c3fde912c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620859

Change-Id: If9a3e37e5359b955e330002d81cbeb48f90ee22b
2021-05-15 17:24:42 +00:00
Junyu Lai
260b398281 Merge changes I3ba50cbd,I970ee365
* changes:
  [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
  [FUI27] Fix internal naming of notifyNetworkStatus
2021-05-15 16:21:38 +00:00
Jayachandran Chinnakkannu
2e83d431f0 Merge "QOS filter matching support based on remote address and port number for connected sockets" am: fd92919d9d am: 61736254b7 am: cea0264ef0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1687813

Change-Id: I04ada71bdea2c3851fd6925126f6ff2bfdecad2c
2021-05-14 21:19:17 +00:00
Jayachandran Chinnakkannu
cf6df117e0 Merge "QOS filter matching support based on remote address and port number for connected sockets" am: fd92919d9d am: 61736254b7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1687813

Change-Id: I32f71d0bc49e6a348d64cb0adb8abf421677f306
2021-05-14 20:54:05 +00:00
Jayachandran Chinnakkannu
fd92919d9d Merge "QOS filter matching support based on remote address and port number for connected sockets" 2021-05-14 20:02:30 +00:00
Junyu Lai
1bdbacd83c Merge "[FUI26] Address comments on aosp/1560408" am: 819b9a637e am: ee455cedce am: 35039336a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1618845

Change-Id: I8c62d218953027ee2fb5426ddacae5a6f8bb6c73
2021-05-14 12:20:10 +00:00
junyulai
5eb5fbfce3 [FUI27] Fix internal naming of notifyNetworkStatus
Test: TH
Bug: 174123988
Change-Id: I970ee365ca221956ee85788005d331374b5fa71a
2021-05-14 19:48:17 +08:00
junyulai
bad30368d4 [FUI26] Address comments on aosp/1560408
Test: TH
Bug: 174123988
Change-Id: I949eeb8903e903d8ede90521442b1f917d5cdfeb
2021-05-14 15:57:44 +08:00
Chalard Jean
372a4f3eec Make yield-to-bad-wifi behavior backward compatible with R
Yielding cell wins to exiting wifi (whether good or bad).
It loses to bad wifi that's not exiting.

In R, yielding to bad wifi only affects wifis that are
unvalidated, but a wifi that is exiting should still be
dropped in favor of a cell that yields to bad wifi.

I had misunderstood the policy and implemented it wrong.
Now it's implemented right, and has careful tests.

Test: new tests for this
Bug: 186458024
Change-Id: Ib8637100d491e72a2edb837584ce55b7dda58524
2021-05-14 15:27:12 +09:00
Aaron Huang
8dd94bdcef Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

(cherry-picked from ag/14326779)
Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Merged-In: I38b476e762fb57fa88c4a789092d0af6f5330d80
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80
2021-05-14 11:05:22 +08:00
Jayachandran C
eab334d00a QOS filter matching support based on remote address and port number for connected sockets
This CL adds APIs for telephony to perform filter matching based on
remote address if the socket is connected. Additional checks will be
performed on the state of socket to avoid the future callbacks in a
separate CL.

Bug: 181916576
Test: Manually verified in live T-Mobile network
      atest ConnectivityServiceTest
      atest com.android.internal.telephony.dataconnection.QosCallbackTrackerTest

Change-Id: I6fbd4e84c76bc4acbf4e59f06f8e86e0237bae29
2021-05-13 09:50:13 -07:00
Lorenzo Colitti
e61ffc1a50 Do not automatically redact TransportInfo objects.
Currently, NetworkCapabilities always redacts the TransportInfo
objects it contains whenever a defensive copy is made. This makes
it impossible to make a defensive copy on a TransportInfo
parcelled from another process without redacting it.

Stop redacting by default; instead rely on ConnectivityService
explicitly calling NetworkCapabilities' redacting constructor
when it returns a NetworkCapabilities object to an app via a
callback or synchronous call. This is currently done by
- createWithLocationInfoSanitizedIfNecessaryWhenParceled, which
  is called from callCallbackForRequest, getNetworkCapabilities,
  and getDefaultNetworkCapabilitiesForUser.
- getNetworkCapabilitiesWithoutUids, which is used when sending
  ConnectivityDiagnosticsManager callbacks. In this method,
  unconditionally redact all information, which is what the code
  did previously due to the default redaction setting for empty
  NetworkCapabilities objects being REDACT_ALL.

Bug: 183938194
Test: atest NetworkCapabilitiesTest
Test: atest FrameworksNetTests CtsNetTestCases HostsideVpnTests
Change-Id: I3108ee94cb0930958e071ba678c3554525b0db82
2021-05-13 20:24:19 +09:00
Remi NGUYEN VAN
0d51e44e09 Move net unit tests to packages/Connectivity
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.

Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.

Test: atest FrameworksNetTests
Bug: 187814163
Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc

Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 08:30:33 +00:00
Remi NGUYEN VAN
65b8995a15 Move net unit tests to packages/Connectivity
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.

Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.

Test: atest FrameworksNetTests
Bug: 187814163
Ignore-AOSP-First: needs per-branch move for merge conflicts
Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 05:55:44 +00:00