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
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 Yanauthored and Nathan Haroldcommited 2025-02-27 11:33:21 -08:00
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
Remove an unused import due to changes in code review.
Bug: 8675309
Test: compilation
Flag: exempt Trivial cleanup
Change-Id: I69b580de6725cad29af6dd17bc10deccf95cdda4
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
This patch migrates VCN framework code from framework-minus-apex
to framework-connectivity-b, and VCN service code to
service-connectivity-b-pre-jarjar. This patch is part of the work
to move VCN to the Tethering module.
Design doc: go/mainline-vcn-eng-design
Bug: 369703242
Test: FrameworksVcnTests, CtsVcnTestCases, CtsStrictJavaPackagesTestCases
Flag: EXEMPT code refactoring; no functional change
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5abd00b03916d15495a96b25f17f98e6e9a5317b)
Change-Id: I747556281db2efab7115761147842d241fe283de
Merged-In: I747556281db2efab7115761147842d241fe283de
This patch cleans up the flag check in the functional code. The
flag is already fully released in Android V
At the same time, the flag definition is not removed because it
is an exportable flag
Bug: 380326369
Bug: 276358140
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT, clean up released flag
Change-Id: I985d37e192c4bc87ebd433f4de3b7fe93b039f7d
This patch moves the VCN utilities from the systemserver classpath
to boot classpath. In this way, the code consumers that do not
have the source code (previously framework.jar and now services.jar)
do not need to statically include the files anymore. It also removes
the burden of class jarjar
Bug: 288465472
Test: presubmit: FrameworksVcnTests, CtsVcnTestCases,
FrameworksIkeTests, CtsIkeTestCases, VpnTest
Flag: EXEMPT code refactoring; no functional change
Change-Id: I7560a35727d62344c89f9a3b9ec9f0eb0058a1a2
To mainline VCN, we need to first change the VCN flag host
container to be the tethering module and then use a buid flag to
control whether to include VCN in the non-updatable platform or
the module. After the container changes, when VCN is still in the
platform, the VCN code can only access flags via "exported" mode,
and only API flags are exportable and accessible. Thus the
fix_config_garbage_collection flag needs to be handled
It is safe to clean up this flag because it is a low risk bug fix
and it has been in teamfood for a week with no issue being seen.
Bug: 370862489
Test: FrameworksVcnTests; CtsVcnTestCases
Flag: EXEMPT flag clean up
Change-Id: If38b46735e7b20d918b7483c16b30101416b0a6c
The garbageCollectAndWriteVcnConfigsLocked is for removing
configs whose subgroups do not have any subscriptions. This
patch fixes the issue of it in handling race condition when
subscription changes.
Previously the garbage collection checks a subGroup's
subscriptions based on SubscriptionManager. When
SubscriptionManager and TelephonySubscriptionSnapshot are
out-of-synced, the config of an active VCN instance will be
removed. It can cause NPE in getUnderlyingNetworkPolicy. This
patch fixes it by checking subscriptions against the snapshot.
This patch also fixes the safety check in
getUnderlyingNetworkPolicy so that if VCN instance exists but
its config does not, it will not attempt querying data from
the VcnConfig
Bug: 370862489
Test: FrameworksVcnTests(new tests); CtsVcnTestCases
Flag: android.net.vcn.fix_config_garbage_collection
Change-Id: Id54adabcc1910102a2ab20c432b693a8f52c5c95
This is a preparation CL for mainlining VCN. This patch adds utility
methods for callers to easily get WifiInfo and subId. It also adds
a Builder class that will be exposed as a @SystemApi in a followup
CL.
Bug: 369710077
Test: atest FrameworksVcnTests(new tests) && atest CtsVcnTestCases
Flag: Exempt low risk utilities for pure refactoring
Change-Id: I257b031dabfc48286e8bae2a0854c81aca2f189c
This is a preparation CL for moving VCN to mainline
Bug: 366598445
Bug: 367831385
Test: atest CtsTelephonyTestCases:TelephonyManagerTest
Flag: android.os.mainline_vcn_platform_api
Change-Id: Ic6098978f034678e6f42f1777ae93d3973bc099e
This patch removes three hidden API usages for moving
VCN to a mainline module. They are:
- TelephonyManager#getNetworkTypeName(int)
- TelephonyNetworkSpecifier(int)
- SubscriptionManager#isValidSlotIndex
Bug: 288465472
Test: atest FrameworksVcnTest && atest CtsVcnTestCases
Flag: EXEMPT pure refactoring
Change-Id: I09e68006461ac9c5a69eddd27f801f9ed40d15fa
Flag fix_crash_on_getting_config_when_phone_is_gone has been advanced to
next for a while and no regression is observed. Clean it up for now to
keep code healthy.
Bug: 319791612
Test: atest TelephonySubscriptionTrackerTest
Flag: EXEMPT flag clean up only
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4078c0f51a1d7d3f27534bc9026778859b7442bd)
Merged-In: I8d02430b70c1ed432826e02bc5938c6772ff1f95
Change-Id: I8d02430b70c1ed432826e02bc5938c6772ff1f95
rambowangauthored and Android Build Cherrypicker Workercommited 2024-09-12 02:17:44 +00:00
Require VCN to be used by a "main user" instead of a "system user"
since "system user" will no longer be a full user on HSUM devices
Bug: 310310661
Test: FrameworksVcnTests, CtsVcnTestCases on non-hsum and hsum devices
Flag: android.net.vcn.enforce_main_user
Change-Id: I5abfa7ba82055cd953083b1ab3f83e61bafd8a55
IpSecTransformState is a new API that exposed from a mainline module.
Ideally before SDK finalization, platform should check the API flag
com.android.net.flags.ipsec_transform_state before calling the API.
However the flag is defined in mainline module is not accessible from
the platform. Thus previously a placeholder flag was used.
This patch removes the usage of the placeholder flag. Instead the
code will check the availability of the API with a try catch block
Bug: 328844044
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: NONE mainline API flag not accessible; using try catch
block to gate the behavior
Change-Id: Ibbcb14817a6d714cdc99cf0894f1fc935a602a2c
When the expected received packet number is smaller than 10, the
packet loss detection result will be ignored because the sample
size is too small to ensure a reliable result.
This patch also fixes the bug where the detector does not update
ths packet loss threshold when carrier config updates
Bug: 332598276
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Change-Id: Iccc47e83c48699d139029420572e2a2616c357cd
This pacth enables IPsec packet loss detector to handle the case when
there is an intentional sequence number leap on the server's downlink.
Previously the detector assumes that sequence number will always
increase consecutively, which is not true. During load balancing the
server might add a big leap on the sequence number intentionally. In
such case a high packet loss rate does not always indicate a lossy
network. At the same time, a low loss rate does mean the network is
not lossy
Bug: 332598276
Test: atest FrameworksVcnTests (new tests) && atest CtsVcnTestCases
Change-Id: I163cb274d293a305499fd60f7ad6eed394af5a4d
Refactor getPacketLossRatePercentage to return an object instead of
an integer. This is for extending the Packet Loss Detector's ability
to handle inbound sequence number leap
This patch does not include any behavior changes
Bug: 332598276
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Change-Id: Ied42e581fb331ab0603225865236779f50cc4881
This CL calls CarrierConfigManager.getCarrierConfigSubset instead of
getConfigForSubId to guard against crashing when phone process has gone.
The former method is designed for system components to retrieve carrier
configs with consideration of phone process may be gone (e.g. during
rebooting from previous crash).
Bug: 319791612
Test: atest TelephonySubscriptionTrackerTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ee3f52163f38d541e089b379ac50405fc07da672)
Merged-In: I784610b243db2a666c1fe89b1438950a2f6a1478
Change-Id: I784610b243db2a666c1fe89b1438950a2f6a1478
rambowangauthored and Android Build Cherrypicker Workercommited 2024-03-20 18:41:14 +00:00
Split flags.aconfig to platform flags and module flags.
Platform flags are used from platform code.
Module flags are used for FlaggedAPI annotations in modules.
Bug: 321624552
Test: TH
Merged-In: Ie8e0f911d0f7d7e81d108b8e8ab539b29a255ad0
Change-Id: Ic868b70b3be10d4e394f005cd55a858acc7ba14d
This CL integrates the IpSecPacketLossDetector into VCN
route selection. With this change, when a data stall is
reported, the network candidate will be penalized and
then deprioritized during network selection. A network
candidate will stop being penalized until it hitting a timeout
or passing the validation.
Bug: 282996138
Test: atest FrameworksVcnTests(new tests), CtsVcnTestCases
Change-Id: Ifabd6fdea1d5a4fea40cf929dbab7c26d37274ac
This CL creates an abstract class NetworkMetricMonitor and a
subclass IpSecPacketLossDetector. IpSecPacketLossDetector
is responsible for continuously monitoring IPsec packet loss
and reporting to the caller when the data loss rate surpass
a threshold. This detector allows the VCN to switch from
the underlying network that has bad quality.
This CL also defines new carrier configs that specify the
data loss threshold and detecting frequency
Bug: 282996138
Test: atest FrameworksVcnTests(new tests), CtsVcnTestCases
Change-Id: I5f4b8e1821bdbb37f0a6de6e1584f8e3c87273f3
This is a preparation CL that allows followup CLs to add network
metric monitors. This CL does a pure refactoring without
introducing any behavior changes
Specific changes include:
- UnderlyingNetworkEvaluator now encapsulates the calculation of
mPriorityClass
- mIsSelected is moved from UnderlyingNetworkRecord to
UnderlyingNetworkEvaluator
- UnderlyingNetworkListener is simplified by moving the network
candidate out to the UnderlyingNetworkController
- NetworkPriorityClassifier now takes a "isSelected" boolean
instead of the currently selected network candidate
Bug: 282996138
Bug: 315858972
Test: atest FrameworksVcnTests, CtsVcnTestCases
Change-Id: I8461a68f1c4260b253d84d3efed2b09c41116656