Commit graph android_packages_modules_Co.../Tethering/common/TetheringLib/api
Message SHA1
Remove WRITE_SETTINGS permission from Tethering APIs
As TetheringManager moves to a Public API, remove the weak
WRITE_SETTINGS permission and use TETHER_PRIVILEGED instead. System
callers can still aquire TETHER_PRIVILEGED, and public callers must be
Device Owner or Carrier App to bypass (to be done in a future CL)

Bug: 374400379
Test: atest TetheringTest TetheringServiceTest CtsTetheringTests
Change-Id: Ia192021ac48f9eb3f27cc8c412f17629ad16a587

Quang Anh Luong   commited 2024-12-18 13:53:04 +09:00
2782b3bddf
Make Tethering public API for DO/Carrier apps
Make a limited subset of Tethering APIs public for DO/Carrier apps
to start Wifi tethering with a custom SoftApConfiguration.

The following APIs are needed to be moved to public
- TetheringManager
    - startTethering
    - stopTethering
    - registerTetheringEventCallback
    - unregisterTetheringEventCallback
- TetheringManager.TetheringRequest
    - getSoftApConfiguration
- TetheringManager.TetheringRequest.Builder
    - setSoftApConfiguration
- TetheringInterface
- TetheringEventCallback
    - onTetheredInterfacesChanged

Checks for DO/Carrier apps will be added in a later CL.

API-Coverage-Bug: 374400379

Bug: 216524590
Test: atest TetheringTest TetheringManagerTest
Change-Id: I9fb420ec6cebea17d8f3bc40a0ae8735074d9eb0

Quang Anh Luong   commited 2024-12-05 11:49:39 +09:00
2f37e81851
Add stopTethering(TetheringRequest) stubs
Add a new API TetheringManager.stopTethering(TetheringRequest) to allow
apps to stop tethering for a specific request.

This CL only provides the API stubs. Implementation will be added in a
future CL.

Bug: 216524590
Test: atest TetheringManagerTest

Change-Id: If00a7dc5d328dac620fb69c384378c36e99e1856

Quang Anh Luong   commited 2024-12-05 08:32:10 +09:00
5475f2dd74
Introduce interfaceName field into TetheringRequestParcel
Bug: 340376953
API-Coverage-Bug: 365678805
Test: Presubmit
Test: atest EthernetTetheringTest
Test: atest TetheringTest
Test: atest NsdManagerDownstreamTetheringTest -b
Test: atest TetheringManagerTest -b

Change-Id: I8025cc2e238b8f9516bf18d8ea0253f1c58a05e6

Seungjae Yoo   authored and   Quang Anh Luong   commited 2024-12-05 08:14:10 +09:00
eab1de47f4
Include SoftAP config in TetheringEventCallback
Include SoftApConfiguration in TetheringEventCallback via
TetheringInterface, to allow apps to know which interfaces are created
with their SoftApConfigurations.

API-Coverage-Bug: 371133403

Bug: 216524590
Test: atest TetheringTest CtsTetheringTest
Change-Id: I1b4868ba8327bee3b03c0f21e5b4f0845f2f24a8

Quang Anh Luong   commited 2024-11-18 13:37:39 +09:00
a66b78ab87
Add new flag for Tethering w/ SoftApConfig
Old flag gantry flow was disabled due to being out of sync
(b/362407371). This change adds a new version of the same flag to
kickstart a new gantry flow.

Flag: com.android.net.flags.tethering_with_soft_ap_config

Bug: 216524590
Test: build
Change-Id: I50701582852c2077e7807ab2685e390f112fd029

Lorenzo Colitti   commited 2024-11-13 17:19:11 +00:00
172fe79552
Revert^2 "Add UID and package name to TetheringRequest"
This reverts commit c8df03ffd7.

Reason for revert: Will fix issue with CL aosp/3326396

Change-Id: I220025f7c8f8145a232ac2ae7f44e16088c122d7

Oscar Shu   commited 2024-11-05 22:52:36 +00:00
46722ad4c4
Revert "Add UID and package name to TetheringRequest"
This reverts commit 462703c850.

Reason for revert: b/375535923

Change-Id: I7f77959490e8243bb95985bd28b67efcf0f3eb00

Patrick Rohr   authored and   Gerrit Code Review   commited 2024-10-30 16:29:15 +00:00
c8df03ffd7
Add UID and package name to TetheringRequest
Add a uid and package name to TetheringRequest to keep track of which
app the request belongs to, and also convey this information to Wifi
for later use with resource conflicts.

Bug: 216524590
Test: atest TetheringManagerTest TetheringServiceTest
Change-Id: If963694cb1bbd831ba379a76043825c94ef9d67a

Quang Anh Luong   commited 2024-10-23 15:52:03 +09:00
462703c850
Add SoftApConfiguration to TetheringRequest
Allow apps to specify the SoftApConfiguration to use for Tethering via
TetheringRequest.

API-Coverage-Bug: 361242098

Bug: 216524590
Test: atest TetheringManagerTest
Change-Id: I956a2f9dc989e7b2d404b84957d859035e4cd6e8

Quang Anh Luong   authored and   Quang Luong   commited 2024-08-21 07:28:26 +00:00
a940e426c1
Introduce TETHERING_VIRTUAL type
Bug: 340376953
Test: Presubmit
Change-Id: I0714b62ebfc63fc966d7873ebdd68ae72c015bc4

Seungjae Yoo   commited 2024-06-19 16:18:51 +09:00
07b8fe1f92
Make TetheringRequest parcelable
Make TetheringRequest parcelable so we can pass it via Wifi APIs and map
Soft AP state changes to the correct request.

Bug: 216524590
Test: build
Change-Id: I63a45b14e9abc288b353159dfdcbe96fde485cb7

Quang Anh Luong   commited 2024-02-15 10:15:05 +09:00
1252f7f428
Baseline issues that were previously suppressed
java_sdk_library has previously internally disabled a few legitimate
issues. As this is being un-done for modules, add baselines for the
pre-existing issues.

Bug: 306806877
Test: m checkapi
Merged-In: Ie764d33196675e1482f30ecfd3d6d22b7fa25c27
Change-Id: Ie764d33196675e1482f30ecfd3d6d22b7fa25c27

Anton Hansson   commited 2023-11-07 08:40:36 +00:00
d8e40b3204
Add additional overriding methods to signature files
This change adds overriding methods that are essential to compile the
stubs generated from the signature files.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: Idba307148fd9afa87bfb7e0c89e00d9bd97ec204

Paul Duffin   commited 2023-10-12 19:21:07 +01:00
b3c3f2e9d0
Prepare for keeping concrete overrides of abstract methods
Currently, metalava will discard concrete overrides of abstract methods
from the API signature files which causes problems when attempting to
generate stubs from those files and also discards information that may
be important in API reviews. This change is the first step in the
process of changing that behavior.

This change hard codes the current behavior for discarding the concrete
overrides (`add-additional-overrides=no`) into those signature files
that will (or are likely) to be affected by the change in behavior.
That allows the default behavior to be changed for all the other files
without affecting these.

Follow up changes will remove the hard coding from the signature files
and will update the contents which will include the concrete overrides
of the abstract methods.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: I52c5bbe2e3bbd36019fe44fcb0b2d19876a5a869

Paul Duffin   commited 2023-10-10 17:11:25 +01:00
7bd2d108ea
Add TetheredInterface{Request, Callback} interface
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

markchien   commited 2021-11-08 16:44:34 +08:00
48e271bdcb
Add the tethering type to TetheringEventCallback methods
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

markchien   authored and   Chiachang Wang   commited 2021-06-01 14:35:39 +08:00
35ad54b25e
Allow callers of startTethering to choose local-only mode.
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

Lorenzo Colitti   commited 2021-04-19 20:25:58 +09:00
8a36c297bc
Merge "Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs" am: df5d88796b am: e39fdf0a5f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1360884

Change-Id: Ie45f32b2d46c8ac989a4a9242017eb4c2b73484b

Makoto Onuki   authored and   Automerger Merge Worker   commited 2020-07-15 16:00:22 +00:00
aefd8b4e25
Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs
Test: build / treehugger
Bug: 146727827
Exempt-From-Owner-Approval: Cherry-picking from goog/master to aosp/master
Merged-in: Ie1ad6711c490c679ebcfacd97154380a8810ba1c
Change-Id: Ie1ad6711c490c679ebcfacd97154380a8810ba1c

Makoto Onuki   commited 2020-07-15 01:36:38 +00:00
d682ebc33c
Switch framework-tethering to use java_sdk_library
The names of the individual modules do not quite follow the pattern
that java_sdk_library uses so this temporarily sets the following:
    naming_scheme: "frameworks-modules"

That causes java_sdk_library to use a naming scheme that matches the
one used by the individual modules of this. It will be cleaned up
later.

Part of the purpose of the java_sdk_library is to hide the
implementation code and force users of the library to depend on stubs
for a well defined API. Ideally, it would allow access to the
implementation in those cases where it is safe, e.g. from within the
same APEX, or from tests for the implementation. Unfortunately, due to
limitations in the build it does not yet have enough information to
make that decision correctly which means that any code that needs to
compile against the implementation is broken which would prevent us
from converting the module to java_sdk_library.

However, the only way to provide the additional information to allow
the implementation to be correctly exposed is to convert the modules
to java_sdk_library; a cycle.

In order to break that cycle the java_sdk_library creates a special
<module>.impl target which is used directly by tests and any other code
that needs it. Once all the modules have been converted to a
java_sdk_library then we can resolve the limitations in the build and
remove the direct references to <module>.impl.

Test: m update-api
Bug: 155164730
Merged-In: If5c115f482751f9f4b5f047e9e401a18e36799ef
Merged-In: Id1c2e848430c49a2da7402244814cd084f5da77c
Change-Id: Id1c2e848430c49a2da7402244814cd084f5da77c

Paul Duffin   commited 2020-05-28 13:14:52 +00:00
2dae272903
Hide startTethering with type function to module-lib only
Bug: 151918384
Test: m
Change-Id: Icef8b363aae97dd020d618bcb397f661aa6c4750
Merged-In: Icef8b363aae97dd020d618bcb397f661aa6c4750

markchien   authored and   Mark Chien   commited 2020-03-25 08:07:01 +00:00
1d0aebc713
Address API council review comment about TetheringRequest
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

junyulai   commited 2020-03-23 14:14:22 +08:00
a8b377747b
Address API council review comment about TetheringRequest
Test: atest TetheringTests FrameworksNetTests NetworkStackTests
Bug: 152055812
Change-Id: I0158d88e364772f9ac258bd18955edcdad266ad8

junyulai   commited 2020-03-23 12:13:57 +08:00
e3b9708c3a
Update tethering module api files
Bug: 147768409
Test: m checkapi
Merged-In: Idd041f0fbeca411ea23e49786a50dd7feb77ef45
Change-Id: I3da71661048b1f66522696e9333c2c14a224fe9f

Anton Hansson   commited 2020-03-20 13:49:34 +00:00
4168cea5e1
Hide startTethering with type function to module-lib only
Bug: 151918384
Test: m
Change-Id: Icef8b363aae97dd020d618bcb397f661aa6c4750

markchien   commited 2020-03-19 21:04:04 +08:00
b1bfea5367
Add individual API tracking files for modules
This adds metalava api tracking generation to the module
stub rules, to make sure we know exactly what API a
particular module stub exports.

Bug: 147768409
Test: m update-api check-api
Exempt-From-Owner-Approval: approved internally
Change-Id: Iaf2ef5b5751eb208d119ddbc74481239366fe581
Merged-In: Iaf2ef5b5751eb208d119ddbc74481239366fe581
(cherry picked from commit e7c52c7e3f)

Anton Hansson   commited 2020-03-19 08:51:11 +00:00
65d1e30c0f
TetheringManager API clean up
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

markchien   commited 2020-03-19 16:32:37 +08:00
f1332573bb
Support static address configuration
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)

Automerger Merge Worker   authored and   markchien   commited 2020-03-19 12:39:46 +08:00
9462a3c9f0
Add individual API tracking files for modules
This adds metalava api tracking generation to the module
stub rules, to make sure we know exactly what API a
particular module stub exports.

Bug: 147768409
Test: m update-api
Exempt-From-Owner-Approval: Approved in master
Change-Id: Iaf2ef5b5751eb208d119ddbc74481239366fe581
Merged-In: Iaf2ef5b5751eb208d119ddbc74481239366fe581

Anton Hansson   commited 2020-03-18 11:03:12 +00:00
49bdf5615f