Commit graph android_packages_modules_Co.../framework
Message SHA1
Merge changes from topics "redact-netcaps", "redact-specifier", "specifier-metrics" into main
* changes:
  [connectivity] rename createWithLocationInfoSanitizedIfNecessaryWhenParceled
  [connectivity] use new redact(RedactionType) for output NetworkSpecifier
  [connectivity] move redaction to createWithLocationInfoSanitizedIfNecessaryWhenParceled
  [connectivity] add permission check on requested NetworkSpecifier
  [connectivity] redact NeworkSpecifier in NetworkCapabilities
  [connectivity] add NetworkCapabilities.RedactionHelper
  [Thread] add REDACT_FOR_THREAD_NETWORK_PRIVILEGED

Kangping Dong   authored and   Android (Google) Code Review   commited 2025-09-12 13:26:22 -07:00
a133acc106
[connectivity] rename createWithLocationInfoSanitizedIfNecessaryWhenParceled
It's already redacting more sensitive information other than just
location info.

This is a follow up CL for https://googleplex-android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/34224156/comment/98b93666_a824d7bc/

Bug: 374037595
Flag: EXEMPT PURE_REFACTOR
Change-Id: I6524c4f9ee9b5273e4ab421f54ae3115dea2cc8a

Kangping Dong   commited 2025-09-12 15:06:00 +08:00
6fd0624452
[connectivity] redact NeworkSpecifier in NetworkCapabilities
The existing NetworkCapabilities class redacts only TransportInfo and
leaves NetworkSpecifier as it is. This is counter-intuitive and the
specifier should be redacted along with TransportInfo as well.

Bug 374037595
Flag: NONE this has no behavior change for all existing
      NetworkSpecifier subclasses because they are not overriding the
      new NetworkSpecifier redaction methods

Change-Id: I73c880add1604afc8b56190647305a54e89e8e53

Kangping Dong   commited 2025-09-12 15:06:00 +08:00
5fd72324ce
[connectivity] add NetworkCapabilities.RedactionHelper
Add a new hidden inner class NetworkCapabilities.RedactionHelper for
accessing conditionally available NetworkSpecifier methods via
reflection.

Reflection is necessary because NetworkSpecifier is platform code. So
it's possible for a mainline update to define a
getApplicableRedactions() or redact(long) method in a subclass of
NetworkSpecifier (e.g., EthernetNetworkSpecifier), and then to run
that mainline module on an Android release where the
NetworkSpecifier base class does not have those methods. On such a
device, ConnectivityService must still call those methods if they
exist, otherwise it would fail to redact information that needs to
be redacted. Another way to do this would be for ConnectivityService
to just call the method and catch NoSuchMethodError, but this code
runs fairly often and constructing exceptions is expensive.

This class is not used in this CL but will be used for NetworkSpecifier
redaction in ag/34242202 and ag/34242203

Bug 374037595
Flag: NONE new code nerver used

Change-Id: I8f88c6bb105ebf8d485e18cd214bebf2abe67e63

Kangping Dong   commited 2025-09-12 15:05:55 +08:00
89c94195a0
[Thread] add REDACT_FOR_THREAD_NETWORK_PRIVILEGED
This is used for redacting sensitive Thread info in
ThreadNetworkSpecifier (to be added in ag/34224158)

Bug: 374037595
Flag: EXEMPT new code is not used
Change-Id: I606d59fc5259c79bddaa51ca0c270684dd3b674a

Kangping Dong   commited 2025-09-02 21:23:21 +08:00
138e10e3ba
Convert uses of @hide to block tag
In most places the `@hide` doctag is treated as a block tag on its own
line. However, there are a few places where it is treated as an inline
doctag, e,g. `{@hide}`, and some places where it looks like a block
tag but is inline in the text, e.g. `Some text. @hide`. Dealing with
all the types increases the complexity of Metalava and makes it
slightly slower.

This change replaces the non-block tag forms with a block tag.

Flag: EXEMPT change the form of @hide does not change the API or behavior
Bug: 429965593
Test: m checkapi
Change-Id: I4ffe44a329dbcb7f0a7bd61af16c3bd99cacdac4

Paul Duffin   commited 2025-08-29 21:19:30 +00:00
6eaa841657
Merge changes I105ee1d6,I55817132 into main
* changes:
  Update ENABLE_MATCH_NON_THREAD_LOCAL_NETWORKS flag to target sdk 37
  Adopt mainline beta program for local network agent

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-21 10:28:00 -07:00
14debeb714
Update ENABLE_MATCH_NON_THREAD_LOCAL_NETWORKS flag to target sdk 37
The ENABLE_MATCH_NON_THREAD_LOCAL_NETWORKS compatibility flag is
now enabled for apps targeting SDK 37 or higher.

Previously, this flag was configured to enable for
Baklava (SDK 36) or higher. This is no-op because
there is no tethering network agent presents.

While the tethering network agents planned to be enabled in
25Q4, this adjustment allows developers sufficient time
to adapt to the behavior change where NetworkRequests
will match non-Thread local networks.

Flag: com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent
Test: atest ConnectivityCoverageTests --update-device \
      --test-filter '.*Connectivity.*'
Bug: 420590461
Change-Id: I105ee1d677c6beb12b4dccd109c01ef5ff2717d3

Junyu Lai   commited 2025-08-19 14:16:23 +08:00
1c513a6a6f
Allow app-specific network creation with a new permission
If an app registers a network agent and doesn't have NETWORK_FACTORY or
PERMISSION_MAINLINE_NETWORK_STACK, but does have
CREATE_APP_SPECIFIC_NETWORK, ConnectivityService will:
- Allow it to create a network
- Force the capabilities to contain only the app's UID
- Force the network to be restricted
- Ignore attempts to change the UID or make the network non-restricted

Test: TH
Flag: android.net.platform.flags.create_app_specific_network_permission
Bug: 435313135
Change-Id: I5a9517515e64f799c88aca4a51636b1a08e15817

Motomu Utsumi   commited 2025-08-15 12:54:49 +09:00
72d4b516c9
Include NET_CAPABILITY_NOT_VCN_MANAGED for tethering local network agent
Currently, NET_CAPABILITY_NOT_VCN_MANAGED is implicited added for
NetworkRequest built by normal apps.
However, the tethering network agent doesn't have this capability,
which makes the agent being exposed to VcnManager and cannot be
seen by normal apps.

Add NET_CAPABILITY_NOT_VCN_MANAGED to tethering NetworkAgent. Include
NET_CAPABILITY_NOT_VCN_MANAGED in local network capabilities for
metrics and API utilities to ensure correct evaluation of local
network connectivity. Update unit tests to reflect the new capability.

Flag: EXEMPT bug fix
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSSatisfiedByLocalNetworkMetricsTest \
      ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatisfiedByLocalNetworkMetricsTest \
      --update-device
Test: manual generate request by CTS and statsd_testdrive -e 10247
Bug: 428098173
Change-Id: Ifa9ce0827abd22d887a0e8a2ab6f4d7391b2b8ed

Junyu Lai   commited 2025-08-06 11:24:33 +08:00
fbf102a88b
Merge "Prepare to move VCN: Add visibilities for tests" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-07-15 13:09:27 -07:00
a5b6808587
Revert^2 "Implement opt-in to custom tabs in captive portals."
This reverts commit 5177b0b6b4.

Reason for revert: try again

Change-Id: I2832861643e4c5ab41b5d857e210f1fd9bf62a69

Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 23:47:42 -07:00
569563cb08
Revert "Implement opt-in to custom tabs in captive portals."
This reverts commit f2cb190a73.

Reason for revert: This is the integration test CL, it will break due to ag/34545776 reverted.

Change-Id: I5fc66fab409989479078dfcffea7793b9d6dd749

Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 22:23:21 -07:00
5177b0b6b4
Implement opt-in to custom tabs in captive portals.
This will allow portal operators to opt-in to custom tabs in
captive portal, either across the board with "true" or with
a version of the module above which it wants to opt-in.

Ideally there could be a separate key to also list opted-in
browsers and their versions, but this would become a lot
more complex. To start with, there is no place in
CaptivePortalData to store this kind of info, and that would
mean adding API which would have to be supported forever.

The constant inside the source represents a capport source that
contains the custom tabs opt-in. This is not a great place to put
this information in, but it has the characteristics of a benign and
useful hack :
- Time to market is 0
- It's easy to remove once we have a better API
- It's not a large problem if it's never cleaned up

Also, allowing to choose the browsers and the versions would
be uncomfortable since the choice of the browser is the user's
choice. On the one hand it does make some sense that the
operator could test with a given browser, see the UX is not
well adapted, and reject it, but on the other hand giving the
operator the choice of what browser the user can choose to
use on their portal is disputable, as this should generally be
under the control of the user.

In any case even if we decided to add a per-browser version
check it should be done in some other change.

Test: manual
Flag: EXEMPT opt-in feature
Change-Id: I540f4fcb6fb26f7f18077d9c8d06e5f7df206056

Chalard Jean   commited 2025-07-11 15:03:51 +09:00
f2cb190a73
Prepare to move VCN: Add visibilities for tests
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.

Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I51becaacb93d5e43b8b8234b80cb9b272181ad01

Yan Yan   commited 2025-07-10 20:47:00 +00:00
e82942e7c5
Merge changes from topic "avoid-bad-wifi-api-update" into main
* changes:
  Enable per-subId 'avoid bad Wi-Fi' setting storage
  Use ConnectivitySettingsManager API for avoid bad Wi-Fi updates

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-20 00:42:48 -07:00
553054fcee
Enable per-subId 'avoid bad Wi-Fi' setting storage
Breaks out the `network_carrier_aware_avoid_bad_wifi` setting from a single
string key into individual `Global.Settings` entries per subscription ID.

Flag: EXEMPT mainline
Bug: 424330991
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivitySettingsManagerTest
Change-Id: Ida673c1b8b915719b8e64ea85a66c2b98862e5f5

Jimi Chen   commited 2025-06-19 11:30:06 +00:00
1bfe086299
Merge "Allow VCN network to beat a physical cell in network ranking" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-06-17 11:09:54 -07:00
7b1145e6b4
Allow VCN network to beat a physical cell in network ranking
This patch adds a new POLICY to identify a VCN network offer, and
updates NetworkRanker to allow a VCN network to win over a physical
cell network. This is to fix the issue where VCN cannot exit safe
mode when there is already a phsical cell

Bug: 391977557
Test: NetworkRankerTest(new test)
Flag: EXEMPT bugfix
Change-Id: I00ebeb3eeb30ca8b46d25bbde1b6fd3dfee53993

Yan Yan   commited 2025-06-17 01:30:07 +00:00
6eab1d0af3
Merge "Improve annotation and javadoc for set/getTransportType APIs" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-12 04:34:11 -07:00
da3cfacbf6
Improve annotation and javadoc for set/getTransportType APIs
This change address api council review feedback for ag/33705589,
which includes:
  1. Mirror `@Transport` annotation in NetworkCapabilities to
     the NetworkTemplate class, because such annotation is
     not visible to NetworkTemplate class.
  2. Add @Transport annotation for the APIs.
  3. Add @throws in the javadoc.

Flag: com.android.net.flags.netstats_transport_type
Test: m
Fix: 424088371
Change-Id: I2c3ed5e1abc6d647bbb5af99446e3d75ed167f05

Junyu Lai   commited 2025-06-12 14:03:04 +08:00
c5f7cf21b5
Introduce carrier-aware avoid bad Wi-Fi APIs
This commit introduces new system APIs to manage "avoid bad Wi-Fi" settings,
leveraging both global system settings and carrier configurations. This
enhancement allows for more granular control and visibility into how Wi-Fi
networks are managed, especially in multi-SIM environments.

The new `setNetworkAvoidBadWifi(Context, int subId)` method provides
the ability to programmatically control this setting based on carrier-specific
policies or user preferences. This complements `getNetworkAvoidBadWifi(Context, int subId)`,
which allows querying the setting for a specific subscription ID, ensuring the
system can accurately determine the avoid bad Wi-Fi status.

Additionally, `shouldShowAvoidBadWifiToggle(Context, int subId)` is introduced.
This method determines whether the 'Avoid Bad Wi-Fi' user interface toggle
should be displayed. It considers both global settings and carrier configurations,
allowing for dynamic UI adjustments based on carrier requirements or user preferences.

These changes provide greater flexibility for managing Wi-Fi network selection
and improve the user experience by offering more context-aware control over
cellular behavior.

Deprecated APIs:
- `setNetworkAvoidBadWifi(Context, int value)`
- `getNetworkAvoidBadWifi(Context)`
New APIs:
- `setNetworkAvoidBadWifi(Context, int subId, int value)`
- `getNetworkAvoidBadWifi(Context, int subId)`
- `shouldShowAvoidBadWifiToggle(Context, int subId)`

Flag: com.android.net.flags.carrier_aware_avoid_bad_wifi
Bug: 410976315
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivitySettingsManagerTest
Change-Id: I79469cfe865a585593219d226c8198206c06b589

Jimi Chen   commited 2025-06-10 12:18:35 +00:00
92e23acebb
Merge "Add NetworkCapabilities transport types into NetworkIdentity." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-27 00:41:35 -07:00
2a4acb194c
Fix NetworkAgent 4-way binder interlock
System server        |    Client (e.g. phone)
------------------------------|-----------------------------
                              |
NetworkAgentMessageHandler ←--|--- INetworkAgentRegistry
              ↓               |              ↑
                              |         NetworkAgent
        NetworkAgentInfo      |              ↑
              ↓               |      NetworkAgentHandler
                              |              ↑
         INetworkAgent     ---|--→   NetworkAgentBinder

The simplest artifact is observed by watching the output of
adb shell dumpsys meminfo -d phone | grep 'Proxy Binders'
while turning airplane mode on and off (slowly, to allow the
cell network to connect and disconnect).
This will display the number of binder proxies. Before this, the binder
proxy count increases by 2 with each connection and never goes down (there
is some noise, as proxy objects are sometimes created for other reasons,
and get GC'd eventually). After this, the binder proxy count is always
eventually stable.

Also see b/133174607.

Bug: 400358935
Flag: EXEMPT bugfix
Test: manual, also regression test on the way
Change-Id: I1dcdaec1f3bd42bc2a406c9e9318208f96266bd6

Chalard Jean   commited 2025-05-26 11:16:51 +09:00
75349105d1
Add NetworkCapabilities transport types into NetworkIdentity.
This change updates NetworkIdentity to have NetworkCapabilities
transport types for improved network identification, and updates
NetworkIdentitySet for backward compatibility with older data.

Flag: EXEMPT implemented in the counter-part CL
Test: atest ConnectivityCoverageTests --test-filter \
      'NetworkIdentity*' --update-device
Test: atest ConnectivityCoverageTests --test-filter \
      'NetworkStats*' --update-device
Bug: 419123367
Change-Id: I26cc770d90b4687d832dd029d9a11db03404db39

Junyu Lai   commited 2025-05-24 00:30:41 +08:00
bebd4090ae
Merge "Parcel Network#mPrivateDnsBypass" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-19 00:03:32 -07:00
499961d60f
Extend QosFilter address matching function
Extend QosFilter address match function for IP address range based on
prefix length.

Bug: 406146808
Bug: 399960748
Flag: com.android.net.flags.qos_filter_ip_range_matching
Test: atest CtsNetTestCases
Test: atest ConnectivityCoverageTests
Change-Id: I78d995fda111d258da9a912c7afa5e472e43437f

Sewook Seo   commited 2025-05-08 22:37:32 -07:00
6305252415
Update enforceMeteredApnPolicy to follow the compat flag
On V+, ConnectivityService uses uid blocking state in BpfMap instead of
asking NetworkPolicyManager.
But, there was one behavior difference because NetworkPolicyManager
considers the network is always not blocked for apps without Internet
permission.
To ensure backward compatibility, the
NETWORK_BLOCKED_WITHOUT_INTERNET_PERMISSION flag was introduced in
aosp/3076606, aosp/3088285.

This CL updates enforceMeteredApnPolicy to respect this flag for
backward compatibility.

Test: CSEnforceMeteredApnPolicy
Bug: 404428733
Bug: 370383309
Flag: EXEMPT bugfix
Change-Id: I631f4f840818e1d40f20fccae1ec1a2cbbb6a166

Motomu Utsumi   commited 2025-04-21 12:19:45 +09:00
5759bf45a5
Parcel Network#mPrivateDnsBypass
Though all versions will parcel this, the behavior will not change
before B. Starting with B, this flag is parceled and handed over
to apps.

Test: ConnectivityCoverageTests, CtsNetTestCases
Flag: EXEMPT no behavior change before B
Change-Id: I7e9ae9011c74b80c208d8f297aa3b7d1aea176f2

Chalard Jean   authored and   Xiao Ma   commited 2025-04-07 11:46:38 +09:00
4f07a5b911
Make NetworkAgent#sendNetworkInfo public again
Changing this method to private broke OEM code that would link
directly against the non-public methods of the module. This
should not be allowed, and we have changes in the works to
disallow this, but in the mean time we can't afford to break
devices in the field.

Test: will have to see how it behaves in the lab on relevant devices
Flag: EXEMPT bugfix
Bug: 406489362
Change-Id: Ie6c1ebb04e49317fdda34ff3dd522cd9d4677556

Chalard Jean   commited 2025-03-28 18:09:13 +09:00
f7e102081d
Merge "Changing from EnabledAfter to Disabled for RESTRICT_LOCAL_NETWORK" into main
Sarup Dalwani   authored and   Android (Google) Code Review   commited 2025-03-27 06:46:52 -07:00
8590d2dfd9
Changing from EnabledAfter to Disabled for RESTRICT_LOCAL_NETWORK
The adb app compat command to enable fails for platform being old. Making this flag as disabled by default and overridable.

Bug: 405186661
Test: atest ConnectivityCoverageTests
Flag: EXEMPT bugfix
Change-Id: Ia1242803ed9b02290a5b66c4d1e224c87450d370

Sarup Dalwani   commited 2025-03-26 21:50:17 -07:00
65ce25496b
Revert "Revert "Add hidden API to register/unregister QUIC conne..."
Revert submission 3561690-revert-3538339-SNUWWZJNJZ

Reason for revert: NewAPI error will be fixed by separate CL

Reverted changes: /q/submissionid:3561690-revert-3538339-SNUWWZJNJZ

Change-Id: Ia7367e9332f4d376bd0be4c03c095ee00de9177a

Motomu Utsumi   commited 2025-03-27 08:49:00 +09:00
e8e28f6236
Revert "Add hidden API to register/unregister QUIC connection cl..."
Revert submission 3538339

Reason for revert: Likely culprit for b/406432012 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:3538339

Change-Id: I61b02f2b1b667e9a41b677f8062e8e96aac09f6e

Chaitanya Cheemala (xWF)   commited 2025-03-26 03:07:07 -07:00
947b53b0d3
Add hidden API to register/unregister QUIC connection close payload
QUIC stack running on the app process will call this API and register
QUIC UDP socket and UDP payload that can close QUIC connection.

When the app loses network access (e.g. due to freezer or firewall
chain), ConnectivityService 1)destroys the registered UDP socket by
sending a SOCK_DESTROY netlink message and 2)sends the registered UDP
payload to the server. This prevents unnecessary modem wakeups caused
by packets from the server after the apps lose network access.

Additionally, to close QUIC connection for apps that crash or are
killed, ConnectivityService sends the registered UDP payload when it
receives a socket destroy diag message for the registered socket.

Bug: 311792075
Test: CSDestroySocketTest CtsNetTestCases
Change-Id: I6cd727bd8bb0fe1d17360edfa395f73d24da6920

Motomu Utsumi   commited 2025-03-26 16:48:28 +09:00
627b8c6d34
Merge "Disable non-thread local network matching" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 08:08:56 -07:00
e0051cdeb9
Merge changes from topic "tetherlocalagent" into main
* changes:
  Add integration test of tethering local network agent feature
  Add unit test of tethering local network agent feature
  Support LocalNetworkAgent for Tethering

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 07:42:40 -07:00
0b7d710ba0
Disable non-thread local network matching
Currently, apps targeting V can see thread local network.

This change introduces a mechanism to make existing
apps unable to see non-thread local networks to ensure minimal
impact on existing devices and applications while adopting this
behavior. Apps targeting B+ Sdk and run on V+ devices can see
non-thread local networks.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalAgentTests \
      --update-device
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server --update-device
      (on next/trunk_staging release config)
Bug: 349487600
Change-Id: I6aa43cebc20a9017c2d8a8a90ebb1d53040a27bb

Junyu Lai   commited 2025-03-21 19:34:49 +08:00
0b806fd931
Support LocalNetworkAgent for Tethering
The feature will be gradually enabled via flag rollout.

Sample ip rule output:
0:	from all lookup local
10000:	from all fwmark 0xc0000/0xd0000 lookup legacy_system
11000:	from all iif lo oif dummy0 uidrange 0-0 lookup dummy0
11000:	from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
11000:	from all iif lo oif wlan0 uidrange 0-0 lookup wlan0
16000:	from all fwmark 0x10063/0x1ffff iif lo lookup local_network
16000:	from all fwmark 0x10064/0x1ffff iif lo lookup rmnet1
16000:	from all fwmark 0x10066/0x1ffff iif lo lookup wlan0
16000:	from all fwmark 0x10063/0x1ffff iif lo lookup wlan0
17000:	from all iif lo oif dummy0 lookup dummy0
17000:	from all iif lo oif rmnet1 lookup rmnet1
17000:	from all iif lo oif wlan0 lookup wlan0
18000:	from all fwmark 0x0/0x10000 lookup legacy_system
19000:	from all fwmark 0x0/0x10000 lookup legacy_network
20000:	from all fwmark 0x0/0x10000 lookup local_network
20000:	from all fwmark 0x0/0x10000 lookup wlan0
21000:	from all iif wlan0 lookup rmnet1
23000:	from all fwmark 0x64/0x1ffff iif lo lookup rmnet1
23000:	from all fwmark 0x66/0x1ffff iif lo lookup wlan0
31000:	from all fwmark 0x0/0xffff iif lo lookup rmnet1
32000:	from all unreachable

Test: adb shell device_config put tethering tethering_local_network_agent 1
Test: atest TetheringTests:android.net.ip.IpServerTest TetheringManagerTest
Bug: 349487600
Change-Id: Iaa88dde645da917149fec0d44fff796c551bcc7e

Junyu Lai   commited 2025-03-21 17:16:46 +08:00
d55bd89bd6
Merge "Changing the targetSdkVersion for RESTRICT_LOCAL_NETWORK" into main
Sarup Dalwani   authored and   Gerrit Code Review   commited 2025-03-20 23:13:12 -07:00
d43a4fdbfd
Changing the targetSdkVersion for RESTRICT_LOCAL_NETWORK
The targetSdkVersion was set to enable after current_development version
so the test cases targetting current do not have change enabled. It was
observed that user builds did not allowed changing compat flag on
current values. Changing this to enabled after baklava.

Bug: 405183129
Test: atest ConnectivityCoverageTests
Change-Id: Ifeb7cde9f1a7d2b5a254f297207d625bf9d02731

Sarup Dalwani   commited 2025-03-21 04:32:25 +00:00
5f020a5ab8
Add MatchNonThreadLocalNetworks flag in NetworkCapabilities
This is for backwards compatibility. Apps targeting V or lower
SDK should not see Tethering network agent.

This restriction is still disabled to maintain no-op in this
change. Will be enabled when introducing ConnectivityService
part in the subsequent change.

Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest \
      ConnectivityCoverageTests:android.net.connectivity.com.android.server \
      --update-device
Bug: 349487600
Change-Id: I99405ab62e82ff4b7fcebffd3a1a31ec6d8962a9

Junyu Lai   commited 2025-03-21 10:36:41 +08:00
f3ae766e8e
Remove the queue on the NetworkAgent side
Now that the system server has a queue doing this job,
the queue on the network agent side can be removed.

Test: ConnectivityCoverageTests, CtsNetTestCases
Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b

Chalard Jean   commited 2025-03-18 19:23:57 +09:00
391ec5d99c
Reapply "Return the registry in registerNetworkAgent."
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 653d5f1ef4.

Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: If6b1541981803dc84de57b48adb13d40c9997fa0

Chalard Jean   commited 2025-03-18 14:42:39 +09:00
8a97692638
Revert "Return the registry in registerNetworkAgent."
Revert submission 3535182

Reason for revert: <Droidmonitor created revert due to b/404070202.Will be verified through ABTD for standard investigation.>

Reverted changes: /q/submissionid:3535182

Change-Id: I2febd2ee7227d487d9cd69dcabd9c04f888fd2de

Pechetty Sravani (xWF)   commited 2025-03-17 00:48:05 -07:00
653d5f1ef4
Return the registry in registerNetworkAgent.
This is a resubmit of
I0fd90716b9f5501bdcdc7ee5165321737a0076ae
which did not account for testing of this private method
in Telephony tests.

Also make the network agent registry two way to eliminate
reordering possibilities.

Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I9ca025b1369dcb1202f906d5cff79e3d935b40da

Chalard Jean   commited 2025-03-14 13:23:50 +09:00
80d4326d76
Add a method to help mocking registerNetworkAgent
This is a trick to help mocking registerNetworkAgent without
having to import its return type. In the near future the
return type will be changed to a non-public class, which
can't be seen in CTS.

Really this shouldn't be necessary because only Connectivity
tests should mock ConnectivityManager, but the practice is
different and other mockers need this support.

See also aosp/3538922

Test: NetworkAgentTest
Change-Id: I3ac63d95d3830a3b413f9ad12b84ac426b63dd08

Chalard Jean   commited 2025-03-14 13:23:37 +09:00
8fd6347d35
Revert "Return the registry in registerNetworkAgent."
This reverts commit 70ede3260c.

Reason for revert: Likely culprit for b/402365566 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: If72cc264c5e505348309c6c11dbbfd11adeaf31b

Chaitanya Cheemala (xWF)   authored and   Gerrit Code Review   commited 2025-03-11 06:05:49 -07:00
846fb39e8a
Return the registry in registerNetworkAgent.
Also make the network agent registry two way to eliminate
reordering possibilities.

Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I0fd90716b9f5501bdcdc7ee5165321737a0076ae

Chalard Jean   commited 2025-03-11 16:26:17 +09:00
70ede3260c
Change NETWORK_BLOCKED_WITHOUT_INTERNET_PERMISSION ChangeId to target 37+
This was causing issues with jobs execution using JobScheduler, in apps that don't request INTERNET permission.

Bug: 397348342 
Flag: EXEMPT changes a compat flag
Change-Id: I1c421cbaff815ed761ec4c0da3ead942ddc55d5c

Sandeep Bandaru   commited 2025-03-05 02:38:22 -08:00
597a64fc23