This is used to fix the race when quickly OFF/ON wifi tethering.
When IpServer is started/stopped, there is callback update tethering
interface status. Before this change, IpServer is stopped when wifi
ap is disabling. Then the next startTethering may fail in wifi because
wifi is in disabling state.
Error pattern: WifiService: Tethering is already active.
No unitest for this CL but it fixed the CtsTetheringTest flakty rate
than around 30% to 0 for more than 100 runs.
Bug: 153925821
Test: atest CtsTetheringTest --iteration 100
Change-Id: I8b65f621abe20799a3a0d410ba1f06368746ee49
These events don't have MAC addresses, so the code attempts to
create an Ipv6ForwardingRule with a null MAC address. This
crashes when attempting to get the raw MAC address bytes to send
to netd in the TetherOffloadRuleParcel.
This was not caught by unit tests because the test exercise this
code path in a way that is not correct (by sending RTM_DELNEIGH
and NUD_FAILED events with MAC addresses). Fix the unit tests to
properly pass in null MAC addresses for these events.
Bug: 153697068
Test: fixed existing tests to be more realistic
Change-Id: I26d89a81f1c448d9b4809652b079a5f5eace3924
The netd tethering offload IPCs are changing from taking a list
of primitives to taking a TetherOffloadRuleParcel. Modify their
only caller.
Bug: 140541991
Test: atest IpServerTest
Change-Id: I83718c80ef9d31199c87021b4dd5821717fd5ba5
1. Add TETHERING_ETHERNET to vaild downstream type. So starting
ethernet tethering will do entitlement check as well.
2. Ignore request with invalid downstream type on
handleRequestLatestTetheringEntitlementValue()
Bug: 152828758
Bug: 152828142
Test: atests TetheringTests CtsTetheringTest
Change-Id: Id0cb59cc4681f5ffbde7be54de05a05e46f0ffb8
Tethering service is created after boot complete which means most of
the services are ready before tethering. Once tethering register the
callback, callback event may come-in immediately. Make sure all of
tethering related object is created, then register the callback,
receiver, or listener.
Bug: 149965121
Test: atest TetheringTests
manual on/off tethering
Change-Id: I3941a186770679e7b476073d774e2310e25e44c6
Otherwise, if another downstream of the same type reappears, the
code would fire a callback with the previous list of clients.
Bug: 150644681
Test: atest TetheringIntegrationTests:EthernetTetheringTest --rerun-until-failure 100
Change-Id: I6b34ea747ae1831001077f44879bb6828dcecc96
If tethering is restricted to the user, show restricted
notification to notify the user.
Bug: 122085773
Test: atest TetheringTests
Change-Id: Ic5baca2d6102886f4c3530ce1e321b5dab6ea9d7
Add new test for TetheringNotificationUpdater
Bug: 122085773
Bug: 130596698
Test: atest TetheringTests
Change-Id: I0db3df3e85dd6a8c3989c8bc66a06c50f45a0c15
Tethering notification can be customized by different subid. Thus
update notification when active data subid changed.
Bug: 122085773
Bug: 130596698
Test: atest TetheringTests
Change-Id: I799d713326cfbf4dc96c712c6b15ed5a4ac18dd2
The NetworkStack.getService() API should be used instead.
Bug: 151243982
Test: atest FrameworksNetTests TetheringTests
Manual tethering test
Merged-In: I7855090bffbe895c8349ad4903b8f2eb55515f0b
(clean cherry-pick from internal branch)
Change-Id: If4af2846a82605e828287a9a4680d5547b76b802
When the Ethernet interface becomes unavailable (e.g., because
the cable was unplugged or the interface was removed), or when
setEthernetTethering(false) is called, release the Ethernet
interface request.
This ensures that:
- The Ethernet interface immediately becomes available for use in
client mode.
- If an interface later becomes available, tethering is not
automatically started. This is consistent with what happens for
other downstream types such as wifi and USB. Evey time one of
those downstreams goes down, tethering is stopped and will not
be restarted.
Test: manual
Bug: 148824036
Change-Id: Iaf85e800569f2e08c39f7ebb96f8aa34f6e53133
Merged-In: Iaf85e800569f2e08c39f7ebb96f8aa34f6e53133
(cherry picked from commit e54c92e5657abe2ce5da9dcba76b89c5e540cc44)
When the Ethernet interface becomes unavailable (e.g., because
the cable was unplugged or the interface was removed), or when
setEthernetTethering(false) is called, release the Ethernet
interface request.
This ensures that:
- The Ethernet interface immediately becomes available for use in
client mode.
- If an interface later becomes available, tethering is not
automatically started. This is consistent with what happens for
other downstream types such as wifi and USB. Evey time one of
those downstreams goes down, tethering is stopped and will not
be restarted.
Test: manual
Bug: 148824036
Change-Id: Iaf85e800569f2e08c39f7ebb96f8aa34f6e53133