Commit graph

13,045 commits

Message SHA1
Merge "Revert "Replace Context#sendStickyBroadcastAsUser()"" am: 42a9366c6f am: 5f323ee65b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556090

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3583681f6982933c855e12583a60c4c000d6a6fa

Will Osborn   authored and   Automerger Merge Worker   commited 2021-01-25 18:06:14 +00:00
5720e85c3d
Merge "Add method to match address \ port with QosFilter"
Daniel Bright   authored and   Gerrit Code Review   commited 2021-01-25 18:03:32 +00:00
591fe5327c
Merge "Revert "Replace Context#sendStickyBroadcastAsUser()"" am: 42a9366c6f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556090

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idf3590c2457434fb10ed68213ff47e5c8fffb4d7

Will Osborn   authored and   Automerger Merge Worker   commited 2021-01-25 17:35:21 +00:00
5f323ee65b
Merge "Revert "Replace Context#sendStickyBroadcastAsUser()""
Will Osborn   authored and   Gerrit Code Review   commited 2021-01-25 17:20:29 +00:00
42a9366c6f
Fix FrameworksNetIntegrationTests failure
The test is broken because CS is using
sendStickyBroadcast with all users context instead of
sendStickyBroadcastAsUser to send sticky broadcast. So update
related code on ConnectivityServiceIntegrationTest.

Bug: 178367782
Test: atest FrameworksNetIntegrationTests
      atest FrameworksNetTests
Change-Id: I7ad94fa31ea16025e6ad62d41235978f45be5d99

paulhu   commited 2021-01-25 23:40:06 +08:00
b15a22e5b9
Revert "Replace Context#sendStickyBroadcastAsUser()"
This reverts commit c529710329.

Reason for revert: DroidMonitor: Potential culprit for Bug http://b/178367782 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I7fd74bf481febf1cba8b6c8fbf01c4908f847606

Will Osborn   commited 2021-01-25 14:34:30 +00:00
3eaba31d42
Merge "Replace Context#sendStickyBroadcastAsUser()" am: 0a6682146c am: 2c7d1107f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552316

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8e2eb504f76b3cb0e9a3125144f591666b2a6b59

Paul Hu   authored and   Automerger Merge Worker   commited 2021-01-25 06:57:48 +00:00
110dff506a
Merge "Replace Context#sendStickyBroadcastAsUser()" am: 0a6682146c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552316

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia48990908b46f3e686b3798850a0f955a2f81dd1

Paul Hu   authored and   Automerger Merge Worker   commited 2021-01-25 06:27:36 +00:00
2c7d1107f9
Merge "Replace Context#sendStickyBroadcastAsUser()"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-25 05:57:22 +00:00
0a6682146c
Move connectivity-sources to frameworks/base
All sources for the connectivity module are being moved to
frameworks/base/packages/Connectivity, so that they can all be moved to
packages/modules/Connectivity in one move keeping history.

INetworkAgent and INetworkAgentRegistry were created in
packages/modules/Connectivity directly, but this makes managing the
sources until the move harder as the module needs to pull sources from
two different locations. Considering that they do not have history to
move, just move them to frameworks/base/packages/Connectivity without
the commit history.

Bug: 171540887
Test: m
Change-Id: Ic4353115a98b6235c2b5d5ce24741223e618d0a6

Remi NGUYEN VAN   commited 2021-01-25 11:47:42 +09:00
c2fb349511
[FUI05] Remove wimax data usage unit test
In follow-up patches, the network type will be derived from
transport types, which officially doesn't support wimax.
Thus, remove the test which rely on it first since it is
not needed and will not be needed.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: I713bc2ec39e3a4fa19ed13d2e9ff9ae35477d726

junyulai   commited 2021-01-22 23:58:14 +08:00
cb95247c1e
[FUI14] Get SSID from NetworkCapabilities
This allows subsequent patches to remove the need of exposing
SSID in NetworkState.

Test: atest NetworkStatsServiceTest
Bug: 174123988
Change-Id: Ib9ab07c9610954c9a5de035a3aefbf6d0bb0b53b

junyulai   commited 2021-01-22 23:58:14 +08:00
de493c006a
Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()" am: 85aad57203 am: 12fbbf4145
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534910

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I53d02efcb85b72671dcd89acf917518a53049b11

Paul Hu   authored and   Automerger Merge Worker   commited 2021-01-22 15:21:54 +00:00
ffb5aa3fc3
Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()" am: 85aad57203
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534910

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0f8833a502cfa4674190509300eb378c4072efcc

Paul Hu   authored and   Automerger Merge Worker   commited 2021-01-22 14:53:33 +00:00
12fbbf4145
Add method to match address \ port with QosFilter
* The match method is only for local address and port since we have
no other use case.

Bug: 155176305
Test: Added new test
Change-Id: I7b45f9912af6a192fc60606f5e0b4cc479aea93f

Daniel Bright   commited 2021-01-22 06:24:41 -08:00
07dd129bbe
Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-22 14:18:47 +00:00
85aad57203
Merge "Add Qos Callback support" am: 29f0f6d47f am: b97f23ae96
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1386623

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1d07d8e5bd5e0a40df7d7fa276bf0c1fed500ed1

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-01-22 14:17:50 +00:00
f14671c09a
Merge "Add Qos Callback files" am: a96f7a4d89 am: f884ddbf97
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1557008

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1000035eb541c666d193a36647e7070647d3248a

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-01-22 14:17:18 +00:00
79d0ad5f2f
Merge "Add Qos Callback support" am: 29f0f6d47f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1386623

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I73984d62a914a4d96ed116c3c25ebdce7e6426ea

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-01-22 13:41:39 +00:00
b97f23ae96
Merge "Add Qos Callback files" am: a96f7a4d89
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1557008

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I63e1639172bde1ffd498605b9d1a43633cc8a623

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-01-22 13:31:16 +00:00
f884ddbf97
Merge "Add Qos Callback support"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-01-22 13:09:24 +00:00
29f0f6d47f
Merge "Add Qos Callback files"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-01-22 13:06:43 +00:00
a96f7a4d89
Merge "Mark connectivity test utilities as module API" am: 5ef8031d57 am: a9630d29d0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547643

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I10d521b26061821ab1ee57d1938416163d93de92

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-01-22 11:12:11 +00:00
9dce262648
Merge "Mark connectivity test utilities as module API" am: 5ef8031d57
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547643

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5973e19d7b7a103235121f5efc1951985e3a4c41

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-01-22 10:34:16 +00:00
a9630d29d0
Merge "Mark connectivity test utilities as module API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-01-22 10:11:39 +00:00
5ef8031d57
Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, create NPMS#isUidRestrictedOnMeteredNetworks() and
NPM#isUidRestrictedOnMeteredNetworks() to replace
NPMI#isUidRestrictedOnMeteredNetworks().

Also correct the permission check in isUidNetworkingBlocked()
that needs to check OBSERVE_NETWORK_POLICY only.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Change-Id: I5801a3a2076f3eb199a0226c38c85014b26c64e7

paulhu   commited 2021-01-22 16:14:28 +08:00
76cf0c5c8e
Mark connectivity test utilities as module API
The API surface is planned to move to the Connectivity module, meaning
that it will be maintained across multiple Android releases.
This is incompatible with TestApi semantics, which are designed to be
removable across releases. Effectively the APIs become SystemApi, so
mark them as such considering that TestApi is not supported by modules.

Remove the NetworkCapabilities.getCapabilities test API that is not
essential for tests, and mark other APIs as module API.

Test: m
Bug: 174436414
Change-Id: Ic04551a9874b3d756cf5e6c77ceabfc7c85d52a6

Remi NGUYEN VAN   commited 2021-01-22 16:16:57 +09:00
7d4530b98d
Add Qos Callback support
* Provide App Developers Qos related info associated to
  a bound socket through ConnectivityManager
* Qos sessions are generated and filtered by Network Agents
  and sent back through the Connectivity Service to the
  API consumer.
* The structure of the code within com.android.server
  is designed to support different types of filters in the
  the future.
* The first type of Qos Attributes are related to EPS
  Bearers in order support RCS.

Bug: 155176305
Test: Added to cts/NetworkAgentTest
Test: Added to ConnectivityServiceTest
Change-Id: I145dd065d9deeee449eb9695ab3f6c8556ee7c09

Daniel Bright   commited 2021-01-21 20:14:52 -08:00
60f02ed76b
Add Qos Callback files
* Add QosCallback stub files

Bug: 155176305
Test: N/A
Change-Id: I7c231d60880c37ae1ce49fa8a621badf386ab8a7

Daniel Bright   commited 2021-01-21 19:50:24 -08:00
53f0e44449
Merge "Use network list in UNDERLYING_NETWORKS_CHANGED" am: a6f4de3432 am: ef75b38a4d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536308

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1458448db36acce05cad6ba9f41b4d7d11bc684a

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-01-22 01:47:51 +00:00
599b2b1d17
Merge "Use network list in UNDERLYING_NETWORKS_CHANGED" am: a6f4de3432
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536308

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I58184fe4f731319b7bf4c8cf24c0a6571e4a1d8b

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-01-22 01:22:25 +00:00
ef75b38a4d
Use network list in UNDERLYING_NETWORKS_CHANGED
The bundle is no longer necessary, as this message is not sent across
processes: the network list can be sent directly in the message obj
pair.

Bug: 173574274
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Iae049a24212ff9df19b29aead20bf4a594f05f99

Remi NGUYEN VAN   authored and   Chalard Jean   commited 2021-01-21 22:36:54 +09:00
d793eb34ca
Merge "[IT4.4] Host network activity related logic into a new class" am: 18e77a4752 am: d2258450d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534899

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia9d356627445c81993ba4ed2048d621e70ebca0e

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-01-21 10:01:05 +00:00
766be66a93
Merge "[IT4.4] Host network activity related logic into a new class" am: 18e77a4752
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534899

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6158f29302241703367b5392d2f0adcf6f6ccf57

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-01-21 09:21:33 +00:00
d2258450d1
Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl" am: 0ad97bf744 am: 8178ec8ea2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If57e12227a2735853911ca6271a211571ddb633b

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-01-21 09:19:46 +00:00
9d49128dc9
Merge "Replace Context @hide API in MultinetworkPolicyTracker" am: 161e0b9b78 am: 0b1c92d785
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554096

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib68e5eb2ce60a616b25b6d0a45b2af143660865f

Paul Hu   authored and   Automerger Merge Worker   commited 2021-01-21 08:55:37 +00:00
39400248ea
Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl" am: 0ad97bf744
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9b7818c5fc851a5b2a1406caec0db3dac3ff55c7

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-01-21 08:55:33 +00:00
8178ec8ea2
Merge "[IT4.4] Host network activity related logic into a new class"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-01-21 08:41:15 +00:00
18e77a4752
Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-01-21 08:40:53 +00:00
0ad97bf744
Use ParcelFileDescriptor instead of FileDescriptor in the aidl
Using FileDescriptor in the aidl will refer to
Parcel.readRawFileDescriptor() and Parcel.writeRawFileDescriptor()
whilie trying to do parcel operations. Those two APIs are hidden
and not accessible for the incoming ConnectivityService mainline
module. For such use cases in a module, it should be replaced by
using ParcelFileDescriptor that is designed for such usages.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Ia7e3a71ccb4b136cc55c9e90a384870c32cfd37b

Chiachang Wang   commited 2021-01-21 08:40:12 +00:00
979f46a693
Merge "Replace Context @hide API in MultinetworkPolicyTracker" am: 161e0b9b78
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554096

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I33f441fba920d6228be47b2025fcf7303e496da8

Paul Hu   authored and   Automerger Merge Worker   commited 2021-01-21 08:07:51 +00:00
0b1c92d785
Merge "Replace Context @hide API in MultinetworkPolicyTracker"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-21 07:53:19 +00:00
161e0b9b78
Merge "Mark TestNetworkManager as module API" am: cc041a72e7 am: 4bfba0d2e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I363b288609514251f1e5ec337f56368180d2b259

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-01-21 06:59:55 +00:00
45d22e4ccc
[IT4.4] Host network activity related logic into a new class
Create an inner class to handle the network activity related
logic to isolate the code for code cleanliness. It's helpful for
the follow-up modifications to move network activity logic from
NMS to CS to support Connectivityservice mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I33b3b11f2700cb10eb6e3b58b6dfa52251bece80

lucaslin   authored and   Chiachang Wang   commited 2021-01-21 06:27:23 +00:00
6d502ed79d
Merge "Mark TestNetworkManager as module API" am: cc041a72e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic1677f8f4fa436450ebc4d83cc10ff8503f2f9f2

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-01-21 06:22:58 +00:00
4bfba0d2e1
Merge "Mark TestNetworkManager as module API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-01-21 06:02:25 +00:00
cc041a72e7
Mark TestNetworkManager as module API
The API surface is planned to move to the Connectivity module, meaning
that it will be maintained across multiple Android releases.
This is incompatible with TestApi semantics, which are designed to be
removable across releases. Effectively the APIs become System/module
API, so mark them as such considering that TestApi is not supported by
modules.

Test: m
Bug: 174436414
Change-Id: Icd32fcbb65e9a4bb2b67cb9da7c971281be0781a

Remi NGUYEN VAN   commited 2021-01-21 10:45:04 +09:00
5eee3ec919
Replace Context @hide API in MultinetworkPolicyTracker
MultinetworkPolicyTracker is part of Connectivity mainline module
which cannot call @hide API Context#registerReceiverAsUser. Thus,
replace it to Context#registerReceiverForAllUsers.

Bug: 170634463
Test: atest FrameworksNetTests
Test: Manully check that receiving intent and unregistering
      receiver can work normally.
Change-Id: Ie22a3aa40bc9243082672a64dba7c7940f9ff21a

paulhu   commited 2021-01-21 01:19:09 +08:00
fd8dac4fe5
Use function inside NetdUtils instead of NetworkManagementService
TestNetworkService will be a part of mainline module, to prevent
using @hide API of NetworkManagementService in TestNetworkService,
use function inside NetdUtils instead.

Bug: 170598012
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I738066ce2f1bcd616dc582a3ff1fd77bcd660c73

lucaslin   commited 2021-01-20 18:09:46 +08:00
62a872a6a7
Fix legacy APIs when VPN switches to suspended underlying network.
Currently, when the VPN underlying network changes from a
network that is not suspended to one that is suspended (or vice
versa), some of the legacy APIs return incorrect results.

This is because the VPN's NetworkInfo can get into SUSPENDED
state even though the capabilities have the NOT_SUSPENDED
capability. This happens because the code in updateCapabilities
that checks for changes in NOT_SUSPENDED and NOT_ROAMING (which
are the capabilities that can affect the NetworkInfo state) is
only run when the capabilities change in a certain way.

Fix this by always checking for changes in these capabilities,
regardless of what else has changed.

This results in sending a lot more SUSPENDED and RESUMED
callbacks than the code sent previously. This should hopefully
not impact apps because those callback methods have never been
public API, though because they're just callbacks, it's possible
that apps found out via code inspection that the callbacks
existed and implemented them.

Bug: 172870110
Test: changes to existing tests in ConnectivityServiceTest
Change-Id: I6ec246a6a4e61f634956a165797fbb80296efd6a

Lorenzo Colitti   commited 2021-01-20 11:32:51 +09:00
246d176689