Commit Graph

480 Commits

Author SHA1 Message Date
Paul Hu
f63d85dc00 Merge "Remove TcpRepairWindow from module-lib API" am: b82fad9aa9 am: a69d2280fc am: 89edca00d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1671788

Change-Id: I1d472c9cffaa0c7f35b284b97fa374b03232a7f4
2021-04-12 15:13:48 +00:00
paulhu
c3663377e7 Remove TcpRepairWindow from module-lib API
Both TcpRepairWindow and TcpKeepaliveController(user) are in the
connectivity module, so TcpRepairWindow doesn't need to be
the module-lib API. Thus, remove TcpRepairWindow from
module-lib API.

Bug: 172183305
Test: m update-api
Change-Id: I8fde726f8ad73637e6deab69ea83b3699bb2cf45
2021-04-12 14:26:55 +08:00
TreeHugger Robot
d9c09ee7cb Merge "Add doc for NetworkScore#getLegacyInt" into sc-dev 2021-04-09 04:38:09 +00:00
Remi NGUYEN VAN
cb7360eecb Merge "Improve documentation on simulateDataStall" am: 3b4f0832bd am: b241ce07a9 am: 3c5cdf0dbc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669505

Change-Id: I9484583b0249f4f67fdf6216f9ca72b900320699
2021-04-09 02:36:41 +00:00
Remi NGUYEN VAN
6a0e0809b4 Merge "Set ParseException constructors as public" am: a2a324f843 am: 7251eb2f0c am: 352fc488f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669051

Change-Id: I7b744bdacf5e5929a1d0ac60832a355ebe8ce9a9
2021-04-09 02:35:43 +00:00
Remi NGUYEN VAN
e09cf913ca Merge "Replace fields with getters in keepalive API" am: 445fd7e9d9 am: e5bc9e1aa1 am: bec77cd512
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669345

Change-Id: I73f6f89eb2d1255743d10c1ec1c92770845bdd63
2021-04-09 02:34:59 +00:00
Remi NGUYEN VAN
a4ad1df2da Merge "Add RequiresPermission to TestNetworkManager" am: 58a22b1d8f am: 6e9d84438c am: e58f448568
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669187

Change-Id: Ifba7b5b88e162caaf7c5393051f867655cf1b9fb
2021-04-09 02:34:17 +00:00
Remi NGUYEN VAN
3b4f0832bd Merge "Improve documentation on simulateDataStall" 2021-04-09 00:21:34 +00:00
Remi NGUYEN VAN
a2a324f843 Merge "Set ParseException constructors as public" 2021-04-09 00:20:33 +00:00
Remi NGUYEN VAN
445fd7e9d9 Merge "Replace fields with getters in keepalive API" 2021-04-09 00:20:13 +00:00
Remi NGUYEN VAN
58a22b1d8f Merge "Add RequiresPermission to TestNetworkManager" 2021-04-09 00:19:51 +00:00
Remi NGUYEN VAN
55d93ddb7e Merge "Use String in CaptivePortalData underlying types" 2021-04-09 00:17:59 +00:00
James Mattis
148043b2a0 Merge "Adding OEM Network Preferences for testing" am: ee638e2670 am: bad8f6262f am: c4c1b9c820
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1659163

Change-Id: Ia028efd68ae8ce229c5382dc4798671da9124a5b
2021-04-08 22:58:14 +00:00
James Mattis
ee638e2670 Merge "Adding OEM Network Preferences for testing" 2021-04-08 20:51:05 +00:00
Chalard Jean
ff4e69f2be Add doc for NetworkScore#getLegacyInt
Test: comment-only change
Fixes: 184786246
Change-Id: I8306f01f3d247986683e272074047e3ad190f68e
2021-04-08 13:52:40 +00:00
Remi NGUYEN VAN
495d9ba693 Use String in CaptivePortalData underlying types
The venue friendly name comes from the network, and only plain strings
should be used in practice. writeCharSequence is also not usable in
CaptivePortalData, as it must build using module_api.

Use a String as the underlying type in CaptivePortalData, keeping
CharSequence in the API for consistency with UI-related elements.

This brings CaptivePortalData in line with downstream branches.

Bug: 183174863
Test: atest FrameworksNetTests
Merged-In: Ifa3ea9aae0cabf5757791c4ae13e6f551759ed97
Change-Id: Ic662d3b546d52f825f9c3a24c5e0d4ba03818ab0
2021-04-08 08:23:20 +00:00
Paul Hu
324810d572 Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40 am: 2cac9e94ba am: 21dbcf362f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080

Change-Id: I5fd350d67065211b84dbea769d258daff9780276
2021-04-08 07:48:14 +00:00
Remi NGUYEN VAN
564f7f8df3 Improve documentation on simulateDataStall
Explain that:
 - The method does not cause an actual data stall.
 - The detectionMethod parameter refers to
   ConnectivityDiagnosticsManager.DataStallReport constants (which
   already use an IntDef).
 - timestampMillis is relative to SystemClock.elapsedRealtime.

Fixes: 183972768
Test: m
Change-Id: I2eeb79e0e8ec6e8fd3b8fe1dcb1abbf2e6338983
2021-04-08 16:30:25 +09:00
Remi NGUYEN VAN
c5174c3c10 Add RequiresPermission to TestNetworkManager
All API methods in TestNetworkManager require the MANAGE_TEST_NETWORKS
permission.

Fixes: 183972672
Test: m
Change-Id: Ic5929c24ea88d7259d367a81fec8f223a2e3ecb0
2021-04-08 16:12:23 +09:00
Remi NGUYEN VAN
84a217a6ef Set ParseException constructors as public
As there is no strong reason to keep the constructors module-lib, set
them as public API.
This is in response to API feedback.

Fixes: 183446251
Test: m
Change-Id: I01daa6f6f8095f7a4db94d1ca05f913166939df3
2021-04-08 15:57:31 +09:00
Remi NGUYEN VAN
019b0eef3c Replace fields with getters in keepalive API
General guidance is to have getters in the API instead of fields.

Fixes: 181014882
Test: m
Change-Id: Id4bfc447701e8d0380163047779fbba043f17b6f
2021-04-08 14:06:53 +09:00
Aaron Huang
40a440f0dc Merge "Remove Network, NetworkRequest metrics from jobscheduler" 2021-04-08 02:27:05 +00:00
TreeHugger Robot
cfbcf574dc Merge "Remove unnecessary public API getActiveNetworkForUid" into sc-dev 2021-04-08 02:26:15 +00:00
paulhu
b49c8425b2 Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager
- As API review feedback, move ACTION_CLEAR_DNS_CACHE form Intent
  to ConnectivityManager.

- Rename to "android.net.action.CLEAR_DNS_CACHE" because of lint
  suggestion.
frameworks/base/packages/Connectivity/framework/src/android/net/
ConnectivityManager.java:449: error: Inconsistent action value;
expected `android.net.action.CLEAR_DNS_CACHE`, was
`android.intent.action.CLEAR_DNS_CACHE` [ActionValue]

Bug: 183937999
Test: atest FrameworksNetTests
Test: atest ActivityTaskManagerServiceTests
Test: atest android.permission2.cts.PermissionPolicyTest
Test: atest CtsNetTestCases
Change-Id: Iae8aa0ba10dfc7581f0cfaab82643edbee789e2f
2021-04-07 19:40:47 +08:00
Treehugger Robot
cb20318619 Merge "Expose constants of ConnectivityManager" 2021-04-07 10:11:06 +00:00
lucaslin
d89b2980df Expose constants of ConnectivityManager
The callers cannot call the hidden APIs after ConnectivityManager
became a part of mainline module, so expose them for callers.
Also change the value of ACTION_PROMPT_PARTIAL_CONNECTIVITY,
ACTION_PROMPT_LOST_VALIDATION and ACTION_PROMPT_UNVALIDATED because
of API lint errors.

Bug: 172183305
Test: Check private DNS settings is normal, and test NO_INTERNET
      notification can be shown normally.
Change-Id: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
Merged-In: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
2021-04-07 09:13:46 +00:00
Chiachang Wang
bb0f157fa3 Merge "Assign the bit calculation as long to prevent overflow" am: 1122a53585 am: 7e2a559c57 am: a97e380d38
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664307

Change-Id: Ia3a1974227ebfd0069b288203df3551a561556eb
2021-04-07 06:06:50 +00:00
Chiachang Wang
1122a53585 Merge "Assign the bit calculation as long to prevent overflow" 2021-04-07 04:24:46 +00:00
Aaron Huang
a35f6c23d8 Remove Network, NetworkRequest metrics from jobscheduler
These metrics are deprecated so remove them from jobscheduler.
Also remove dumpDebug method from Network, NetworkRequest and
NetworkCapabilities because there's no caller anymore.

This change also for connectivity mainline module. These
three classes are inculded in framework-connectivity so
external module cannot have dependencies on its hidden API.
With this change, the dependencies can be removed.

(cherry-picked from ag/13959431)
Bug: 178777253
Test: FrameworksNetTests
      JobStoreTest
      adb shell dumpsys jobscheduler --proto
      CtsIncidentHostTestCases:JobSchedulerIncidentTest
Merged-In: Ie0c540303ba06b8fba029d2b98ae753afb08c963
Change-Id: Ie0c540303ba06b8fba029d2b98ae753afb08c963
2021-04-07 12:22:57 +08:00
Treehugger Robot
ec73c43fa0 Merge "ConnectivityManager: Address review comments from aosp/1595396" am: 1515b6c96d am: 0eadb2848d am: 89fcdff5d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633279

Change-Id: I05777492db3ab9d7b4c6c69131f9404780e4e832
2021-04-07 02:47:49 +00:00
Chiachang Wang
2b79e200c3 Assign the bit calculation as long to prevent overflow
The value should be assigned as a long to do the bit calculation
as the mNetworkCapabilities is intended to be a long. Otherwise,
the value will be temporary assigned into an integer then
assigned to the target long. When the bit shift calculation
is out of the integer scope, the calculation will overflow and
result in unexpected bebavior.

Without assigning to a long, ConnectivityServiceTest will get
Out-Of-Memory in StringBuilder while generating toString() in
NetworkCapabilities after updating tests to verify
NET_CAPABILITY_VSIM and NET_CAPABILITY_BIP.

Bug: 130869457
Test: atest FrameworksNetTests
Change-Id: I4d34c1215c7efb6dc352c314107792e3fa512ad7
2021-04-07 02:06:33 +00:00
Treehugger Robot
1515b6c96d Merge "ConnectivityManager: Address review comments from aosp/1595396" 2021-04-07 00:36:27 +00:00
Roshan Pius
0392d9c63d Merge "NetworkCapabilities: Hide copy constructor" am: fb309ae283 am: afd7250ef7 am: c768b86db0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664151

Change-Id: Ia04c6e313a5c960c4874cd57cf91c6619d1505da
2021-04-06 18:25:52 +00:00
Roshan Pius
189d009e37 ConnectivityManager: Address review comments from aosp/1595396
Bug: 156867433
Test: atest android.net
Test: atest com.android.server
Change-Id: I7f5d043732ae22edd14bf581b7dc676c9236b545
2021-04-06 16:42:51 +00:00
Roshan Pius
fb309ae283 Merge "NetworkCapabilities: Hide copy constructor" 2021-04-06 15:57:47 +00:00
lifr
db7d676f20 Remove unnecessary public API getActiveNetworkForUid
We have exposed the CS module API getActiveNetworkForUid
(Used in Jobscheduler) as a temporary solution for the mainline
Connectivity service module. This API usage has now been removed
in Jobscheduler(b/165835257), so we can permanently remove the
public getActiveNetworkForUid API.

Bug: 183465229
Test: atest FrameworksNetTests
Change-Id: I0f23272d2d8a5118f2e11ac325fdb9e8f9dbe0e3
2021-04-06 17:39:09 +08:00
Ken Chen
5fe1311241 Merge "Downgrade DNS fail message from Error to Warning" am: 374a06673e am: 060c1cdde6 am: 702e85008f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1662360

Change-Id: Id5a17d24b9f7bd012df60b4cf1b1d088a34805bc
2021-04-06 07:56:55 +00:00
Chalard Jean
605bae6972 Merge "Cleanup setGlobalProxy" am: 376274c277 am: 676eccd672 am: 8cce6d3336
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640148

Change-Id: Ic9757060f398aaf871141dc5199bf49988637937
2021-04-06 07:55:54 +00:00
Frank Li
4ae4410678 Merge "Add session ID to VpnTransportInfo" 2021-04-06 06:50:48 +00:00
Ken Chen
374a06673e Merge "Downgrade DNS fail message from Error to Warning" 2021-04-06 06:35:04 +00:00
Chalard Jean
376274c277 Merge "Cleanup setGlobalProxy" 2021-04-06 06:19:01 +00:00
James Mattis
9189c89f52 Adding OEM Network Preferences for testing
Added two new per-app OEM network preferences to be used only with
testing.

Although there is a tradeoff adding these preferences to
non-test code, the benefit is that it will allow testing of the OEM
network preferences app via CTS as using the shell with elevated
permissions is not an option due to the OEM network preferences API
potentially being abused. On consideration, a small amount of test code
was deemed an acceptable tradeoff if it enabled CTS testing.

Bug: 176496580
Bug: 176494815
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ie896a7b40945a46a352f37d2c00671da8a8f4489
2021-04-05 21:51:09 -07:00
Ken Chen
acbbb253f4 Downgrade DNS fail message from Error to Warning
Most DNS fails are caused by network issues, like connection timed out.
Lower log severity from error to warning to conform to go/greenlog.

Test: 1. connect to a WiFi AP without WAN
      2. atest CtsNetTestCases:android.net.cts.DnsResolverTest
      3. adb logcat | grep resNetworkResult:android
Bug: 181269159
Change-Id: Ifeaf250c91a4b9123d200bd62f085c11009f2491
2021-04-06 02:30:56 +00:00
Roshan Pius
fc3adb5ae1 NetworkCapabilities: Hide copy constructor
Only used by connectivity service, no need to mark it public.

Bug: 184537591
Test: Compiles
Change-Id: Ie0d515d73e30a4e15141a3d92aa739192badeb13
2021-04-05 09:29:30 -07:00
Remi NGUYEN VAN
df6ce19fa9 Merge "Reduce framework-connectivity footprint" into sc-dev 2021-04-05 02:15:32 +00:00
Benedict Wong
9429e3b8f9 Merge "Downgrade list of subIds in NetworkCapabilities to @SystemApi" am: 42d706acfc am: 10b113c621 am: 46557b02fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652974

Change-Id: I7a85feb9753ae91ff3d67dc82c8bc880a6626074
2021-04-03 02:01:25 +00:00
Benedict Wong
42d706acfc Merge "Downgrade list of subIds in NetworkCapabilities to @SystemApi" 2021-04-02 22:33:20 +00:00
Sarah Chin
aac4d3242a Merge "API to get network visible network capability name" 2021-04-02 16:50:10 +00:00
Chalard Jean
e1ce6ae5d0 Cleanup setGlobalProxy
This is a small cleanup of a function called by DevicePolicyManager
coming from a conflicting change. This no longer makes a concrete
difference but is still a good change.

Test: m services.devicepolicy
Bug: 172183305
Change-Id: I7ee907314ddb253eb4e97d177f0ea0ab3b58cf03
2021-04-02 20:37:21 +09:00
Remi NGUYEN VAN
deed4cbcf9 Reduce framework-connectivity footprint
Cleanup framework-connectivity to reduce its memory and storage usage:
 - Build libframework-connectivity-jni using standard C and removing
   dependencies on libc++. This saves about 100kB of storage (40+60kB
   on the 32+64 bit variants).
 - Remove dependency on protobuffer libraries, as their usage has been
   removed. This saves about 15kB of storage.

From local measurements, the reduced code size also improves memory
usage.

This also removes a jarjar workaround for net-utils-device-common, as
the library is no longer used either.

Bug: 184111895
Test: device boots, connectivity working
Change-Id: Ibfbd0fe1098293812ae24812621752a7a44f9130
2021-04-02 10:18:00 +00:00