Commit graph android_packages_modules_Co.../Vcn
Message SHA1
Log validated underlying network count that's available for VCN underlying network selection
Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases
Bug: 288600040
Change-Id: Ia1b51aa64388bc5c167f3a1081d8683d98fe0bef

Hnin Naing   commited 2025-09-12 22:50:11 +00:00
4ab80490ae
Log when VcnGatewayConnection is torn down, with reason
Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases
Bug: 288600040
Change-Id: I23b3edf9a2c128a7f8adabef3853fbe0be4a3193

Hnin Naing   commited 2025-09-11 18:26:04 +00:00
7602406ec8
Log VCN network connected and disconnected events.
Note that disconnected events are also important for getting correct validated duration metrics. Since they are whenever we teardown the network or VcnConnectionConfig, they will mark the end duration for network validated state also.

Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases
Bug: 288600040
Change-Id: I34401568287700e6ab356cff029620b6372354d0

Hnin Naing   commited 2025-09-09 18:51:33 +00:00
af8402b1a0
Log VCN network validated and not validated events.
Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases
Bug: 288600040
Change-Id: I574db304dc8377e70500f52f52d9b14934e5182a

Hnin Naing   commited 2025-09-09 16:49:17 +00:00
f0c44cb378
Merge "Convert uses of @hide to block tag" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-09-08 04:21:26 -07:00
4910c42dc7
Log VCN Gateway Connection safe mode transitions.
This change adds logging for when a VcnGatewayConnection enters and
exits safe mode.

Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases. go/atomtester
Bug: 288600040
Change-Id: I6423b9fe7a1785fe31b363c8acb0b99f8d5f7df3

Hnin Naing   commited 2025-09-04 14:34:38 -07:00
3a3a2376d5
Generate java code for VCN metrics
Add genrule for VCN metrics atoms and add wrapper utility class for logging using the generated java code, which currently has func for logging safe mode and VCN network validation states.

Bug: 288600040
Flag: EXEMPT METRICS
Test: atest CtsVcnTestCases, FrameworksVcnTests
Change-Id: Ia0f42c3435752399eb3ed480bfe62ffac31ccc1e

Hnin Naing   commited 2025-09-02 19:31:50 +00:00
340990fd30
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
Remove unexpected OWNERS files and VcnUtils
During VCN code move, git histories of OWNERS files and VcnUtils was
also moved to the VCN mainline code in the "git filter-repo" process.
Though it is unexpected, it is very hard to filter them out. Thus CL
is created to delete these files as a followup.

Bug: 430967429
Test: atest CtsVcnTestCases && atest FrameworksVcnTests
Flag: EXEMPT code move

Change-Id: I866b38eea1a8702d87c7fbb05e32213b3d96afa7

Yan Yan   commited 2025-08-18 22:29:16 +00:00
24f0412f82
Merge branch 'main-cts' into main-packages-modules-Connectivity
Yan Yan   commited 2025-08-15 02:04:28 +00:00
3671772c0f
Prepare to move VCN: Change license of VCN UT
This CL changes the license of FrameworksVcnTests since it will
be moved out of frameworks/base

It also adds the estination location to the "visibility" field

Bug: 379938062
Flag: EXEMPT; license changes
Test: presubmit
Change-Id: I261f3821632d0a063b7ce60ae62dada339161fb3

Yan Yan   commited 2025-07-10 20:54:43 +00:00
5ea7554d40
Prepare to move VCN: Define utility lib for IPsec module
This is a preparation CL before moving VCN code from frameworks/base
to p/m/Connectivity/

After VCN is move out of frameworks/base/, the IPsec module will
no longer include PersistableBundleUtils via framework-ike-shared-srcs
but will do that via vcn-utils-framework-ipsec

Bug: 379938062
Flag: EXEMPT; pure refactoring
Test: CtsIkeTestCases, FrameworksIkeTestCases
Change-Id: I2d405be630a05f5019e7711946fa46b4cf2a6ef8

Yan Yan   commited 2025-07-10 20:54:16 +00:00
f15ccef23b
Add CTS to verify VCN can exit safe mode
Bug:391977557
Flag: EXEMPT test code
Test: CtsVcnTestCases(new test added)
Change-Id: I8fdb2d643fc419024cd5609dff79336f4ab5cb96

Yan Yan   commited 2025-06-18 23:52:59 +00:00
8868136d97
Set POLICY_VCN in VCN network offer to fix safe mode
This patch sets POLICY_VCN in its network offer. This new policy
allows VCN to win over a physical cell network and thus fixs the issue
where VCN cannot exit safe mode when there is already a phsical cell

Bug: 391977557
Test: CtsVcnTestCases(new test)
Flag: EXEMPT bugfix
Change-Id: I68bea55c96051d0c7510df3713bfc52ff3460a01

Yan Yan   commited 2025-06-11 23:45:17 +00:00
1a3963cd5e
Backfill new field host_common_data
This new field ensures that the dependency is properly packaged with the module.
(original context: b/262397555)

Test: presubmit
Bug: 413525819
Flag: TEST_ONLY
Change-Id: I8dd5afedc35fc603d6ab7ddc27da6bf3efcea16a

Julien Desprez   commited 2025-05-15 13:04:52 -07:00
bbecc6879f
Merge "Skip VcnManagerTest if it is not main user" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-03-24 12:01:11 -07:00
2c1dfa9a4f
Skip VcnManagerTest if it is not main user
Bug: 404436811
Test: CtsVcnTestCases passed CF-Auto on forrest
Flag: EXEMPT; test code
Change-Id: Ie025346b1995a0d85cef3f676edd2785c3ab86ad

Yan Yan   commited 2025-03-24 10:54:03 -07:00
f35ca01c3f
Merge "Use Sdk36ModuleController to ensure VCN UT is only updated on B/B+" into main am: 488a149911 am: 915abab4fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3534300

Change-Id: I311b004f13f559730846576e52cfe82ab48c76b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2025-03-14 10:48:25 -07:00
cc2a3c838c
Use Sdk36ModuleController to ensure VCN UT is only updated on B/B+
Bug: 396782079
Test: v2/mainline-engprod/apct/mainline/tethering/R/device-all-gce
      test skipped
Test: preubmit
Flag: EXEMPT; test code
Change-Id: I0fb4cfb8ba300bb3d361536377fda5f9f0f8c3d9

Yan Yan   commited 2025-03-10 18:28:43 -07:00
f45dc00cd8
Use Sdk36ModuleController to ensure VCN CTS is only updated on B/B+
Bug: 396782079
Test: v2/mainline-engprod/apct/mainline/tethering/R/device-all-gce
      test skipped
Test: preubmit
Flag: EXEMPT; test code
Change-Id: Ica1925919bac32a3e00d5ea7abc73b7822b38980

Yan Yan   commited 2025-03-10 13:08:26 -07:00
3ddd16cc25
Merge "frameworks/base: remove deprecated Mockito usages" into main
Adrian Roos   authored and   Android (Google) Code Review   commited 2025-03-09 17:20:22 -07:00
9e3555bb97
frameworks/base: remove deprecated Mockito usages
Test: m checkbuild
Flag: TEST_ONLY
Bug: 310268946
Change-Id: Id68adb5ab554a8031f8d03f6158c0e9ffa03604c

Adrian Roos   commited 2025-03-05 06:01:15 -08:00
71f5ad53d9
Merge "Prevent VCN service from being registered twice" into main am: 8c9ae9dbdc am: 37b0be00ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3511351

Change-Id: I39ac77c2b34f465aecdf461db96c239fa4aa415b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2025-03-03 13:58:22 -08:00
e6ee9546b4
Merge "Prevent VCN service from being registered twice" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-03-03 13:09:19 -08:00
8c9ae9dbdc
Merge "Skip some VCN unit tests on user builds" into main am: 0384d3529e am: cdecd6183a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3506967

Change-Id: I2bf81f8b8155818b405efeb50cebda5c4759dff4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2025-02-27 12:32:58 -08:00
fcf201b7d9
Skip some VCN unit tests on user builds
Configuring restricted transport types is for experiments purposes and
only allowed on a debuggable build. This patch ensures relevant unit
tests are skipped on user builds.

Since the experimental configurability is no longer needed anymore, there will be followup CLs to remove the feature and the tests.

Bug: 397874808
Test: run mts-user -m FrameworksVcnTests on a BP2A.250218.001 user build
Flag: EXEMPT; test code change
Change-Id: I9ca23b2901d740d3ddc5ba4febba4a300e0812bb

Yan Yan   authored and   Nathan Harold   commited 2025-02-27 11:33:21 -08:00
32fef6574f
Prevent VCN service from being registered twice
This patch is for migrating VCN registration from platform to
Tethering module. Becuase the system image has switched to use
mainline prebuilts, the mainline change cannot merged together
with the platform change. The plan is to update the mainline
prebuilt first and then merge the platform change. Thus there
will be a short window where ConnectivityServiceInitializerB
will be called twice to register VCN. This patch allows
ConnectivityServiceInitializerB to prevent the duplicate
registration.

This patch allows Tethering module to know whether VCN is moved
to mainline at runtime. If VCN is in mainline, Tethering
module (instead of SystemServer) will register the VCN service.

Bug: 385203616
Test: atest CtsVcnTestCases && FrameworksVcnTests
Test: verified registration on Android B and Android V
Flag: EXEMPT; no functional code change
Change-Id: If551167f4bafc39a592d8b325be3ceecf16f0b6e

Yan Yan   commited 2025-02-27 11:20:32 -08:00
d49d816cd1
Merge "Change FrameworksVcnTests min_sdk_version to 30" into main am: 0e044a59fe am: 77728801de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3503058

Change-Id: Ic9c04efbd2a84dbd8cff7e255c593ae004a1ab6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2025-02-21 16:08:59 -08:00
aaffdf0240
Change FrameworksVcnTests min_sdk_version to 30
FrameworksVcnTests is included in Tethering MTS. Since Tethering
is an R module, this test suite needs to be installable on R devices

Bug: 396782079
Test: presubmit
Flag: EXEMPT; test change
Change-Id: Iff6f4a5b1b949510da34ea741a55671eeff9f155

Yan Yan   commited 2025-02-21 13:47:55 -08:00
b60033ae6b
Merge "Set min_sdk_version of framework-connectivity-b to 36" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-02-19 15:54:59 -08:00
445291fbc3
Set min_sdk_version of framework-connectivity-b to 36
VCN will be moved to Tethering module from Android B. Thus
setting the min_sdk_version to 36

Bug: 390096003
Test: atest FrameworkVcnTests && atest CtsVcnTestCases
Test: Enable VCN in mainline, sideload module and
      run mts-user -m CtsStrictJavaPackagesTestCases on AP3A
Flag: EXEMPT; bug fix
Change-Id: I427b2e0231e2ccdc870500399be9387036b14edc

Yan Yan   commited 2025-02-19 15:54:08 -08:00
51db20a202
Merge "Add VCN tests to tethering-mainline-presubmit" into main am: cbfc67d6d7 am: 438e4f2742
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3496422

Change-Id: I7f1b1626625ba12006bb179d76509f3a13c49bc9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2025-02-19 11:45:17 -08:00
ef032121e9
Merge "Add VCN tests to tethering-mainline-presubmit" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-02-19 10:35:10 -08:00
cbfc67d6d7
Add VCN tests to tethering-mainline-presubmit
Bug: 376896491
Test: presubmit
FLag: EXEMPT; TEST_MAPPING change
Change-Id: I7bd2ea66aec880de1c1a20edb60eb268a798ef94

Yan Yan   commited 2025-02-18 16:46:46 -08:00
bdaf039d2b
Merge "Add VCN UT to mts-tethering" into main am: eaf4cbf0de am: 3b946c39dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3486622

Change-Id: Id655a474c81c83fabffcd82b2716a50f3e803dda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yan Yan   authored and   Automerger Merge Worker   commited 2025-02-14 10:48:31 -08:00
82525428c7
Merge "Add VCN CTS to mts-tethering" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-02-14 10:15:41 -08:00
67e97c023d
Add VCN UT to mts-tethering
This patch adds FrameworksVcnTests to tethering MTS. Consequently,
these tests will be monthly updated and installed with Tethering
module on all Android R/R+ devices. Thus the patch also adds
SDK checks to make sure the mainline updated tests will be skipped
if SDK <= Android V, to avoid compatability issues.

Bug: 376896491
Test: lunch mainline_modules_arm64-mainline-userdebug &&
      m mts && mts-tradefed run mts-tethering;
      Verified on V and B
Flag: EXEMPT; test code change
Change-Id: Ied3596e0e63d8333c4d1019b96284b1c3547b23b

Yan Yan   commited 2025-02-13 13:25:44 -08:00
f00db40040
Add VCN CTS to mts-tethering
This patch adds CtsVcnTests to tethering MTS. Consequently,
these tests will be monthly updated and installed with Tethering
module on all Android R/R+ devices. Thus the patch also adds
SDK checks to make sure the mainline updated tests will be skipped
if SDK <= Android V, to avoid compatability issues.

Bug: 376896491
Test: lunch mainline_modules_arm64-mainline-userdebug &&
      m mts && mts-tradefed run mts-tethering;
      Verified on V and B
Flag: EXEMPT; test code change
Change-Id: Ib6d3d698925feef472d472be6def080580aa6ec3

Yan Yan   commited 2025-02-10 18:33:42 -08:00
0bd95f840d
Add CTS for getConfiguredSubscriptionGroups and getMaxMtu
Bug: 392954081
Test: atest CtsVcnTestCases
Flag: EXEMPT; test code
Change-Id: I6a7acb3556ee329883811b22b71af87f86f8013b

Yan Yan   commited 2025-01-29 10:45:29 -08:00
43de5b945c
Set TargetApi to BAKLAVA
Generated with
`cd frameworks/base/packages/Vcn/service-b && \
fdfind -t file . -x  sed -i -z 's#// TODO(b\/374174952): Replace VANILLA_ICE_CREAM with BAKLAVA after Android B finalization\n@TargetApi(Build.VERSION_CODES.VANILLA_ICE_CREAM)#@TargetApi(Build.VERSION_CODES.BAKLAVA)#g'

Flag: EXEMPT Baklava Finalization
Test: lunch mainline_modules_x86_64-next-eng && m
Bug: 376680864
Bug: 374174952
Bug: 392570119
Change-Id: I1dc2af23ac85d1c90b1419a14ca992e68106e9f7

Linus Tufvesson   commited 2025-01-27 05:52:49 -08:00
4eb48fe868
Merge "Jarjar IndentingPrintWriter with android.net.connectivity prefix" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-01-23 12:02:54 -08:00
897acc8c5e
Verify VCN dumpsys
Verify that VCN dumpsys will not crash the system. This patch prevents
dumpsys issues that caused by VCN service and framework code having
mismatched classes

Bug: 390490391
Bug: 386225194
Test: VcnManagerTest#testSetVcnConfigOnTestNetworkAndDumpsys
Flag: EXEMPT; test code
Change-Id: I5a61ffaf6ee6eb4275e43085a5c10ae037b90551

Yan Yan   commited 2025-01-22 13:43:48 -08:00
ee21eb02bc
Jarjar IndentingPrintWriter with android.net.connectivity prefix
This patch is to fix NoSuchMethodError thrown from VCN dumpsys when
VCN is in the Tethering mainline module.

Because VCN is in Tethering module, the VCN service will use a
jarjared IndentingPrintWriter. During dumpsys,
VcnManagementService#dump will create a IndentingPrintWriter
and pass it to VcnUnderlyingNetworkTemplate#dump. Then because
VcnUnderlyingNetworkTemplate fails to recognize the jarjared class, it
will throw NoSuchMethodError.

This patch fixes this issue by also jarjaring the IndentingPrintWriter
in VCN framework library. It is aligned with the end state where all
classes in the VCN framework code except APIs will be jarjared to
have a android.net.connectivity prefix

Bug: 390490391
Bug: 386225194
Test: atest CtsVcnTestCases(new tests)
Flag: EXEMPT; low risk and small scope bug fix
Change-Id: I34be6dbf816c752f6ba0b77dc4ad98c8ad71e743

Yan Yan   commited 2025-01-22 11:26:17 -08:00
d61bd78602
Remove Unused 'times' Import
Remove an unused import due to changes in code review.

Bug: 8675309
Test: compilation
Flag: exempt Trivial cleanup
Change-Id: I69b580de6725cad29af6dd17bc10deccf95cdda4

Nathan Harold   commited 2025-01-14 13:37:00 -08:00
3f24d36a3f
Unregister DeviceIdle Receiver in IpSecPacketLossDetector
Ensure that when the IpSecPacketLossDetector cleans up due to the
underlying network changing, that the broadcast receiver it's listening
to is cleaned up. Previously this would leak broadcast receivers.

Based on inspection, all instances that touch the BroadcastReceiver
are done on the same looper, so we shouldn't need to guard the creation
and destruction of the receiver.

Also, stop closing the monitored IpSecTransform. The monitor should not
have been closing the transform in the first place. Most of the time it
isn't an issue; however, in the event of MOBIKE, the transform will
remain open, so this is a functional bug.

Bug: 389208101
Test: atest IpSecPacketLossDetectorTest:testClose
Flag: EXEMPT bugfix
Change-Id: I26245960c36eaa0557d377b1672cc76ab0f70b03

Nathan Harold   commited 2025-01-13 16:48:07 -08:00
08d7eed3d5
Merge "Update VcnNetworkProvider to use thread safe Sets" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-01-13 10:04:57 -08:00
a8798c8bac
Update VcnNetworkProvider to use thread safe Sets
This patch is to fix a race condition when two threads
access VcnNetworkProvider.mRequests at the same time. The
issue happened when the VCN thread is removing elements and the
binder thread is iterating the Set. It causes the binder thread
to end up with a Null element and throw NPE

This patch fixes this threading issue by changing the Set to
be a thread-safe Set

Bug: 382106220
Test: atest CtsVcnTestCases && atest FrameworksVcnTests
Test: Set up test environment to make the race condition 90%
      reproducible; verified the fix by running the test for
      100 times on forrest
Flag: EXEMPT; low risk and small scope bug fix
Change-Id: Id7598a861368454efcd0aa49721c54e11aaebdf1

Yan Yan   commited 2025-01-10 10:52:36 -08:00
ce63e16ca8
Merge "Stop statically including IndentingPrintWriter in VCN service" into main
Yan Yan   authored and   Gerrit Code Review   commited 2025-01-08 10:30:09 -08:00
3f08503732
Increase the timeout to deflake the VCN test
This patch is to deflake testEnterSafeModeImmediately_safeModeEnabled.

Previously this test required that within 0.5 seconds after
setVcnConfig was called, VCN should send a VCN_STATUS_CODE_ACTIVE
callback to the cts. However, sending this callback requires
cts to gain carrier privileges and in some devices it takes longer
than 0.5 seconds. This patch mitigates the test issue by extending
the timeout.

Bug: 386884143
Test: CtsVcnTestCases
Flag: EXEMPT; test code
Change-Id: Id5f7b70a0c7f68e58ab045be2126194f936ebb0f

Yan Yan   commited 2025-01-07 15:47:01 -08:00
8f31a73b84
Stop statically including IndentingPrintWriter in VCN service
VCN service depends on LocalLog.java and WakeupMessage.java. Previously
VCN service will statically include framework-connectivity-shared-srcs
filegroup that has the two required classes. To avoid name class
conflicts, all classes in this filegroup need to be jarjared.

As results, VCN service will use a jarjared IndentingPrintWriter. During
dumpsys, VcnManagementService#dump will create a IndentingPrintWriter
and pass it to VcnUnderlyingNetworkTemplate#dump. Then because
VcnUnderlyingNetworkTemplate fails to recognize the jarjared class, it
will throw NoSuchMethodError.

This issue only exists when VCN is in the platform. When VCN is built
into Tethering module, a different build architecture is used and this
issue will be gone.

This patch fixes the NoSuchMethodError issue by creating temporary
copies of LocalLog and WakeupMessage and updating VCN service to
statically include them. When VCN modularization is fully done, these
two copies can be removed

Bug: 386225194
Test: atest CtsVcnTestCases && atest FrameworksVcnTests
Test: adb dumpsys vcn_management
Flag: EXEMPT; low risk and small scope bug fix
Change-Id: Ie5c099ac04133093c23f8ef6181bab08d1bf8e4b

Yan Yan   commited 2025-01-03 12:07:12 -08:00
39b842acfa