Use type + scope as key to build cached address map so that
SAP (key: TETHERING_WIFI + INTERNET) and LOHS
(key: TETHERING_WIFI + LOCAL) can use different address.
Bug: 233175023
Test: atest TetheringTests
Change-Id: I46a4b3ee919628092b7540202a43d79f407b09b6
This change store localOnly wifi clients in its own field so that
tethered and localOnly hotspot clients can exist at the same time.
Currently, there are no tethered and localOnly hotspot clients at
the same time because PrivateAddressCoordinator does not support
SAP + LOHS. A follow-up change will be made to allow this.
When both SAP and LOHS are enabled, the SAP and LOHS clients from
TetheringEventCallback#onClientsChanged are all TETHERING_WIFI.
Currently, there is no way for the listeners to distinguish between
SAP and LOHS clients.
Bug: 233175023
Test: atest TetheringTests
Change-Id: I01b0a6abb084f7135f7825e0c5303e49c16a4c39
Starting with U, only explicit intents will be allowed to
launch non-exported internal components. Set package name
to entitlement recheck intent so that the intent could be
delivered to tethering itself successfully.
Bug: 278482046
Test: atest TetheringTests
manual verify entitlement recheck work in U
Change-Id: Ife30eee13fe39509ccb5786d2a76fbb7baa022a8
This change centralized some common test codes to
verifyHotspotClientUpdate() to facilitate the following
commit for softap+lohs
Bug: 233175023
Test: atest TetheringTests
Change-Id: Iee3905084b244b91abdf7c562d77b5054d58ff6a
Address a TODO in TetheringConfiguration to use a dependency object
instead of static mocking on DeviceConfig.
This avoids TetheringConfiguration dependencies on internal
implementation of DeviceConfigUtils, unblocking changes in
DeviceConfigUtils.
Bug: 279108992
Test: atest TetheringTests
Change-Id: I252eaadff85fa47b894e989b4f2527b00c5dca56
This commit adds two new fields, tx_bytes and rx_bytes, to the
UpstreamEvent message. These fields provide information about the
amount of data transferred during the event, which can be useful for
network performance analysis. The current tx/rx usages are always
zero, but it will be updated in a later change to reflect the actual
usage. No changes were made to the existing fields upstream_type and
duration_millis.
Test: atest TetheringMetricsTest
Change-Id: I9e1043b3fff5aa3f548b8696bac7e5bc4271c77c
Add the AIDL HAL service interface support and abstract the HIDL/AIDL
interface implementations to allow OffloadController to talk to both
interfaces.
Bug: b/205762647
Test: atest com.android.networkstack.tethering
atest ConnectivityCoverageTests
atest ConntrackSocketTest
Change-Id: If7634a298d03668ed70b328f1ad6ca0ac0fe170b
Somewhat surprisingly, HandlerThread#quitSafely is *not* a synchronous
method, so the tearDown() method still needs to wait for the thread to
join.
Test: TH
Change-Id: I0433e2100adf9299a67af5c259a518cf44f4be57
In testUpstreamCapabilitiesChanged, verify that
onUpstreamCapabilitiesChanged is called just after which function
triggered onUpstreamCapabilitiesChanged.
Bug: 243516306
Test: atest TetheringTest
Change-Id: Icd871654455033475092b9e7376b604cb0ba00eb
The duplicated upstream change event on the same network is a bug
which needs to be fixed.
Bug: 243516306
Test: atest TetheringTest
Change-Id: I7c70328d937877ec9832a2764cfb331561ee34b6
UpstreamNetworkMonitor#setCurrentUpstream is going to be removed
because UpstreamNetworkMonitor#mTetheringUpstreamNetwork is unused.
Use tethering event callback to check upstream change.
Bug: 243516306
Test: atest TetheringTest
Change-Id: I5773cfc80190b554a3b63b4f827c220b0e663427
This is a preparation for migrating the upstream change notification.
Changes:
1. Modify testUpstreamNetworkChanged
- Add losing upstream test
- Verify the capabilities on the explicit network
2. Modify testUpstreamCapabilitiesChanged
- Verify the capabilities on the explicit network
3. Add testUpstreamCapabilitiesChanged_stopTethering
- Test that TetherModeAliveState#exit sends the null upstream
notification. Above tests only covers the notifications which
are triggered by chooseUpstreamType or EVENT_ON_CAPABILITIES.
Bug: 243516306
Test: atest TetheringTest
Change-Id: I8f5b23f93c27b8c690b2fd275e3f636fbaeb4973
* changes:
Tethering: deprecate CONNECTIVITY_ACTION on U+ device
Test: add tests to testChooseDunUpstreamByAutomaticMode_*
TetheringTest: separate setup func from chooseDunUpstreamTestCommon
TestTetheringEventCallback may use assertEquals(actual, expected)
but assertEquals(expected, actual).
It is confused while test is failed.
For example:
Code:
callback.expectUpstreamChanged(new Network[] {null} /* expected */);
Before:
java.lang.AssertionError: expected:<100> but was:<null>
After:
java.lang.AssertionError: expected:<null> but was:<100>
Bug: 243516306
Test: atest TetheringTest
Change-Id: I6a987e4dd1cccc5e79da7dda55f194291e0c4a60
This test relies on forceGc to free and finalize the TetheringManager
before perform validation checks. In some test suites, if there were
already too many unused objects accumulated in the system before
running the test, it might take more than 5 seconds to free them.
Increase the maximum retry time to 30 seconds to fix the flakiness.
Bug: 263335396
Test: atest TetheringServiceTest#testTetheringManagerLeak
run the flaky test suite on ABTD with CL
Change-Id: I38bee3d43fbeb278993d113ccbe0645aedc5d75d
Respect the upstream interface mtu instead of always setting
mtu 1500.
Using upstream interface mtu is probably not the best solution
for tether offload pmtu but it at least respects the upstream
interface mtu which may be less than 1500.
Test: manual test
1. Connect to carrier Taiwan Star.
2. Enable tethering and check the mtu 1434 in dumpsys.
IPv4 Upstream: proto [inDstMac] iif(iface) src -> nat ->
dst [outDstMac] pmtu age
udp [02:10:45:32:ef:35] 54(54) 192.168.72.125:39034
-> 15(rmnet1) 100.83.189.11:39034
-> 142.251.43.14:443 [00:00:00:00:00:00] 1434 69657ms
IPv4 Downstream: proto [inDstMac] iif(iface) src -> nat
-> dst [outDstMac] pmtu age
udp [00:00:00:00:00:00] 15(rmnet1) 142.251.43.14:443
-> 54(54) 100.83.189.11:39034
-> 192.168.72.125:39034 [9a:8a:4d:ec:a4:7c] 1434 69633ms
Bug: 262860312
Test: atest BpfCoordinatorTest
Change-Id: Ic6dcb95ed76d5306053e4645b6baebc67ff082cf
Prepare to share setup function to more dun network tests.
No operation is changed.
Bug: 257408654
Test: TetheringTest
Change-Id: I29f08d8bc3cf83aa9d03f5d2819a1c67466b7bcc
The legacy upstream selection flow is never called after T. Stop the
related test cases after T also.
Bug: 257408654
Test: atest TetheringTests
Change-Id: I62692bb9a49dde432d31bece41b4cff442a327d1
Those static method and constants are better to fit in
NetlinkUitls. Replace the usage.
Test: m
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I81e27b8264e39764a44a4ba87344e9ac940d920a
This change is part of aosp/2305844 to update
framework-configinfrastructure dependency.
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.
Test: m
bug: 253019048
Change-Id: Iba194c664c1c701e396e7a2a036bd03772644db8
Merged-In: Ic5323c10b7c899fbf9af41444915359f23db17b5
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.
Test: m
bug: 253019048
Change-Id: I29f993342e1baf4e75b30c8d99de10bc087a582b
Simply the upstream selection since U+ device for tethering refactor.
Changes:
1. Support automatic mode only on U+ device.
2. Add two tethering tests to make sure that the resource config can't
control automatic mode anymore. Expect that always automatic mode
on U+ device. Also limit some existing tethering tests for R, S,
or T.
Changes of TetheringTest:
- testAutomaticUpstreamSelectionWithConfigDisabled (U+) [new]
- testLegacyUpstreamSelection (T-)
- testChooseDunUpstreamByLegacyMode (T-)
- testChooseDunUpstreamByAutomaticModeWithConfigDisabled (U+) [new]
3. Add two tethering configuration tests to make sure that automatic
mode is always enabled no mater what the resource config or flag
are on U+ device. Also limit some existing tethering tests for R,
S, or T.
Changes of TetheringConfiguration:
- testChooseUpstreamAutomatically (T-)
- testChooseUpstreamAutomaticallyAfterT (U+) [new]
- testChooseUpstreamAutomatically_FlagOverride (R)
- testChooseUpstreamAutomatically_FlagOverrideOnSAndT (S, T)
(Renamed from testChooseUpstreamAutomatically_FlagOverrideAfterR)
- testChooseUpstreamAutomatically_FlagOverrideAfterT (U+) [new]
Bug: 257941865
Bug: 257408654
Test: atest TetheringTest
Change-Id: I7ace317a1529177a84557741dc07d732b7f8cf89
This is no-op change. Tethering shouldn't use connectivity namespace
because it already be used for NetworkStack module. The new feature
should check isTetheringFeatureEnabled instead.
Bug: 238274852
Test: atest TetheringTests
Change-Id: I009f654d0bf8df7051b822e666e3206dd70a5523
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I7625fa386afe93823b97cb2ecb8fd09a5856c05b