Commit Graph

735 Commits

Author SHA1 Message Date
Treehugger Robot
7acd206160 Merge changes Ie2ba9805,I8f5b23f9
* changes:
  Move onUpstreamCapabilitiesChanged out of reportUpstreamChange
  TetheringTest: improve onUpstreamCapabilitiesChanged test
2023-02-01 06:35:13 +00:00
Treehugger Robot
119e5adc14 Merge "TetheringTest: replace upstream change check by event callback" 2023-02-01 05:59:53 +00:00
Hungming Chen
650cc9c0d3 BpfCoordinatorTest: add testUpdateUpstreamNetworkState
Bug: 258637850
Bug: 241106456
Test: atest ConnectivityServiceTest
Change-Id: I156398ef7ffaceb454dc187682238821da77c72b
2023-01-31 16:35:09 +08:00
Hungming Chen
9e2c0f9df5 TetheringTest: replace upstream change check by event callback
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
2023-01-18 15:13:49 +08:00
Hungming Chen
9e9d74ca00 TetheringTest: improve onUpstreamCapabilitiesChanged test
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
2023-01-18 15:13:49 +08:00
Hungming Chen
f2abe15fe7 TetheringTest: correct the comment in chooseDunUpstreamTestCommon
Bug: 243516306
Test: atest TetheringTest
Change-Id: I642722498357dfb8f1582de50701f213c49f3077
2023-01-13 17:53:59 +08:00
Treehugger Robot
8043d5d7af Merge "TetheringTest: fix assert{*}Equals order in TestTetheringEventCallback" 2023-01-13 08:43:07 +00:00
Treehugger Robot
401f1ff2db Merge changes from topic "deprecate_connectivity_action_in_tethering"
* changes:
  Tethering: deprecate CONNECTIVITY_ACTION on U+ device
  Test: add tests to testChooseDunUpstreamByAutomaticMode_*
  TetheringTest: separate setup func from chooseDunUpstreamTestCommon
2023-01-13 08:41:20 +00:00
KH Shi
c91fbabd45 Merge "Fix TetheringServiceTest#testTetheringManagerLeak flaky" 2023-01-13 05:44:17 +00:00
Hungming Chen
b4859d1ea1 TetheringTest: fix assert{*}Equals order in TestTetheringEventCallback
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
2023-01-12 17:48:04 +08:00
KH Shi
0ed11f5a46 Fix TetheringServiceTest#testTetheringManagerLeak flaky
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
2023-01-12 08:25:34 +00:00
Hungming Chen
5c985e2cdd BpfCoordinator: publish upstream interface mtu to v4 offload rule
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
2023-01-03 23:36:30 +08:00
Maciej Żenczykowski
53e8697d39 Merge "BpfCoordinatorTest: renumber the test interface indices" 2022-12-30 20:46:16 +00:00
Hungming Chen
46767ff62e BpfCoordinatorTest: renumber the test interface indices
This is a preparation to add new interface index.

Test: atest BpfCoordinatorTest
Change-Id: I758c2e7142099d74099fb8203f41ffec9b1182ee
2022-12-28 21:47:11 +08:00
Hungming Chen
4c8c35748f Test: add tests to testChooseDunUpstreamByAutomaticMode_*
Add dun network test cases as follows.

Overall test coverage:
- testChooseDunUpstreamByAutomaticMode (original):
  common, test#1, test#2
- testChooseDunUpstreamByAutomaticMode_defaultNetworkWifi (new):
  test#3, test#4
- testChooseDunUpstreamByAutomaticMode_loseDefaultNetworkWifi (new):
  test#5
- testChooseDunUpstreamByAutomaticMode_defaultNetworkCell (new):
  test#5, test#7
- testChooseDunUpstreamByAutomaticMode_loseAndRegainDun (new):
  test#8
- testChooseDunUpstreamByAutomaticMode_switchDefaultFromWifiToCell
  (new):
  test#9, test#10

Overall test cases:
+-------+-------+-------+-------+-------+
| Test  | WiFi  | Cellu |  Dun  | Expec |
| Case  |       | alr   |       | ted   |
|   #   |       |       |       | Upstr |
|       |       |       |       | eam   |
+-------+-------+-------+-------+-------+
|   -   |       |       |       |   -   | --+
+-------+-------+-------+-------+-------+   |
|   -   |       |   V   |       |   -   |   |
+-------+-------+-------+-------+-------+   |   Implemented
|   -   |       |   V   |   O   |  Dun  |   +-- in chooseDun
+-------+-------+-------+-------+-------+   |   UpstreamTest
|   -   |   V   |   O   |   O   |  WiFi |   |   Common()
+-------+-------+-------+-------+-------+   |
|   -   |   V   |   O   |       |  WiFi | --+
+-------+-------+-------+-------+-------+
|       |   O   |   V   |       |   -   |
|   1   +-------+-------+-------+-------+
|       |   O   |   V   |   O   |  Dun  |
+-------+-------+-------+-------+-------+
|       |   O   |   V   |       |   -   |
|   2   +-------+-------+-------+-------+
|       |   O   |   V   |   O   |  Dun  |
+-------+-------+-------+-------+-------+
|   3   |   V   |   O   |       |  WiFi | (new)
+-------+-------+-------+-------+-------+
|   4   |   V   |       |       |  WiFi | (new)
+-------+-------+-------+-------+-------+
|   5   |       |       |   O   |  Dun  | (new)
+-------+-------+-------+-------+-------+
|   6   |       |   V   |   O   |  Dun  | (new)
+-------+-------+-------+-------+-------+
|   7   |       |       |   O   |  Dun  | (new)
+-------+-------+-------+-------+-------+
|       |       |       |       |   -   | (new)
|   8   +-------+-------+-------+-------+
|       |       |       |   O   |  Dun  |
+-------+-------+-------+-------+-------+
|       |   V   |       |   O   |  WiFi | (new)
|   9   +-------+-------+-------+-------+
|       |   V   |       |       |  WiFi |
+-------+-------+-------+-------+-------+
|       |   O   |   V   |       |   -   | (new)
|   10  +-------+-------+-------+-------+
|       |   O   |   V   |   O   |  Dun  |
+-------+-------+-------+-------+-------+

Annotation:
1. "V" means that the given network is connected and
   it is default network.
2. "O" means that the given network is connected and
   it is not default network.

Bug: 257408654
Test: atest ConnectivityCoverageTests
Change-Id: Ie7beda1a8fcfd2a3f2600ca601f58d869144d275
2022-12-28 02:28:00 +00:00
Hungming Chen
ecfe710805 TetheringTest: separate setup func from chooseDunUpstreamTestCommon
Prepare to share setup function to more dun network tests.
No operation is changed.

Bug: 257408654
Test: TetheringTest
Change-Id: I29f08d8bc3cf83aa9d03f5d2819a1c67466b7bcc
2022-12-26 19:25:16 +08:00
Mark Chien
09cb20d8a8 Merge "TestOnly: disable some UpstreamNetworkMonitor tests after T" 2022-12-21 06:27:02 +00:00
Mark
2657da3cbf TestOnly: disable some UpstreamNetworkMonitor tests after T
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
2022-12-21 06:26:37 +00:00
chiachangwang
e97aed4847 Replace NetlinkSocket with NetlinkUtils
Those static method and constants are better to fit in
NetlinkUitls. Replace the usage.

Test: m
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I81e27b8264e39764a44a4ba87344e9ac940d920a
2022-12-19 06:39:31 +00:00
Hassan Ali
c3ebeb81a1 Merge "Add ConfigInfrastructure stubs lib to Android.bp" 2022-12-12 15:11:30 +00:00
Maciej Żenczykowski
4e3321ed3b bpf_tethering.h -> offload.h
match header file with bpf program

Locations to change found via:
  https://source.corp.google.com/search?q=p:aosp-master%20(%5E%7C%5B%5E_%5D)bpf_tethering.h

Core reasoning for this will be to match the .h naming
that we'll have for netd.c and clatd.c once we get rid of bpf_shared.h

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4154659c7fb23a37f5316a5c804fb2606d842e9c
2022-12-08 13:04:45 +00:00
Hassan Ali
bc4e514ea1 Add ConfigInfrastructure stubs lib to Android.bp
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
2022-12-08 12:58:20 +00:00
Hassan Ali
c4f63fa973 Add ConfigInfrastructure lib to Android.bp
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
2022-11-23 11:41:43 +00:00
Hungming Chen
d15eb88619 TetheringConfiguration: force to select upstream automatically on U+
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
2022-11-15 22:14:21 +08:00
Treehugger Robot
6660d2375f Merge "Add isTetheringFeatureEnabled which use tethering namespace" 2022-11-15 08:58:23 +00:00
Mark
25d3ac54fe Add isTetheringFeatureEnabled which use tethering namespace
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
2022-11-14 15:51:55 +00:00
Cole Faust
22f05839f5 Fix errorprone warnings that should be errors
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
2022-11-02 10:13:14 -07:00
Treehugger Robot
319c97705f Merge changes I63467371,Id4405b70
* changes:
  BpfCoordinatorTest: add testDumpDoesNotCrash
  Move error count BPF map initialization into class Dependencies
2022-10-27 07:27:08 +00:00
Nucca Chen
db4ac8ea40 Merge "IpServerTest: add test addRemoveTetherClient" 2022-10-26 06:49:22 +00:00
Hungming Chen
df57abfd4b BpfCoordinatorTest: add testDumpDoesNotCrash
Simple dump test for improving tethering test coverage.

Bug: 255466740
Test: atest BpfCoordinatorTest
Test: dump the content of testDump

Output:
mIsBpfEnabled: true
Polling not started
Stats provider registered
Upstream quota: {}
Polling interval: 5000 ms
Bpf shim: mBpfDownstream6Map{OK}, mBpfUpstream6Map{OK}, mBpfDownstream4Map{OK}, mBpfUpstream4Map{OK}, mBpfStatsMap{OK}, mBpfLimitMap{OK}, mBpfDevMap{OK}
Forwarding stats:
 <empty>
BPF stats:
 ifindex: 1001: rxPackets: 0, rxBytes: 0, rxErrors: 0, txPackets: 0, txBytes: 0, txErrors: 0

Forwarding rules:
 IPv6 Forwarding rules by downstream interface:
  [null]: iif(iface) oif(iface) v6addr [srcmac] [dstmac]
   1001(rmnet0) 1003(1003) 2001:db8::1 [12:34:56:78:90:ab] [00:00:00:00:00:0a]
 IPv6 Upstream: iif(iface) [inDstMac] -> oif(iface) etherType [outSrcMac] [outDstMac]
  1003(1003) [12:34:56:78:90:ab] -> 1001(rmnet0) 86dd [00:00:00:00:00:00] [00:00:00:00:00:00]
 IPv6 Downstream: iif(iface) [inDstMac] neigh6 -> oif(iface) etherType [outSrcMac] [outDstMac]
  1001(rmnet0) [00:00:00:00:00:00] 2001:db8::1 -> 1003(1003) 86dd [12:34:56:78:90:ab] [00:00:00:00:00:0a]
 IPv4 Upstream: proto [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
  tcp [12:34:56:78:90:ab] 1003(1003) 192.168.80.12:-3087 -> 1001(rmnet0) 1.0.0.1:-3087 -> 140.112.8.116:443 [00:00:00:00:00:00] -
 IPv4 Downstream: proto [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
  tcp [00:00:00:00:00:00] 1001(rmnet0) 140.112.8.116:443 -> 1003(1003) 1.0.0.1:-3087 -> 192.168.80.12:-3087 [00:00:00:00:00:0a] -

Device map:
 ifindex (iface) -> ifindex (iface)
  1001 (rmnet0) -> 1001 (rmnet0)
Client Information:
 <empty>
IPv4 Upstream Indices:
 <empty>

Forwarding counters:
 INVALID_IPV4_VERSION: 1000

Change-Id: I6346737157936cff7e164bbfe78d9a98dab3395a
2022-10-26 05:48:03 +00:00
Hungming Chen
771bc597b6 Move error count BPF map initialization into class Dependencies
The preparation for testing BpfCoordinator#dump().
Used to wrap error count BPF map access to avoid SYS_SECCOMP on some
test device. Ex: cuttlefish.
https://android-build.googleplex.com/builds/tests/view?invocationId=I01200010101524265&testResultId=TR03228338750686157

Bug: 255466740
Test: atest BpfCoordinatorTest

Change-Id: Id4405b70bc6d500b35943b4f81b88e7515fff3b0
2022-10-26 13:47:19 +08:00
Mark Chien
381e339647 Merge "Remove unused TetheringConfigurationParcel fileds" 2022-10-21 07:50:23 +00:00
Nucca Chen
df46aeb098 Merge "Add toString() to Ipv6ForwardingRule" 2022-10-14 07:27:03 +00:00
Wayne Ma
fe6ecc6333 Add new fields - |upstream_events| and |duration_millis| in stats.proto
Revise annotations in previous fields and deprecate |upstream_type|.

Ignore-AOSP-First: Merge conflict if submits in AOSP first.
Bug: 153942334
Test: statsd_testdrive 303
Change-Id: Id4d594f9238e18266dce5bf2ba238c1f86f655db
(cherry picked from commit 71c8495cea)
Merged-In: Id4d594f9238e18266dce5bf2ba238c1f86f655db
2022-10-12 05:32:12 +00:00
Hungming Chen
afdf104d68 IpServerTest: add test addRemoveTetherClient
Bug: 250552545
Test: atest IpServerTest
Change-Id: Id8e801ccbf9a958c6b82de6022165d921761a86f
2022-10-04 23:14:55 +08:00
Hungming Chen
de5fb7370b Add toString() to Ipv6ForwardingRule
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
2022-10-04 23:14:55 +08:00
Hungming Chen
09d163dfa8 BpfCoordinator: ignore stopping event monitoring if never started
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
2022-10-03 11:56:38 +00:00
Sorin Basca
14343732c3 Fix errorprone 2.15.0 errors
Bug: 246761518
Test: RUN_ERROR_PRONE=true m javac-check lint-check dist
Change-Id: I4b81ef161fab5ee80a1713de87b89500a88e625e
2022-09-21 13:29:19 +01:00
Treehugger Robot
1949d98e81 Merge "Revert "UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE"" 2022-09-14 14:25:13 +00:00
KH Shi
b259ee802f Merge "Fix TetheringServiceTest#testTetheringManagerLeak flaky" 2022-09-13 11:16:13 +00:00
KH Shi
b254987348 Fix TetheringServiceTest#testTetheringManagerLeak flaky
The clearance of the weak reference to TetheringManager can't be a
confirmation check of the completion running of its finalization.
The weak references to a weakly-reachable object will be cleared
before it becomes eligible for finalization. Calling of
System.runFinalization() method doesn't guarantee finalizers are
executed synchronously. In fact, finalizer of TetheringManager is
running in a different thread in this test.

GCs and finalizers behaviors could be vary on different JVMs.
Due to the unsynchronization, besides the weak reference of
TetheringManager, we need to add retries to the checking of
unregister Tethering internal callback as well.

Bug: 243340454
Test: atest TetheringServiceTest#testTetheringManagerLeak --iterations 10000
Change-Id: I8231146f26deb0825dadb70d8d0dbdc963989558
2022-09-13 05:56:29 +00:00
Nucca Chen
6cafe04787 Revert "UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE"
This reverts commit 82e7733909.

Reason for revert: don't modify production code for testing only

Change-Id: I19826c3308774ce6f62a2748b4e038500aec33e2
2022-09-05 03:25:33 +00:00
Motomu Utsumi
73599a5f5d Use IBpfMap type instead of BpfMap type
Currently, production code uses BpfMap type and TestBpfMap extends
BpfMap but this makes it diffcult to test because TestBpfMap loads the
JNI.

This CL updates to use IBpfMap type in the production code.
Upcoming CL updates TestBpfMap to implement IBpfMap instead of extending
BpfMap so that test can still use TestBpfMap but tests do not need to
load JNI.

Bug: 217624062
Test: atest BpfCoordinatorTest BpfNetMapsTest
Change-Id: Ie67e14bf5519fb4427474ecc0fda441877a9555f
2022-08-24 23:31:19 +09:00
Mark Chien
0d3c8b692d Merge "updateSupportedDownstreams when tethering allowed is changed" 2022-08-22 15:15:11 +00:00
Mark
c2cc1b42b8 updateSupportedDownstreams when tethering allowed is changed
There are three configuration could affect tethering allowed:
1. user restriction
2. tether_supported settings
3. ro.tether.denied system properties

When user restricted or tether supported setting change, updating
supported downstreams.
ro.tether.denied is read only properties, so it won't be changed runtime.

Also correct the unit test that there is no TetheringConfiguration change when settings or user restriction change.

Bug: 184996041
Bug: 239500515
Test: atest TetheringTests

Change-Id: I8dfcc42de9787a5e9ba19b69db9444c14ace56f0
2022-08-18 05:42:05 +00:00
Maciej Żenczykowski
09813ced3e replace U32 ifindex with S32
These are allocated in order by the kernel, if we go
over 2 billion, we've got other problems... besides
U32 to S32 conversion will work just fine anyway.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifbb7139e9118dd2d0c52e83c5874132e03760b30
2022-08-18 01:07:11 +00:00
Maciej Żenczykowski
91f7d6d906 Merge changes from topic "ethernet-tethering-test-on-cf"
* changes:
  UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE
  EthernetTetheringTest: obtain the required permissions when needed
  Use TetheredInterfaceRequester to check available tethering interface
2022-08-17 17:50:40 +00:00
Mark Chien
40caeb78f3 Remove unused TetheringConfigurationParcel fileds
Bug: 237338640
Test: atest TetheringTests

Change-Id: Ic851e2e9ed16b5be6f5b1380f6b905fcc1e131cf
2022-08-16 15:58:44 +00:00
Hungming Chen
82e7733909 UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE
Used for test interface upstream can replace existing non-test
upstream interface, like ethernet on cuttlefish.

This helps to fix the flaky test when we are using test interface on
cuttlefish. Because the ethernet and test interface upstream update
event order can't be guaranteed.

Bug: 237369591
Bug: 242067530

Test: atest ConnectivityCoverageTests
Change-Id: I9da71ee116bf1ebc9831f61f25acf42e328a8370
2022-08-15 17:38:06 +08:00
Treehugger Robot
7aaf823fe9 Merge "TestOnly: reduce duplicated start/stop hotspot verification" am: b40cbad40c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2171108

Change-Id: Ic03dd521ff98e53687a6bd7b3a275c12759640c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 17:26:00 +00:00