isEthernetTetheringSupported() has been not used since
using TetheringManager#isTetheringSupported in aosp/2143272.
Bug: 258637850
Test: EthernetTetheringTest
Change-Id: Ifc560613301393eeadb6df11688944b2dc629c35
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
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting a future
platform release and registering a receiver for non-system
broadcasts must specify either the exported or not exported flag
when invoking #registerReceiver; if one of these flags is not
provided, the platform will throw a SecurityException. This commit
adds the RECEIVER_NOT_EXPORTED flag to the receiver in
EntitlementManager since this broadcast is sent as a PendingIntent
alarm.
Bug: 234659204
Test: atest com.android.networkstack.tethering.EntitlementManagerTest
Change-Id: I46c2df038ccf7669636166f50fe0331efcc42e4b
The library provides an interface to interface with the
ConnectivityNative service, and implement port blocking APIs.
Bug: 179733303
Test: atest connectivity_native_test
Change-Id: Iad1c84b5eeab835aca14a2db72a900e099aa3c1c
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
Going forward targetSdkVersion would be set by build system.
It would be by default set to 10000 before SDK finalization,
and updated to the new API level after finalization.
Effectively it would mean:
1. '10000' in aosp and internal master
2. Finalized number in development branches like "33" in "tm-dev"
3. As sdk hasn't been finalised in "udc-dev", it would be "10000"
which would be automatically updated to finalized version after sdk finalization.
Removing the target sdk version declaration from the blueprint and manifest files.
More details can be found here go/mainline-modules-target-sdk-version-fix
Bug: b/242296003
Test: croot; sdks=`find ./out -name 'TetheringGoogle.apk' | grep -v .intermediates`; echo $sdks; for sdk in $sdks;do aapt2 dump badging `echo $sdk` | grep targetSdkVersion:; done
1. outputs 33 in tm-mainline-prod
2. outputs 10000 in master
Change-Id: I2657901f066a5220ae0f807846b32b9c41afcce9
This includes in particular {Full,Network}Score.POLICY_* members
which were removed recently.
Before :
Policies : 55&62&63
After :
Policies : EVER_EVALUATED&EVER_VALIDATED&IS_VALIDATED
This patch also unifies the directives under Tethering/ for
simplicity.
Test: adb logcat & dumpsys connectivity & dumpsys tethering
Change-Id: I3d231fbaaebe233b2633da8bb880b5ad1613a32f
DCLA (Dynamic Common Library Apex) is a mechanism used by Mainline, which places shared c++ libraries into a separate apex in order to de-duplicate them, with the goal of reducing the overall size of a train.
This change results in two packages being built:
If the APEX_BUILD_FOR_PRE_S_DEVICES=1 is set, the apex will have min_sdk set to 30 as before, and this will deliver to Android 11.
If the flag is not set, the second package will have min_sdk set to 31, and will deliver to Android 12 and beyond.
If developers intend to build an apex for use in R as before, they must set the flag APEX_BUILD_FOR_PRE_S_DEVICES=1, which will set the min_sdk to 30 as before. If not set, the new default behavior will set the min_sdk to 31.
This new variant will be post-processed and trimmed by Mainline infrastructure, and the resulting trimmed module can only be installed on S+ devices, requiring that we set the min_sdk to 31.
Test: APEX_BUILD_FOR_PRE_S_DEVICES=1 m com.android.tethering & verify
sdk_version = 30
Test: m com.android.tethering & verify sdk_version = 31
Bug: 247762791
Change-Id: I2d6563867e3ca36f678fe0abadbe197946a82094
Needed because default Ipv6ForwardingRule#toString doesn't dump
actual data. It is hard to know why two rule comparison failed
in the test failure.
Bug: 250552545
Test: atest BpfCoordinatorTest
Change-Id: Iaf29c888238573c7c9a0a4e0bd65fbe468084e51
Ignore stopping monitoring if the monitor has never started
for a given IpServer.
Also fix the related bug in
BpfCoordinator#testStartStopConntrackMonitoring.
Bug: 250552545
Test: atest BpfCoordinatorTest
Change-Id: I7ac71f0ed52bf52244aadaa3c90ca8df239873e4
Only test testTetherClatTcp on S+ device because R device test
is blocked on b/234727688.
Bug: 234727688
Test: atest EthernetTetheringTest
Change-Id: I65a4a8c4fe13b8320b036380b9038af094ac95a5
Reason for revert: November mainline trains has been branched,
re-submit CLs and request API review.
Re-submitted Changes:
Ib5616c65c:[ST02.2] Use the getters of DnsHeader
I5e58f99b0:[ST02.1] Add TYPE_CNAME constant to DnsResolver
I0c1547cbc:[ST02] Add methods for synthesizing DNS packets
Change-Id: Ifb727e464d3523bd8dee0f2d919a8fb4a9d207c5
aosp/1536721 is merged, so this code duplication should not be needed any more.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic05adfc46495086d7f681322aac7acddc30a2260
Used to avoid flaky test because upstream changed events
order can't be guaranteed. Once tethering choose non-test
upstream {wifi, ..}, test network wont't be chosen.
Fix flaky tests which are using initTetheringTester():
testIcmpv6Echo
testTetherClatUdp
testTetherUdpV4_VerifyBpf
testTetherUdpV4
testTetherUdpV4Dns
testTetherUdpV6
Moreover, add permission ACCESS_WIFI_STATE to AndroidManifest.xml
to avoid nested runAsShell while using CtsNetUtils to access WIFI.
STACKTRACE:
java.lang.IllegalStateException: adoptShellPermissionIdentity calls must not be nested
at com.android.testutils.TestPermissionUtil.runAsShell(TestPermissionUtil.kt:49)
at com.android.testutils.TestPermissionUtil.runAsShell(TestPermissionUtil.kt:70)
at com.android.testutils.TestPermissionUtil.runAsShell$default(TestPermissionUtil.kt:65)
at com.android.testutils.TestPermissionUtil.runAsShell(Unknown Source:16)
at android.net.cts.util.CtsNetUtils.disconnectFromWifi(CtsNetUtils.java:293)
at android.net.cts.util.CtsNetUtils.disconnectFromWifi(CtsNetUtils.java:255)
at android.net.cts.util.CtsNetUtils.toggleWifi(CtsNetUtils.java:160)
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: I814899ae71f5c302d490a0dd81d7210ac138faa5