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: Ifdc427341db7d1313ad4b61207a96ab379d100aa
Merged-In: I3941a186770679e7b476073d774e2310e25e44c6
(cherry picked from commit 285be1ee938ddc9728ccc3e951ed0ed1b2fa7117)
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
Merged-In: I6b34ea747ae1831001077f44879bb6828dcecc96
(cherry picked from commit 3984360f642ddd5820ced5a6935e37a8ae0d9d76)
If tethering is restricted to the user, show restricted
notification to notify the user.
Bug: 122085773
Test: atest TetheringTests
Change-Id: Ic5baca2d6102886f4c3530ce1e321b5dab6ea9d7
Merged-In: Ic5baca2d6102886f4c3530ce1e321b5dab6ea9d7
(cherry picked from aosp/1188867)
Add new test for TetheringNotificationUpdater
Bug: 122085773
Bug: 130596698
Test: atest TetheringTests
Change-Id: I0db3df3e85dd6a8c3989c8bc66a06c50f45a0c15
Merged-In: I0db3df3e85dd6a8c3989c8bc66a06c50f45a0c15
(cherry picked from aosp/1209985)
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
Merged-In: I799d713326cfbf4dc96c712c6b15ed5a4ac18dd2
(cherry picked from aosp/1209984)
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
Per API review:
- @IntDef defined on the type integer parameter
- have getters on each parameter that is set in the
TetheringRequest.Builder
- new added API should not be deprecated
Below APIs is moved from system-current to module-lib-current that only
plafrom code(e.g. ConnectivityManager and Settings) can use them.
TetheringRequest.
onTetherableInterfaceRegexpsChanged, TetheringInterfaceRegexps:
Only platform code can use them because interfaces by regular
expressions are a mechanism which is planning to be deprecated.
Also rename some constants for easier to understand.
Bug: 149858697
Bug: 151243337
Test: m doc-comment-check-docs
atest TetheringTests
Change-Id: I45cb21d5bc919f6d32c42650326597d5173ea028
Merged-In: Idd041f0fbeca411ea23e49786a50dd7feb77ef45
Per API review:
- @IntDef defined on the type integer parameter
- have getters on each parameter that is set in the
TetheringRequest.Builder
- new added API should not be deprecated
Below APIs is moved from system-current to module-lib-current that only
plafrom code(e.g. ConnectivityManager and Settings) can use them.
TetheringRequest.
onTetherableInterfaceRegexpsChanged, TetheringInterfaceRegexps:
Only platform code can use them because interfaces by regular
expressions are a mechanism which is planning to be deprecated.
Also rename some constants for easier to understand.
Bug: 149858697
Bug: 151243337
Test: m doc-comment-check-docs
atest TetheringTests
Change-Id: Idd041f0fbeca411ea23e49786a50dd7feb77ef45
Application can specify static ipv4 server and client address to setup
tethering and this is one shot configuration. Tethering service would
not save the configuration and the configuration would be reset when
tethering stop or start failure.
When startTethering callback fired, it just mean tethering is requested
successful. Therefore, callers may call startTethering again if
startTethering successful but do not receive following tethering active
notification for a while. Tethering service never actually does anything
synchronously when startTethering is called:
-startProvisioningIfNeeded just posts a message to the handler thread.
-enableTetheringInternal doesn't do anything synchronously, it just
asks the downstreams to get their interfaces ready and waits for
callbacks.
If tethering is already enabled with a different request,
tethering would be disabled and re-enabled.
Bug: 141256482
Test: -build, flash, boot
-atest TetheringTests
-atest CtsTetheringTest
Change-Id: I2b2dd965a673e6f1626738d41b5d443f0f9fbd0e
Merged-In: I0399917e7cefa1547d617e688225544c4fc1a231
(cherry picked from commit 5d6723e24e21154bef3967585a8adc069e007f49)
The NetworkStack.getService() API should be used instead.
Bug: 151243982
Test: atest FrameworksNetTests TetheringTests
Manual tethering test
Change-Id: I7855090bffbe895c8349ad4903b8f2eb55515f0b