Add the netfilter generic message header to
the netlink req. This is needed so the kernel
won't ignore the request for invalid params.
Bug: 149109043
Test: ConntrackSocketTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1424920/
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: I63ca166851d6ca2c4737b263dde14c8d794a7d10
Create TetheringPrivilegedTests which have MAINLINE_NETWORK_STACK
permission, the test can perform various network-related operations
which need CAP_NET_RAW and CAP_NET_ADMIN capabilities.
Bug: 145490751
Test: make TetheringPrivilegedTests
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1345361
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: I93f8f6510e12a2a44bc576a4a801c0aac629df25
Tethering is updatable apex module that was launched in R, hence it and
all it dependencies should specify min_sdk_version <= 30.
Test: m
Bug: 171668006
Bug: 171330443
Change-Id: Ic91cf96dda6419d1038b0329b920f9cd24482aef
Merged-In: Ic91cf96dda6419d1038b0329b920f9cd24482aef
(cherry picked from commit bee20e84f8)
All PendingIntent included activity and broadcast should set
FLAG_IMMUTABLE flag.
Bug: 156353008
Test: atest TetheringTests
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1325696
Change-Id: I885046eb25c6dafbcb4284fd94bff0052f7bdd09
Merged-In: I4592e914b67ecb8865d7de47797423f27e9ff840
(cherry picked from commit 90ffbeea18)
TetheringNotificationUpdater create a PendingIntent with
Intent#FLAG_ACTIVITY_NEW_TASK flag. But this flag is used for
Intent only. Thus, move this flag into Intent.
Bug: 158639789
Test: atest TetheringTests
Change-Id: I4c3af75c87b797bcde9356a94c835c7422dac1c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329013
Change-Id: Ia843da82bc8fa03aca33a51fc309b65e73dfdc8f
Merged-In: I4c3af75c87b797bcde9356a94c835c7422dac1c6
(cherry picked from commit 2ad5f4e82f)
Also add MtsTetheringTest which only run if tethering mainline
module is installed.
Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
Change-Id: I434dda81eb5fab700d873a8ff3429b4222f0c7e6
Merged-In: I434dda81eb5fab700d873a8ff3429b4222f0c7e6
The downstream do not be tracked if PrivateAddressCoordinator just
return cached address. Then, PrivateAddressCoordinator would not notify
that downstream if conflict happen.
Also remove the null check in getDownstreamPrefix because:
- An IpServer is only added to mDownstreams by requestDownstreamAddress.
- That method will only add the IpServer to mDownstreams if it has an
IPv4 address.
- As soon as that method returns, the IpServer sets mIpv4Address to the
address that was returned.
- When an IpServer is torn down, mIpv4Address is set to null after
releaseDownstream is called.
So it should never be possible for this to return null.
Bug: 168169687
Test: atest CtsTetheringTest
atest TetheringTests
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459887
Change-Id: I4b4d75c8a4f1de07aa7bb68b12d150d7c85c9cc1
Merged-In: Ide5206b013acdc499344e1c839a830c5b245af41
(cherry picked from commit 0854becd64)
This test catch the regression introduced in r.android.com/1432958.
Bug: 1432958
Test: atest TetheringTest
Change-Id: Id0c1afb5563954ffee1f598a3a5de6a245d77a0e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459889
Change-Id: Ie80d4d5d535d70df493cad0a80166d779bc6ab77
Merged-In: Id0c1afb5563954ffee1f598a3a5de6a245d77a0e
(cherry picked from commit c46006da45)
Modules shouldn't have TestApis, as documented in go/android-api-types.
Additionally, nothing depends on these TestApis existing.
Bug: 170395679
Test: m checkapi
Change-Id: I6e2c8298e90b4b54f0264be974d036fa08cd5632
Merged-In: I6e2c8298e90b4b54f0264be974d036fa08cd5632
Currently tethering only pick prefix from 192.168.0.0/16. There is no
aviable tethering address if the upstream address is 192.168.x.y/16.
This change allow tethering to pick prefix from any private address
rnages. Now it still pick from 192.168.0.0/16 only to avoid behavior
change. Will have follow up commit to change the configuration.
Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
atest CtsTetheringTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436852
Change-Id: I008d5e5902a0fb41ac564c73f265e1c942c8dcad
Merged-In: Ib6304eb8b4788e9196d0af48e72f00a6bda73a5f
(cherry picked from commit 0a6b8bfee818734c005d9f131013580f5a23ba21)
Make the IP subnet persistent if it do not conflict with upstream.
It allow client to reuse its IP that usually reduce DHCP procedure.
Bug: 168169687
Test: atest TetheringTests
Change-Id: Iddc5304730dce7b11c5d124b7eddce057d752bbd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1432958
Change-Id: I60ed54651034f21ca1cd253d272ac3478881b4e0
Merged-In: Iddc5304730dce7b11c5d124b7eddce057d752bbd
(cherry picked from commit 177e2d8d1867d7e72d00c81d6fbbed756c9f0568)
If vpn app make its netmask as 0, PrivateAddressCoordinator
would not able to find suitable address for tethering downstream.
Since tethering do not support vpn as upstream, just ignore vpn
in PrivateAddressCoordinator.
Bug: 166365863
Test: atest TetheringTests
atest CtsTetheringTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1413610
Change-Id: I70b49d0a10b80f378dcd2ba78b5bac848e40e5c9
Merged-In: Iabe265467044fea9fa437674ca29ffc7bcdefe3b
(cherry picked from commit a089de8bab)
TetheredClient callback would additional check whether caller has
NETWORK_SETTINGS or {MAINLINE_}NETWORK_STACK permission, but it do not
grant for self accessing. InProcessTethering run in system server, so
the services in system server would fail to call TetheredClient callback.
Grant permission for self process.
Bug: 169231588
Test: atest CtsTetheringTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1435273
Change-Id: I8faacd26cc6f3e940af3a0147b84b693cb93503c
Merged-In: Ic04e44aef4df772c718ff25ed331bf02f5940c1d
(cherry picked from commit 0c9a370cfc)
NetworkInterface#getByName can not get the interface without IP addresses.
When setIncludeTestInterfaces(true) is called, the interface will be
placed in client mode, which will delete the link-local address. So calling
NetworkInterface#getByName to get test interface may not work before
switching to server mode.
Bug: 168215721
Test: atest CtsTethering
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440032
Change-Id: Idf1d18261c954e22989774ae97a12261551b31f6
Merged-In: Ice8adcce1c4b2c86bd219c701b2afa9ba2339f24
(cherry picked from commit 155e2a5212)
This works around a build-system limitation where it does not know
which jars to feed r8 to resolve all classes during proguarding.
Bug: 160453030
Bug: 169931783
Test: build_mainline_modules.sh (with prebuilt sdk)
Change-Id: I3d9f2049cf898b5e551a5c5764df423abaa5e92d
//visibility:override is no longer needed for impl_library_visibility
to override visibility.
Removing this allows the defaults module to specify better defaults.
- Stub libraries are made publicly visible, via `visibility`
- Impl libraries are private by default, but visibility is extended
by the modules
Bug: 165017290
Test: m
Exempt-From-Owner-Approval: build refactor
Change-Id: Ibf35bfac5c99a21125f89ba10945f3364217b90f
Merged-In: Ibf35bfac5c99a21125f89ba10945f3364217b90f
(cherry picked from commit 9aed13818c)
Callers don't care what language the utilities are written in
This is a partial cherry-pick of the change in the packages/Tethering,
tests/net/common, tests/net/integration, wifi/tests directories. Other
tests cannot be kept in sync as the latest versions verify platform
functionalities that do not exist in the module branch, so disabling
them is less time-consuming than always resolving merge conflicts.
Test: builds
Merged-In: Ie212144f36c50db223c05f3fcb6bad745842cb5e
Change-Id: Ie212144f36c50db223c05f3fcb6bad745842cb5e
This package is using some common utilities from
a library that used to live in the network stack.
A better home for these utilities is frameworks/libs,
so this topic moves the files ther and also changes
the package of some utilities.
See aosp/1350222 and aosp/1350182 for a detailed
description of the specific files that moved.
Test: checkbuild
Original-change: aosp/1350083
Merged-In: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
Change-Id: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
usesCleartextTraffic needs to be true for the networkstack process so
that the NetworkStack module can use no-encrypted probes to detect
captive portals.
When loaded in the networkstack process, all packages in process must
set usesCleartextTraffic=true, otherwise there may be races causing
the flag not to be set for the process.
Bug: 161860610
Test: CtsTetheringTest, TetheringTests
Change-Id: If1ea472e2b7e715ab97851394dc8980ad269b7a1
Merged-In: Ife03ee0c7096ea242eb701b297a69b471e15b436
(cherry picked from commit 36fd800cb1)
Some exsting applications may expect wifi p2p use legacy
"192.168.49.1/24" address. Have a configuration for wifi p2p to
decide whether to use legacy dedicated address or random address.
Bug: 161520826
Test: atest TetheringTests
Change-Id: If79973416a6780ee19ee785c65772b1a2dc1fbf7
Merged-In: If79973416a6780ee19ee785c65772b1a2dc1fbf7
1. Call maybeRemoveDeprecatedUpstreams from Tethering rather than inside
PrivateAddressCoordinator because the building logic of this method based
on implementation details of Tethering.
2. Fix typo
Bug: 130879722
Test: -build, flash, boot
-atest TetheringTests
Merged-In: I7584253b728bc17fc648fc19e492ca9f7ad2ff46
Change-Id: I7584253b728bc17fc648fc19e492ca9f7ad2ff46
If dhcp server is obsolete, explicitly stop it to shut down its thread.
Bug: 161418295
Test: atest CtsTetheringTest
Change-Id: Ic5b876bd23711ec8d832879a7baee0495246b218
Merged-In: Ic5b876bd23711ec8d832879a7baee0495246b218
Do not run ethernet tethering tests if tethering is not supported
because Tethering APIs would fail. Also skip the test if
EthernetManager is not avaliable. EthernetManager would be null if
there are no FEATURE_ETHERNET and FEATURE_USB_HOST.
Bug: 159869957
Test: atest CtsTetheringTest
Merged-In: I2b9be6799c6edeefc8cd74897a8704dbe80dd061
Change-Id: I2b9be6799c6edeefc8cd74897a8704dbe80dd061
If the test run adb over network and ethernet is available, it is likely
that adb may run over ethernet. Then the test would fail because adb
would break when ethernet is switching from client mode to server mode.
Bug: 160389275
Test: atest CtsTetheringTest
Merged-In: I57d365d33316881c50c3bf7fd1c98926d10842d3
Change-Id: I57d365d33316881c50c3bf7fd1c98926d10842d3
LocalLog is in android.util* instead of android.net*.
No crash happened because the methods used by tethering are
@UnsupportedAppUsage.
Bug: 160113128
Test: atest TetheringTests
Change-Id: I5f070b96f96aaabf7ec8da52a3d3444ed940fb56
Send netlink request over fd for offload config before
completing init sequence. Provides existing conntrack
entries to IPA. Resolves issue where there are NAT
misses in IPA due to IPA only having the conntrack
entries added after tethering starts.
Bug: 149109043
Test: OffloadHardwareInterfaceTest
Original-Change: https://android-review.googlesource.com/1290954
Merged-In: Iaf3e847e92f205b55f10fa85c17b9f3995d52099
Change-Id: Iaf3e847e92f205b55f10fa85c17b9f3995d52099
This change is a combination of following changes:
1) Tethering: add TETHERING_WIGIG type
Currently both WIFI and WIGIG use the same tethering type,
TETHERING_WIFI. This causes conflicts between the frameworks,
when both WIFI and WIGIG SoftAPs are started, one or both will
not work.
Fix this by using a seperate tethering type for WIGIG.
2) Tethering: remove TETHERING_WIGIG state machine on interface down
The wigig state machine relies on a TETHERING_STATE_CHANGED broadcast
that is sent when the tethering state machine is first created, during
interface up. Currently the tethering state machine is not removed
on interface down except for TETHERING_BLUETOOTH, and as a result
wigig tethering only works the first time SoftAP is started.
In order to fix this, remove the tethering state machine on interface
down for TETHERING_WIGIG as well.
Bug: 143356416
Test: TetheringCoverageTests
Change-Id: Ic4d3aca0ed69234093af7f0206dab3335938c52a
Merged-In: Ic4d3aca0ed69234093af7f0206dab3335938c52a
Tethering package.
Tethering needs StatsEvent and StatsLog which are in
framework-statsd.stubs.module_lib to write metrics.
Bug: 153942334
Test: make
Change-Id: I8ba142a9b3678de36e6c4880a64e992e00680f38
When LAN link is changed for using ethernet interface from Ethernet tethering to Ethernet,
there is confiict as Ethernet Tethering is trying to make ethernet link down and Ethernet is trying to make ethernet link up.
So, this would make Ethernet only manage ethernet interface link state.
Test: manual
Bug: 130840861
Merged-In: I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc
Change-Id: I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc