Commit graph android_packages_modules_Co.../framework
Message SHA1
Update document for ApfCapabilities.hashCode()
Bug: 346468860
Test: TH
Change-Id: I608effa4b84fbd34461cbfd22afb5eef33bed139

Yuyang Huang   commited 2024-06-13 20:44:46 +09:00
bfe49e0844
Merge changes I62c990d0,I413bdb76,I020ba48e into main
* changes:
  Update NetworkRequestTest#testDefaultCapabilities
  Allow default messaging app to use constrained satellite network
  Introduce NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED

Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-06-07 09:29:06 +00:00
3e07102814
Introduce NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED
On V+, this capability is set by default.
Constrained satellite networks never become the system default network.

Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I020ba48e74f1f180e1807cbe1c066209bedb0454

Motomu Utsumi   commited 2024-06-06 15:49:21 +09:00
154ce6381a
Merge "Add config flag for useDeclaredMethodsForCallbacks" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-06-06 02:42:54 +00:00
9d88333273
Add config flag for useDeclaredMethodsForCallbacks
Add a DeviceConfig flag that will be used to control whether callbacks
should be sent selectively based on whether the receiving method has
been overridden (will be implemented in a future change).

This adds utilities to allow ConnectivityManager to check whether a
ConnectivityService flag is enabled, as that feature will work across
ConnectivityManager and ConnectivityService. ConnectivityManager runs in
app process and does not necessarily have permissions to use
DeviceConfig. Also if it checked DeviceConfig separately from
ConnectivityService, values may be out-of-sync.

Test: atest, and see change using this
Change-Id: I204fa719cc627e84edc5c1e043d947f5ef3f8dee

Remi NGUYEN VAN   commited 2024-06-05 15:54:49 +09:00
aa355ac875
Stop throwing when the invalid capability is passed
When new capability is introduced and added to capaility or
forbiddenCapability by default, module rollback could cause system
server crash since JobScheduler persists network request that contains
new capability that is invalid for old code.
This CL updates capability validation not to throw exception to avoid
system crash in this case.

Bug: 343823469
Bug: 313030307
Test: NetworkCapabilitiesTest
Change-Id: I5708c475f3b4974284531212b77f9788ca9f497e

Motomu Utsumi   commited 2024-06-05 11:57:18 +09:00
ab1a0671c7
Merge changes If3dbe234,Ia1299759 into main
* changes:
  Dump current max entries and cache duration even if the flags change
  Check compat change flag for rate-limit cache

Junyu Lai   authored and   Gerrit Code Review   commited 2024-06-04 07:07:21 +00:00
67b67908a1
Treat APFv3 as APFv4 with not fully working counters.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8908e131955c028ac3aabb9436daf60ca5efcfb3

Maciej Żenczykowski   authored and   Yuyang Huang   commited 2024-05-31 01:14:44 +00:00
288aca0a23
Revert^2 "Add blocked reason for internet permission"
This reverts commit cb74c08979.

Reason for revert: This change is not a cause of b/342557183

Change-Id: Iee8d9b05bbe130a46b627b12da525177b4ee89b2

Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-05-27 02:12:43 +00:00
cfd5a517da
Revert "Add blocked reason for internet permission"
This reverts commit ee96ba0e60.

Reason for revert: Droidmonitor triggered revert due to b/342557183. Will be verifying through ABTD before submission.

Change-Id: I7e185c3ac11da27c7bb9d95e4221f7dfc22cf48c

Priyanka Advani   authored and   Gerrit Code Review   commited 2024-05-24 18:11:45 +00:00
cb74c08979
Add blocked reason for internet permission
Currently, even if apps don't have INTERNET permission and can not use
network, network access is considered not blocked and
ConnectivityService send onBlockedStatusChanged callback with
blocked=false.
This CL introduced BLOCKED_REASON_NETWORK_RESTRICTED and consider
network access from apps targetting W+ on V+ releases is blocked if apps
don't have INTERNET permission.
Permission is set when the user is added or package is installed and
permission is removed when the user is removed or packages is
uninstalled.
So ConnectivityService does not need to monitor permission change to
send onBlockedStatusChanged callback by permission change.

Test: CSBlockedReasonsTest
Bug: 339559837

Change-Id: I58d2a4eddc714e205f5b96219f95b637f2826c58

Motomu Utsumi   commited 2024-05-24 13:45:51 +09:00
ee96ba0e60
Merge "Update compat flag to use VERSION_CODES.VANILLA_ICE_CREAM instead of 35" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-05-21 07:19:35 +00:00
216f8adca0
Update compat flag to use VERSION_CODES.VANILLA_ICE_CREAM instead of 35
Bug: 340415875
Test: TH
Change-Id: Idedbb6ca0faeae152da4867d08cea2d2fe6b2632

Motomu Utsumi   commited 2024-05-21 14:42:31 +09:00
175ca03ed0
Implement missing hashCode() method in ApfCapabilities
Bug: 340878976
Test: TH
Change-Id: I3e7721ff328d3086d9fbfb80fd75b3533f75c7c0

Yuyang Huang   commited 2024-05-20 17:08:55 +09:00
6ff9b589fe
Check compat change flag for rate-limit cache
This allows apps built against V but run on older platform
can adopt this feature. This keep compatibility for older
apps which does not built against newest platform.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest
Fix: 339154075
Change-Id: Ia12997595579190ae0d65ad36ce39d011dde37ce

Junyu Lai   commited 2024-05-20 14:37:09 +08:00
f53e9cf3a1
Update APIs that depends on isUidNetworkingBlocked to follow compat flag
NETWORKINFO_WITHOUT_INTERNET_BLOCKED compat flag only changed the
behavior of getActiveNetworkInfo that depends on
bpfNetMaps#isUidNetworkingBlocked.
But isUidNetworkingBlocked is used from other APIs(e.g. getActiveNetwork)
This CL update all APIs that depends on isUidNetworkingBlocked to follow
the compat flag to make behavior consistent between APIs.

aosp/3079290 will update onBlockedStatusChanged callback to follow this
compat flag.

Bug: 340773991
Bug: 339780435
Test: TH
Change-Id: If64ec800f21c2adc613884838202e2dece4a8d95

Motomu Utsumi   commited 2024-05-16 16:54:17 +09:00
b15be228d2
Disable the NETWORKINFO_WITHOUT_INTERNET_BLOCKED flag in V
Test: manual using AIcore
Change-Id: I08bec890d2fc4980840f1d8deeb62f5de6e5d745

Lorenzo Colitti   commited 2024-05-15 11:10:11 +00:00
90c9703bca
Add compat flag for ActiveNetworkInfo blocked state
Before aosp/3001087, getNetworkActiveInfo did not return network info
with blocked state for apps without PERMISSION_INTERNET even if the
network is actually blocked.
aosp/3001087 updated getNetworkActiveInfo to return correct blocked
state on V+.
However, this broke some apps that use getNetworkActiveInfo in wrong way
and depends on the previous behavior.
So this CL introduces the compat flag to keep previous behavior for apps
targeting U or older releases.

Test: TH
Bug: 333340911
Change-Id: I0e0950f2148de0ffdb45495903a5a87e0d4c1c0b

Motomu Utsumi   commited 2024-05-08 21:08:35 +09:00
0b4be79e52
Add bpf map based getUidNetworkingBlockedReasons
Bug: 328732146
Test: NetworkStackBpfNetMapsTest BpfNetMapsTest
Change-Id: Ie802b3d18463e2b7e8a2b953088cbbcc117a841e

Motomu Utsumi   commited 2024-05-07 18:36:36 +09:00
eb92054f91
Add blocked reason for OEM deny firewall chains
FIREWALL_CHAIN_OEM_DENY_x chains were added by aosp/2114533 but
corresponding blocked reasons were not added.
Upcoming aosp/3027488 updates CS to generate blocked reasons based on
bpf map contents.
Without blocked reasons for oem deny chains, onBlockedStatusChanged
callback will have inconsistency from the actual network blocked status.
This CL adds BLOCKED_REASON_OEM_DENY for FIREWALL_CHAIN_OEM_DENY_x chains

Bug: 328732146
Test: TH
Change-Id: I3793aa0e231d32fea5eb202ed69e170f74d66b02

Motomu Utsumi   commited 2024-05-07 18:31:07 +09:00
9e75aad888
Add @RequiresApi(TIRAMISU) to BpfNetMapsUtils
With this annotation, errorprone build will fail if callers don't check
sdk version before calling any methods in BpfNetMapsUtils.

Bug: 328732146
Test: TH
Change-Id: Ifa52dc1d2766f8d46dfdc4f6ca9dbb963406c084

Motomu Utsumi   commited 2024-04-24 13:16:42 +09:00
2c248d2108
Merge "Add firewall chains for HAPPY_BOX and user/admin PENALTY_BOX" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-04-24 03:51:09 +00:00
c04493234e
Add firewall chains for HAPPY_BOX and user/admin PENALTY_BOX
Follow up CLs will update CS to generate blocked reason from bpf map
instead of asking NPMS.

However, one issue is NPMS set PENALTY_BOX for
BLOCKED_METERED_REASON_USER_RESTRICTED and
BLOCKED_METERED_REASON_ADMIN_DISABLED without telling the reason.
So, CS can not know the reason of PENALTY_BOX.

This CL add new firewall chain and match to distinguish reasons.
NPMS must call setUidFirewallRule with
FIREWALL_CHAIN_METERED_DENY_USER or FIREWALL_CHAIN_METERED_DENY_ADMIN
based on the reason so that CS can know the reason of restriction.

Bug: 332628891
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: Ia4ad4bdb345abc22c782630e828edfad2452db36

Motomu Utsumi   commited 2024-04-23 15:04:28 +09:00
11d3345daa
Reland cronet 121_0_6167_71: remove http_client_logging lib
Revert submission 3031237-revert_v3

Reason for revert: Fixed in aosp/3033496

Reverted changes: /q/submissionid:3031237-revert_v3

Change-Id: Ib811ad68c19825c238a60fe4a2e8e8a73b631ff1

Chidera Olibie   commited 2024-04-15 11:29:55 +00:00
32ec9e0235
Merge "Revert^2 "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."" into main
Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 18:24:33 +00:00
a7c3b506d7
Revert^2 "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
This reverts commit 1ba19c9c67.

Reason for revert: broke native coverage b/333108088

Change-Id: I6a6a9ca3a82ceb8109beea66fcc95c8d8e4a0620

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 14:53:21 +00:00
2a85b5e7da
Merge changes from topic "revert-3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV-HXQZEVTNSQ" into main
* changes:
  Revert "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
  Revert "Revert "Revert "Revert "[Cronet] Disable one of setURLSt..."

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-03 08:53:08 +00:00
22cc321820
Merge "Do faster bitmask checks on NetworkCapabilities" into main
Shai Barack   authored and   Gerrit Code Review   commited 2024-04-02 18:32:40 +00:00
0634c7c4d2
Revert "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
Revert submission 3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Reason for revert: aosp/3022283 fixed coverage issue

Reverted changes: /q/submissionid:3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Change-Id: I1fdfdec2199eaf94766b93401a8e781a8cfec571

Chidera Olibie   commited 2024-04-02 12:07:04 +00:00
1ba19c9c67
Udpate setNetworkSpecifier logic support Satellite Transport
Bug: 326373613
Bug: 329385152 
Test: atest FrameworksNetTests
Change-Id: I8cf686a6d9a1138d26cb37faa73106afd0e24723

Nagendra Prasad Nagarle Basavaraju   commited 2024-04-01 06:20:23 +00:00
d618f954d5
Merge "Separate Struct.java into its own lib." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-28 06:23:57 +00:00
68d68d82ed
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
Fix isUidNetworkingBlocked for system uids
Update isUidNetworkingBlocked to return false for system uids regardless
of firewall chain status since this is an actual behavior

Bug: 328732146
Test: TH
Change-Id: Ic4760b927f51a1229e9af09c79b5261f85fe89d1

Motomu Utsumi   commited 2024-03-26 19:16:54 +09:00
cb448f5c78
Merge changes from topic "revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV" into main
* changes:
  Revert "Revert "Revert "[Cronet] Disable one of setURLStreamHand..."
  Revert "Revert "Revert "cronet 121_0_6167_71: remove http_client..."

George Verhaegen   authored and   Gerrit Code Review   commited 2024-03-20 13:39:16 +00:00
4a18c1bc11
Revert "Revert "Revert "cronet 121_0_6167_71: remove http_client..."
Revert submission 3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA

Reason for revert: Build breakage as b/330450460

Reverted changes: /q/submissionid:3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA

Change-Id: I56e53cf907c9d24c90b588e97ef8a101fd5aa19c

Lisa (LeeWei) Liu   authored and   Gerrit Code Review   commited 2024-03-20 08:30:25 +00:00
e450572718
Merge changes from topic "revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA" into main
* changes:
  Revert "Revert "cronet 121_0_6167_71: remove http_client_logging..."
  Revert "Revert "[Cronet] Disable one of setURLStreamHandlerFacto..."

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-03-20 04:19:06 +00:00
52dceb80bd
Move isChainEnabled and getUidRule to BpfNetMapsUtils
This CL also adds @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
to NetworkStackBpfNetMaps

Bug: 328732146
Test: TH
Change-Id: Ifa4cffd046164405b8b49d2e2ee9f27240bec6fa

Motomu Utsumi   commited 2024-03-19 04:21:29 +00:00
2f79f58c06
Move isUidNetworkingBlocked to BpfNetMapsUtils
This is a preparation to add isUidNetworkingBlocked method to BpfNetMaps
without duplicating codes.

Bug: 328732146
Test: TH
Change-Id: I50a46931f6c80a1f4cfca5d9e78b2ab742a793f2

Motomu Utsumi   commited 2024-03-19 04:21:19 +00:00
bb35aa1947
Call getDataSaverEnabled from isUidNetworkingBlocked
This reduces unnecessary bpf map read

Bug: 328732146
Test: TH
Change-Id: I7652bee99c1d733bae38508d7d6092c90678dc42

Motomu Utsumi   commited 2024-03-19 04:20:54 +00:00
e1d536ba8a
Do faster bitmask checks on NetworkCapabilities
Allows compiler to turn some conditionals into constant
expressions and to simply the machine code.

Bug: 326744138

Change-Id: Ic0abed8c548986fe7ef1876bd1eb3e55ac6b8c10

Shai Barack   commited 2024-03-19 04:15:40 +00:00
70e7011a07
Merge "Rename BpfNetMapsReader to NetworkStackBpfNetMaps" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-19 04:13:17 +00:00
7bfcd30e89
Rename BpfNetMapsReader to NetworkStackBpfNetMaps
BpfNetMapsReader is loaded to bootclasspath. So this class should not
contain unnecessary codes.
To make this clear, this CL renames to NetowrkStackBpfNetMaps and add
comments

Bug: 328732146
Test: TH
Change-Id: I557627c9fae087eb6119c2ae31d46526fa9e5d7e

Motomu Utsumi   commited 2024-03-19 04:12:29 +00:00
fc504042f6
Revert "Revert "cronet 121_0_6167_71: remove http_client_logging..."
Revert submission 2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX

Reason for revert: aosp/3003361 fixed failing test. See b/329605950.

Reverted changes: /q/submissionid:2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX

Bug: b/327182569
Test: atest NetHttpCoverageTests
Change-Id: I45a2b032d3aaf636acc11af9a37c452a02533f37

Chidera Olibie   commited 2024-03-18 13:50:05 +00:00
cfc6b02ee6
Merge "Throw if isUidNetworkingBlocked is called below U" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-18 09:24:26 +00:00
5784191a76
Throw if isUidNetworkingBlocked is called below U
Test: TH
Fix: 329384918
Change-Id: I23139245ca91d29adf533d88551d1ea345488568

Junyu Lai   commited 2024-03-18 14:50:42 +08:00
7291d1172c
Merge "Remove DEFAULT_FORBIDDEN_CAPABILITIES from NetworkRequest" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-14 06:43:36 +00:00
8ee26e64be
Merge changes from topic "revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX" into main
* changes:
  Revert "cronet 121_0_6167_71: remove http_client_logging lib"
  Revert "[Cronet] Disable one of setURLStreamHandlerFactory test"

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-13 18:23:14 +00:00
d49669622b
Remove DEFAULT_FORBIDDEN_CAPABILITIES from NetworkRequest
aosp/2873154 disabled DEFAULT_FORBIDDEN_CAPABILITIES to avoid crash when
the module rolls back.
DEFAULT_FORBIDDEN_CAPABILITIES was introduced to avoid existing users
getting callback from local networks.
But aosp/2936050 fixed this issue by introducing compat flag.
So this CL cleans up DEFAULT_FORBIDDEN_CAPABILITIES code

Test: TH
Bug: 319212206
Change-Id: I125800cb3dd029f190056c8715ab9a741a83a234

Motomu Utsumi   commited 2024-03-13 12:11:13 +09:00
29ff998bb9
Merge "Add CompatChange for local network matching" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-13 02:34:57 +00:00
d2c103ea14
Revert "cronet 121_0_6167_71: remove http_client_logging lib"
Revert submission 2980591-cronet_121_0_6167_71

Reason for revert: Seems to be the cause for b/328855816

Reverted changes: /q/submissionid:2980591-cronet_121_0_6167_71

Change-Id: I8baddfcbc1926acf9d58130b2032b5acd921e4fa

Patrick Rohr   commited 2024-03-11 19:07:03 +00:00
dae7f8c4dc