Commit graph android_packages_modules_Co.../framework
Message SHA1
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

Remi NGUYEN VAN   commited 2021-04-08 14:06:53 +09:00
019b0eef3c
Merge "Remove Network, NetworkRequest metrics from jobscheduler"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-04-08 02:27:05 +00:00
40a440f0dc
Merge "Remove unnecessary public API getActiveNetworkForUid" into sc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2021-04-08 02:26:15 +00:00
cfbcf574dc
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

paulhu   commited 2021-04-07 19:40:47 +08:00
b49c8425b2
Merge "Expose constants of ConnectivityManager"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-04-07 10:11:06 +00:00
cb20318619
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

lucaslin   authored and   Chiachang Wang   commited 2021-04-07 09:13:46 +00:00
d89b2980df
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

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-04-07 06:06:50 +00:00
bb0f157fa3
Merge "Assign the bit calculation as long to prevent overflow"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-04-07 04:24:46 +00:00
1122a53585
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

Aaron Huang   commited 2021-04-07 12:22:57 +08:00
a35f6c23d8
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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-04-07 02:47:49 +00:00
ec73c43fa0
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

Chiachang Wang   commited 2021-04-07 02:06:33 +00:00
2b79e200c3
Merge "ConnectivityManager: Address review comments from aosp/1595396"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-04-07 00:36:27 +00:00
1515b6c96d
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

Roshan Pius   authored and   Automerger Merge Worker   commited 2021-04-06 18:25:52 +00:00
0392d9c63d
ConnectivityManager: Address review comments from aosp/1595396
Bug: 156867433
Test: atest android.net
Test: atest com.android.server
Change-Id: I7f5d043732ae22edd14bf581b7dc676c9236b545

Roshan Pius   commited 2021-04-06 16:42:51 +00:00
189d009e37
Merge "NetworkCapabilities: Hide copy constructor"
Roshan Pius   authored and   Gerrit Code Review   commited 2021-04-06 15:57:47 +00:00
fb309ae283
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

lifr   commited 2021-04-06 17:39:09 +08:00
db7d676f20
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

Ken Chen   authored and   Automerger Merge Worker   commited 2021-04-06 07:56:55 +00:00
5fe1311241
Merge "Cleanup setGlobalProxy" am: 376274c277 am: 676eccd672 am: 8cce6d3336
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640148

Change-Id: Ic9757060f398aaf871141dc5199bf49988637937

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-04-06 07:55:54 +00:00
605bae6972
Merge "Add session ID to VpnTransportInfo"
Frank Li   authored and   Gerrit Code Review   commited 2021-04-06 06:50:48 +00:00
4ae4410678
Merge "Downgrade DNS fail message from Error to Warning"
Ken Chen   authored and   Gerrit Code Review   commited 2021-04-06 06:35:04 +00:00
374a06673e
Merge "Cleanup setGlobalProxy"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-04-06 06:19:01 +00:00
376274c277
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

James Mattis   commited 2021-04-05 21:51:09 -07:00
9189c89f52
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

Ken Chen   commited 2021-04-06 02:30:56 +00:00
acbbb253f4
Merge "Add visibility of framework-connectivity.impl for wifi test" into sc-dev
Chiachang Wang   authored and   Android (Google) Code Review   commited 2021-04-06 00:23:37 +00:00
2320733615
Merge "Remove unstable IpPrefix" am: 184a6ce54d am: fdfa2d00d9 am: a278abb926
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1662674

Change-Id: Idfa92d12a45385412c2013637c657acfb9fec3a2

Steven Moreland   authored and   Automerger Merge Worker   commited 2021-04-06 00:05:48 +00:00
74ca1a54d0
Merge "Remove unstable IpPrefix"
Steven Moreland   authored and   Gerrit Code Review   commited 2021-04-05 21:59:47 +00:00
184a6ce54d
NetworkCapabilities: Hide copy constructor
Only used by connectivity service, no need to mark it public.

Bug: 184537591
Test: Compiles
Change-Id: Ie0d515d73e30a4e15141a3d92aa739192badeb13

Roshan Pius   commited 2021-04-05 09:29:30 -07:00
fc3adb5ae1
Merge "Reduce framework-connectivity footprint" into sc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-04-05 02:15:32 +00:00
df6ce19fa9
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

Benedict Wong   authored and   Automerger Merge Worker   commited 2021-04-03 02:01:25 +00:00
9429e3b8f9
Merge "Downgrade list of subIds in NetworkCapabilities to @SystemApi"
Benedict Wong   authored and   Gerrit Code Review   commited 2021-04-02 22:33:20 +00:00
42d706acfc
Merge "API to get network visible network capability name"
Sarah Chin   authored and   Gerrit Code Review   commited 2021-04-02 16:50:10 +00:00
aac4d3242a
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

Chalard Jean   commited 2021-04-02 20:37:21 +09:00
e1ce6ae5d0
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

Remi NGUYEN VAN   commited 2021-04-02 10:18:00 +00:00
deed4cbcf9
Downgrade list of subIds in NetworkCapabilities to @SystemApi
This change downgrades API visibility for the list-of-subIds in the
NetworkCapabilities to SystemApi

Bug: 175662146
Test: atest NetworkCapabilitiesTest#testSubIds
Test: atest FrameworksNetTests
Change-Id: I372fa9eaa7585aefd1710948ca007456feedd578

Benedict Wong   commited 2021-04-02 01:18:11 -07:00
5cec03468c
Remove unstable IpPrefix
Seems nothing is using this.

Bug: 183654927
Test: N/A
Change-Id: I94233d79fb5d93970b38a79a09fc4d50822c3620

Steven Moreland   commited 2021-04-01 22:59:02 +00:00
a732a85f7e
Merge "Expose BIP and VSIM relavent definitions"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-04-01 11:38:17 +00:00
5e6693605c
Merge "Move deduceRestrictedCapability to libs/net and rename it"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-04-01 11:37:51 +00:00
6098194278
Merge changes Ib5cd2c27,I4448a354 into sc-dev
* changes:
  [NS10] Fix a bug where registerIgnoringScore is broken
  [NS09] Implement the new ranking code

Chalard Jean   authored and   Android (Google) Code Review   commited 2021-04-01 09:02:15 +00:00
1324c9acef
Add session ID to VpnTransportInfo
- This will be visible only to apps with the NETWORK_SETTINGS
  permissions (signature), and will be redacted for all other callers.
- This string is expected to be the same as set by
  VpnService#setSession, and in general, VpnConfig.session. But it
  will be a general API that Vpn.java can call when setting the
  VpnTransportInfo.
- This string cannot be updated once the VPN NetworkAgent is connected.

Bug: 171872481
Test: atest ConnectivityServiceTest
      atest VpnTransportInfoTest
      atest android.net.cts.NetworkAgentTest
Change-Id: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d
Merged-In: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d
           (cherry-picked from ag/14011912)

lifr   commited 2021-04-01 15:46:31 +08:00
65b9f96159
Merge "Expose sendNetworkScore that takes a NetworkScore" into sc-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2021-04-01 07:17:48 +00:00
cf9ccc83b2
Merge "Add framework-connectivity-test-defaults" into sc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-04-01 02:43:26 +00:00
6b1d41ac92
Expose sendNetworkScore that takes a NetworkScore
Bug: 167544279
Test: FrameworksNetTests
CTS-Coverage-Bug: 184037351
Change-Id: I5dd9b526c53cb99a5e4ae87f1e3724a7a1870e78

Chalard Jean   commited 2021-03-31 13:26:46 +00:00
e154dff521
[NS09] Implement the new ranking code
At this stage, this is turned off. Unit tests will be
in a followup change.

Test: In a followup
Bug: 167544279
Change-Id: I4448a3546fbc1a3dddf757982c031c5f39ba2889

Chalard Jean   commited 2021-03-31 20:59:47 +09:00
0408f6c7d6
Merge changes Id7ee1bd3,I5ea44a94 into sc-dev
* changes:
  [NS08] Expose public NetworkScore API
  [NS07] Add the rest of the scoring policy

Chalard Jean   authored and   Android (Google) Code Review   commited 2021-03-31 11:42:19 +00:00
dfd53217e3
Add visibility of framework-connectivity.impl for wifi test
Add visibility to allow FrameworksWifiTests to access hidden
connectivity APIs.

Bug: 171540887
Test: m FrameworksWifiTests
Change-Id: I3cd377d7045e7e161d0813aa2d614dff1b5a311b

Chiachang Wang   commited 2021-03-31 09:33:21 +00:00
e9d848e7cb
Add framework-connectivity-test-defaults
The defaults follow the same pattern as framework-wifi-test-defaults to
allow unit tests to build against hidden API in Connectivity.

Bug: 171540887
Test: m
Change-Id: I58bb6574f7e95053e4a95f76d1025506749ec2b8

Remi NGUYEN VAN   authored and   Chiachang Wang   commited 2021-03-31 17:19:57 +08:00
173f8b129d
[NS08] Expose public NetworkScore API
This exposes the two bits settable by the network agents in
Android S on NetworkScore. This is meant to be extensible in
future releases, or possibly for OEM upstreams.

Test: builds
CTS-Coverage-Bug: 184037351
Bug: 167544279
Change-Id: Id7ee1bd3e2679f0bd5200d5c299f18a33b87847c

Chalard Jean   commited 2021-03-30 23:54:19 +09:00
a94f778231
[NS07] Add the rest of the scoring policy
Bug: 167544279
Test: FrameworksNetTests
Change-Id: I5ea44a94ac6f16486274e9091f15a84734db2341

Chalard Jean   commited 2021-03-30 23:50:41 +09:00
5236df9ddf
Merge "Add new network capabilities to support automotive head unit via USB" into sc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2021-03-30 14:36:56 +00:00
6bed8201a3
Merge "[JS01]Remove hidden API usage of Connectivity Sevice"
Frank Li   authored and   Gerrit Code Review   commited 2021-03-30 07:22:40 +00:00
487698b2b7