summaryrefslogtreecommitdiff
path: root/Tethering/common/TetheringLib/src/android/net/TetheringManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Add onSupportedTetheringType callbackmarkchien2022-04-201-3/+51
| | | | | | | | | | | | This new callback could tell caller Tethering is supported for what tethering types. Bug: 184996041 Test: atest TetheringTests atest EthernetTetheringTest CTS-Coverage-Bug: 223340235 Change-Id: Ib80ed8d7f73f4a098b8965db186d24d8cf1884d3
* Add TetheredInterface{Request, Callback} interfacemarkchien2021-11-081-0/+39
| | | | | | | | | | | | | Define interfaces that match the signature of the existing EthernetManager.TetheredInterfaceRequest and TetheredInterfaceCallback classes and make EthernetManager.TetheredInterfaceRequest and TetheredInterfaceCallback implement/subinterface these interfaces. The new bluetooth API could also implement these interfaces to make API surface consistent. Test: TH would test the existing tests that use the subclass. Bug: 190438212 Change-Id: I093972c111cb1d921076782492716d5a046be8fc
* Merge "Unregister the tethering internal callback in finalize"Treehugger Robot2021-10-201-0/+17
|\
| * Unregister the tethering internal callback in finalizemarkchien2021-10-201-0/+17
| | | | | | | | | | | | | | | | Bug: 177265744 Bug: 191798390 Bug: 187972579 Test: atest TetheringServiceTest Change-Id: Ie7f9535b923db5073a59329ead22546a54e6ef47
* | Merge "Fix TetheringManager memory leak"Treehugger Robot2021-10-201-10/+32
|\|
| * Fix TetheringManager memory leakmarkchien2021-10-141-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TetheringCallbackInteranl is inner class which explicitly reference TetheringManager object. This causes TetheringManager can't be GC. Using static nested class which has its own lifecycle and weak reference TetheringManager object. Still have a leak inside Tethering that TetheringCallbackInternal is never unregistered. Currently it rely on binder died to remove the reference, which usually happen in kill process. If process keep alive, the TetheringCallbackInternal would not be freed even TetheringManager is gone. Will have follow CL to fix this. Bug: 177265744 Bug: 191798390 Bug: 187972579 Test: 1. lunch Settings with ON/OFF tethering, dump java heap. 2. close Settings and restart Settings again, dump java heap. 3. Compare java heap between step 1 and step 2. Change-Id: I0e2a21b7988115098a033a581cd98da8bffe2791
* | Merge "Support set test network to tethering upstream" am: 473d864d20Mark Chien2021-09-301-0/+21
|\ \ | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1797991 Change-Id: Ifd5c76a943886dfe55e9b68eeb77931dae6fe204
| * | Support set test network to tethering upstreammarkchien2021-09-301-0/+21
| |/ | | | | | | | | | | Test: atest EthernetTetheringTest Change-Id: Ief2a92bc6c573a6bb75c72b7a0630e5c0accfa73
| * Add the tethering type to TetheringEventCallback methodsmarkchien2021-06-011-18/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, tethering always report a list of tethered interfaces and the caller need to use each tethering type's interface regex to matching tethered list to manual implement the mapping of tethering type and interface. This change allow caller to get rid of tethering interface regex. Bug: 162920185 Bug: 152203943 Test: atest CtsTetheringTest on S Merged-In: I91bcccd676d109c1b974497ac29bd366a41b8899 Change-Id: I91bcccd676d109c1b974497ac29bd366a41b8899
* | Add the tethering type to TetheringEventCallback methodsmarkchien2021-05-181-18/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, tethering always report a list of tethered interfaces and the caller need to use each tethering type's interface regex to matching tethered list to manual implement the mapping of tethering type and interface. This change allow caller to get rid of tethering interface regex. Bug: 162920185 Bug: 152203943 Test: atest CtsTetheringTest on S Ignore-AOSP-First: Currently aosp would automerge to mainlne-prod, merge to sc-dev first to avoid adding new API to mainline-prod CTS-Coverage-Bug: I already add cts test(ag/14622456), but Lint still complaint because my cts is under packages/modules/Connectivity/ but it only check whether CL touching platform/cts Change-Id: I91bcccd676d109c1b974497ac29bd366a41b8899
* | Merge "Allow callers of startTethering to choose local-only mode." am: ↵Lorenzo Colitti2021-04-191-1/+84
|\| | | | | | | | | | | | | | | ac9ce08d45 am: af691a13b6 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1674232 Change-Id: I9c88d0d05c6dbb0bac65b72e8d54df5eb25b4060
| * Allow callers of startTethering to choose local-only mode.Lorenzo Colitti2021-04-191-1/+84
| | | | | | | | | | | | | | | | | | | | | | This is useful for OEMs that want to use RNDIS or NCM as a local-only link that is directly connected to some other host. This can be used to implement USB tethering using NCM, which currently only supports local-only mode. Bug: 175090447 Test: TetheringIntegrationTests:EthernetTetheringTest#testLocalOnlyTethering Change-Id: I0ffaa46e4640e5b235340a15d25909106ceb0c07
| * Remove Tethering @TestApiAnton Hansson2020-10-141-2/+0
| | | | | | | | | | | | | | | | | | | | 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
| * Merge "Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs" ↵Makoto Onuki2020-07-151-1/+0
| |\ | | | | | | | | | | | | | | | | | | | | | am: df5d88796b am: e39fdf0a5f Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1360884 Change-Id: Ie45f32b2d46c8ac989a4a9242017eb4c2b73484b
| | * Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIsMakoto Onuki2020-07-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Test: build / treehugger Bug: 146727827 Exempt-From-Owner-Approval: Cherry-picking from goog/master to aosp/master Merged-in: Ie1ad6711c490c679ebcfacd97154380a8810ba1c Change-Id: Ie1ad6711c490c679ebcfacd97154380a8810ba1c
* | | Remove Tethering @TestApiAnton Hansson2020-10-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules shouldn't have TestApis, as documented in go/android-api-types. Additionally, nothing depends on these TestApis existing. Bug: 170395679 Test: m checkapi Exempt-From-Owner-Approval: cherry-pick Change-Id: I6e2c8298e90b4b54f0264be974d036fa08cd5632
* | | Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIsMakoto Onuki2020-07-141-1/+0
| | | | | | | | | | | | | | | | | | Test: build / treehugger Bug: 146727827 Change-Id: Ie1ad6711c490c679ebcfacd97154380a8810ba1c
* | | Merge "Tethering: Add WiGig support" am: 65fadfc134 am: 6c5b5b0803 am: ↵Mark Chien2020-06-231-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | fdf89ee7fb am: 45fa4f9c88 am: 5131fee94b Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1177323 Change-Id: I2d3971390e897be6669d2f2d4b261eb73875c267
| * | Merge "Tethering: Add WiGig support" am: 65fadfc134 am: 6c5b5b0803Mark Chien2020-06-221-0/+8
| |\| | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1177323 Change-Id: Ib48182d51cc6e4586cb43f8ca51ea673ee14d1d7
| | * Tethering: Add WiGig supportDedy Lansky2020-06-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Merge "Set attributionTag for noteOp(WRITE_SETTINGS) calls" am: 83ba9531d7 ↵Philip P. Moltmann2020-04-221-16/+27
| |\| | | | | | | | | | | | | | | | am: 319db1af8b Change-Id: I099944752fc3006c1e98750dd46dbebf5e50789f
| | * Set attributionTag for noteOp(WRITE_SETTINGS) callsPhilip P. Moltmann2020-04-201-16/+27
| | | | | | | | | | | | | | | | | | | | | Test: atest FrameworksNetTests TetheringTests:TetheringServiceTest Bug: 136595429 Merged-In: I33f787644c44d7b0e5ce17a433820cfcd985cdfb Change-Id: Ic3d937e7bb5141798234ed5b2852c1f768e97495
* | | Set attributionTag for noteOp(WRITE_SETTINGS) callsPhilip P. Moltmann2020-04-211-16/+27
|/ / | | | | | | | | | | | | Test: atest FrameworksNetTests Bug: 136595429 Change-Id: I33f787644c44d7b0e5ce17a433820cfcd985cdfb Exempt-From-Owner-Approval: Merge from AOSP
* | Merge "Assign specific client address to dhcp server" am: 037becbf64 am: ↵Treehugger Robot2020-03-301-7/+16
|\| | | | | | | | | | | 815ab636c3 Change-Id: Ia0e4a913faa5eac5d5ccba837eb7774d59670d27
| * Merge "Assign specific client address to dhcp server"Treehugger Robot2020-03-301-7/+16
| |\
| | * Assign specific client address to dhcp servermarkchien2020-03-191-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 141256482 Test: manual atest TetheringTests Change-Id: Ief76c98c843ba5420224cbf0f34464f366c891b7
| * | Hide startTethering with type function to module-lib onlymarkchien2020-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | Bug: 151918384 Test: m Change-Id: Icef8b363aae97dd020d618bcb397f661aa6c4750 Merged-In: Icef8b363aae97dd020d618bcb397f661aa6c4750
| * | Address API council review comment about TetheringRequestjunyulai2020-03-231-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: atest TetheringTests FrameworksNetTests NetworkStackTests Bug: 152055812 Change-Id: I0158d88e364772f9ac258bd18955edcdad266ad8 Merged-In: I0158d88e364772f9ac258bd18955edcdad266ad8 (this is a clean cherry-pick from ag/10796412) Change-Id: I64f1527d79085cc5dfd78c01a6c49c4df87c82e7
| * | TetheringManager API clean upmarkchien2020-03-191-42/+116
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Support static address configurationmarkchien2020-03-171-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I0399917e7cefa1547d617e688225544c4fc1a231
| * Merge "Send offload status changed callback"Mark Chien2020-03-091-0/+37
| |\
| | * Send offload status changed callbackmarkchien2020-03-091-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callback would be fired when offload started, stopped, or failed. If offload is not supported, "failed" callback would be fired when user enable tethering. Enabling multiple tethering would not have multiple offload status callbacks because offload should already be started or failed. Bug: 130596697 Test: -build, flash, boot -atest TetheringTests -ON/OFF hotspot Change-Id: Ia0398601144b0e5f61dc0c5771eacf13e7cfbb59
| * | Tethering: add isTetheringSupported with callerPkg parametermarkchien2020-03-031-0/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | BT tethering need to know whether tethering is supported for its caller that call isTetheringSupported in binder thread under BT's process. Current isTetheringSupported API is getting callerPkg inside TetheringManager that would be BT's package name for bt tethering case. Provide isTetheringSupported(String callerPkg) for caller to pass its caller's package name if the use case is under binder IPC. Bug: 146915889 Test: -boot, flash, boot Change-Id: I2a35e1b6851e7a799c343be0dd60da23514768ba
| * Add tethering client callbacksRemi NGUYEN VAN2020-02-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | The callbacks are fired when the list of connected clients or their IP addresses / hostname change. Test: flashed, connected 2 devices, verified callbacks Test: atest TetheringTests Bug: 135411507 Change-Id: I96291038cf7b39a67547a5f74fcd7cbedc1ca002 Merged-In: I96291038cf7b39a67547a5f74fcd7cbedc1ca002
| * Use framework-tethering-stub instead of framework-tetheringmarkchien2020-02-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | The non-updatable part of the platform now is built with framework-tethering-stub, which is a stub library of framework-tethering. Bug: 147200698 Test: m Change-Id: I97ef83f7f9b4c1376f373713036f5256318f1050 Merged-In: I97ef83f7f9b4c1376f373713036f5256318f1050
* | Address API council review comment about TetheringRequestjunyulai2020-03-231-22/+29
| | | | | | | | | | | | Test: atest TetheringTests FrameworksNetTests NetworkStackTests Bug: 152055812 Change-Id: I0158d88e364772f9ac258bd18955edcdad266ad8
* | Hide startTethering with type function to module-lib onlymarkchien2020-03-191-0/+2
| | | | | | | | | | | | Bug: 151918384 Test: m Change-Id: Icef8b363aae97dd020d618bcb397f661aa6c4750
* | TetheringManager API clean upmarkchien2020-03-191-42/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Support static address configurationAutomerger Merge Worker2020-03-191-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | Merge "Send offload status changed callback" into rvc-devMark Chien2020-03-091-0/+37
|\ \
| * | Send offload status changed callbackAutomerger Merge Worker2020-03-091-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callback would be fired when offload started, stopped, or failed. If offload is not supported, "failed" callback would be fired when user enable tethering. Enabling multiple tethering would not have multiple offload status callbacks because offload should already be started or failed. Bug: 130596697 Test: -build, flash, boot -atest TetheringTests -ON/OFF hotspotf Change-Id: Ifb16dcedc8081833fa95a39596fe5cdc309ededd Merged-In: Ifb16dcedc8081833fa95a39596fe5cdc309ededd Merged-In: Ia0398601144b0e5f61dc0c5771eacf13e7cfbb59 (cherry picked from commit cd266076bed28459234c5d74ad373867944df116)
* | | Tethering: add isTetheringSupported with callerPkg parameterAutomerger Merge Worker2020-03-091-0/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BT tethering need to know whether tethering is supported for its caller that call isTetheringSupported in binder thread under BT's process. Current isTetheringSupported API is getting callerPkg inside TetheringManager that would be BT's package name for bt tethering case. Provide isTetheringSupported(String callerPkg) for caller to pass its caller's package name if the use case is under binder IPC. Bug: 146915889 Test: -boot, flash, boot Change-Id: I01646fe045772c57b4e39a5e129531f8a2cea89f Merged-In: I01646fe045772c57b4e39a5e129531f8a2cea89f Merged-In: I2a35e1b6851e7a799c343be0dd60da23514768ba (cherry picked from commit e09a92fabe7956692f34e94c198d9763bf76e53d)
* | Merge "Use constant for tethering connector poll interval."Amos Bianchi2020-02-181-1/+1
|\ \
| * | Use constant for tethering connector poll interval.Amos Bianchi2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | A constant is defined but a literal is used instead. Test: manual Change-Id: I233e11af4e39a35d9a47e45066df994a9f547272
* | | Add tethering client callbacksRemi NGUYEN VAN2020-02-181-0/+9
|/ / | | | | | | | | | | | | | | | | | | The callbacks are fired when the list of connected clients or their IP addresses / hostname change. Test: flashed, connected 2 devices, verified callbacks Test: atest TetheringTests Bug: 135411507 Change-Id: I96291038cf7b39a67547a5f74fcd7cbedc1ca002
* / Use framework-tethering-stub instead of framework-tetheringmarkchien2020-02-071-0/+16
|/ | | | | | | | | | The non-updatable part of the platform now is built with framework-tethering-stub, which is a stub library of framework-tethering. Bug: 147200698 Test: m Change-Id: I97ef83f7f9b4c1376f373713036f5256318f1050
* Merge "Do not block for connector in TetheringManager"Remi NGUYEN VAN2020-01-291-55/+161
|\
| * Do not block for connector in TetheringManagerRemi NGUYEN VAN2020-01-291-55/+161
| | | | | | | | | | | | | | | | | | | | Instead of blocking for the ITetheringConnector, in the rare case (only on boot) that the connector is not ready, queue requests and poll for the connector until it is available. Bug: 146821053 Test: Flashed, verified tethering working Change-Id: I4bd45fcbdce2336694c3b6a349f121e40230f001
* | Add support for Ethernet tetheringRemi NGUYEN VAN2020-01-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Ethernet tethering can be started via startTethering(TETHERING_ETHERNET). Test: flashed, enabled ethernet tethering, verified internet access on downstream. Bug: 130840861 Merged-In: I34842acd94b972e440c3622f7617df10c18acf65 Change-Id: I34842acd94b972e440c3622f7617df10c18acf65 (cherry-pick with conflicts in test-current.txt)
* | Local Tethering with ncm interfaceMilim Lee2020-01-281-0/+6
|/ | | | | | | | | | | Bug: 130840842 Test: build, boot atest TetheringTest manual test (call startTethering(TETHERING_NCM)) Merged-In: Icc6c4d6be39e787503cecf3a5835b40d4be12a57 Change-Id: Icc6c4d6be39e787503cecf3a5835b40d4be12a57 (clean cherry-pick)