Commit Graph

136 Commits

Author SHA1 Message Date
Anton Hansson
a12ffacf6c Add tethering bootclasspath fragment to its sdk
This subsumes the java_sdk_library in the sdk.

Bug: 188427719
Test: build_mainline_modules.sh
Change-Id: Ib2ebb3893135b4dd91812f1f1b0915540cfd64cb
Merged-In: Ib2ebb3893135b4dd91812f1f1b0915540cfd64cb
(cherry picked from commit 3669599dec)
2021-06-14 19:23:49 +01:00
Aaron Huang
3f69f1c418 Add required permission to Tethering
The permission of Tethering is moved to a separate xml file,
add the xml module to the required field of tethering app.

Bug: 151213404
Test: TetheringTests
Merged-In: I40b45a0f1b44fba0b68e94811d14725a59ed4e59
Change-Id: I40b45a0f1b44fba0b68e94811d14725a59ed4e59
2021-05-26 23:29:55 +08:00
junyulai
b95083ea6a No-op Refactoring of startTrackDefaultNetwork
While the actual part that track default request is inside
UpstreamNetworkMonitor, instead of passing it from Tethering,
move it into counter-part CL and use it from
UpstreamNetworkMonitor.

Since the current code is replaced by registerSystemDefaultCallback
in Android S, implement it inside the api30 shim implementation
to provide an unified interface to tethering.

Test: atest TetheringCoverageTests
Bug: 185952829
Change-Id: Iaf21b6b662aa6aba79c2b75379128b8523f81f02
2021-05-13 14:07:40 +08:00
junyulai
177dc86ad1 [SP32] Try to get 1.1 OffloadControl hardware if available
This is a no-op change that try to use 1.1 HAL if available.
Otherwise, fallback to 1.0 HAL. The change also provides version
information for subsequent patches to determine what to do for
specific version.

Test: atest TetheringTests
Bug: 149467454
Merged-In: I6a3ce877cdff2496087b97b191a9bfd5b0792827
Change-Id: I6a3ce877cdff2496087b97b191a9bfd5b0792827
  (cherry-picked from ag/13973146)
2021-04-29 18:19:55 +08:00
Aaron Huang
b401e58a1e Update sources of Tethering module since it is renamed
framework-tethering-shared-srcs is named to
framework-connectivity-shared-srcs so update
source section to include correct file group.

Ignore-AOSP-First: changes in topic has conflicts in sc-dev
Bug: 177046265
Test: FrameworksNetTests
Change-Id: I81e2af0cc3b37af16b03c1288eb0591b7ed65cc4
Merged-In: I81e2af0cc3b37af16b03c1288eb0591b7ed65cc4
Merged-In: Ic2491f04880ff66abc3b2d3aaee6168e18f6d68a
2021-03-11 07:36:55 +00:00
Remi NGUYEN VAN
74b274424a Add dependency on system API in connectivity
The system API are moved to the connectivity module: add dependency on
the stubs from framework-tethering.

This only allows tethering to depend on system API defined by the
connectivity classes, not on any private code, even if they are
eventually bundled in the same APEX.

Bug: 171540887
Test: m

Merged-In: Iebfb3e01c5d2480e84edcfc76cf489520bd60237
Merged-In: Ic2491f04880ff66abc3b2d3aaee6168e18f6d68a
(clean cherry-pick from internal branch)

Change-Id: Iebfb3e01c5d2480e84edcfc76cf489520bd60237
2021-02-26 19:36:06 +09:00
Bob Badour
f5b346ed1d Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity" 2021-02-19 06:23:22 +00:00
Treehugger Robot
319064f284 Merge "Use networkstack_client instead of aidl_interface" 2021-02-18 13:31:54 +00:00
Bob Badour
97e6be27f6 [LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  Tethering/Android.bp
  Tethering/apex/Android.bp
  Tethering/bpf_progs/Android.bp
  Tethering/common/TetheringLib/Android.bp
  Tethering/tests/Android.bp
  Tethering/tests/integration/Android.bp
  Tethering/tests/mts/Android.bp
  Tethering/tests/privileged/Android.bp
  Tethering/tests/unit/Android.bp
  tests/cts/hostside/Android.bp
  tests/cts/hostside/aidl/Android.bp
  tests/cts/hostside/app/Android.bp
  tests/cts/hostside/app2/Android.bp
  tests/cts/hostside/certs/Android.bp
  tests/cts/net/Android.bp
  tests/cts/net/api23Test/Android.bp
  tests/cts/net/appForApi23/Android.bp
  tests/cts/net/jni/Android.bp
  tests/cts/net/native/dns/Android.bp
  tests/cts/net/native/qtaguid/Android.bp
  tests/cts/net/util/Android.bp
  tests/cts/tethering/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I8534c580f0e2a17be146300b67b3604817b64507
2021-02-16 04:09:58 -08:00
Jeongik Cha
d05f990649 Use networkstack_client instead of aidl_interface
Bug: 150578172
Test: m
Change-Id: Ib5f28db973eb80942faafe1c1c5ddcaab54bf980
2021-02-16 08:20:12 +00:00
Hai Zhang
6d71f109bc Add tethering-module-sdk build target.
Bug: 177884752
Test: m tethering-module-sdk
Change-Id: Idd4e6743001a6402f6a5dd6832601b08d7cc0236
2021-02-14 06:38:26 +00:00
Lorenzo Colitti
734b14e07d Add a bpf_tethering_headers lib used by the programs and JNI.
This provides a place to store common definitions that can be
used by both the programs and by JNI code in the tethering
module.

Over time much of the tethering-specific code in bpf_shared.h
could move here.

Test: m
Bug: 177884581
Change-Id: I4bf2c762d61cd5db003d59880e6bf7d107ff1a07
2021-02-09 01:54:52 +00:00
Nucca Chen
6bc18e6d2c Merge "[NFCT.TETHER.2] Migrate tetherOffloadRuleAdd from netd to mainline" 2021-01-18 06:37:23 +00:00
Hungming Chen
dd55b91228 [NFCT.TETHER.2] Migrate tetherOffloadRuleAdd from netd to mainline
A preparation for updating BPF map in mainline module.

Test: atest TetheringCoverageTests
Change-Id: I6f8667bf110dae3e2805c2752ff59e7284a7bce0
2021-01-15 17:10:58 +08:00
Hungming Chen
400702b6bb Use header module bpf_syscall_wrappers
Use the versioned header library instead of just including
the header files.

Test: atest BpfMapTest
Change-Id: Icf23dcdc051a4ead6a7c6e925159cdc27f49eac2
2021-01-13 14:31:28 +08:00
Nucca Chen
12067258b2 Merge "Provide a easy way to access bpf maps from java" 2021-01-12 08:06:03 +00:00
markchien
7052688dde Provide a easy way to access bpf maps from java
A wrapper for bpf map opening, reading/writing, and iteration.

Bug: 173167302
Test: atest BpfMapTest

Change-Id: I792b41978b322c9e4969cd7b6c35d6978ab86bc4
2021-01-11 17:43:27 +08:00
lucaslin
ee661dfb59 Move BaseNetdUnsolicitedEventListener to frameworks/libs/net
Move BaseNetdUnsolicitedEventListener to frameworks/libs/net and
create a new library - netd-client for using.
Also remove netd_aidl_interface-unstable-java since netd-client
links to the stable one.

Bug: 174837473
Test: Manual test and check the log.
Change-Id: Id65142b8c13a6cccbfe387d4ab757967497546e6
2021-01-08 01:55:53 +00:00
Orion Hodson
e5bd0dba21 Use libnetjniutils for JNI File Descriptor info
Drops use of deprecated API in libnativehelper and uses a common
helper that will be stable across releases.

Bug: 158749603
Test: m
Change-Id: Ic1a1811ffb9a1c207f562a180417e99df31e3502
2020-12-11 22:48:10 +00:00
Nikita Ioffe
583e35a12e com.android.tethering: set min_sdk_version 30
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)
(cherry picked from commit 1fe1e539e1)
2020-11-05 20:30:40 +00:00
Anton Hansson
b8a342e4bc Explicitly reference framework-wifi app build rule
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
Merged-In: I3d9f2049cf898b5e551a5c5764df423abaa5e92d
2020-10-05 11:43:39 +01:00
Xin Li
82a71b8f72 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Chalard Jean
bdcca9246e Move utils from network stack to libs.
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
Change-Id: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
2020-07-29 21:15:48 +09:00
Xiao Ma
e5e0743057 Use unstable networkstack AIDLs in development branches
Development branches should use the -unstable version of the
NetworkStack AIDLs so that refreezing is not necessary for each
modification.
The versions will be re-frozen before each release instead.

Bug: 157534516
Test: m
Merged-In: I74b4a16266bda7b8ac740b3a0193268da260fc2f
Change-Id: I1c2fe707d865e6a1953b4ab82194d4b9132258f9
2020-06-22 10:15:13 +00:00
Wayne Ma
31b6461408 Merge "Add framework-statsd dependency and make framework-statsd visible to Tethering package." into rvc-dev am: 7ce578a359
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926261

Change-Id: I81e0304f0560cbd070c5bb49967a8b6bf3e5d58a
2020-06-22 08:51:46 +00:00
waynema
b7048af0a9 Add framework-statsd dependency and make framework-statsd visible to
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
2020-06-22 06:57:51 +00:00
Remi NGUYEN VAN
0d0ea27274 Use unstable networkstack AIDLs in development branches
Development branches should use the -unstable version of the
NetworkStack AIDLs so that refreezing is not necessary for each
modification.
The versions will be re-frozen before each release instead.

Bug: 157534516
Change-Id: I74b4a16266bda7b8ac740b3a0193268da260fc2f
Test: m
2020-06-15 08:05:49 +00:00
Lorenzo Colitti
601971d2d2 Use the latest stable netd AIDL interface in Tethering.
This is required to use the new BPF tethering APIs that set data
usage limits.

AOSP and master are already using -unstable instead of -V3.
In order not to change master, the Merged-In tag is set to the CL
that switched AOSP (and master) to -unstable.

Test: m
Bug: 150736748
Merged-In: I2d2cedf560319653f67f6b06f7abb0bf66eba91a
Change-Id: Idba29b0fe428ac6552a025dcbe15729739088e9e
2020-06-10 01:07:29 +09:00
Paul Duffin
672fa36bdd Merge "Switch to standard naming scheme" into rvc-dev am: f94d682a9b
Original change: undetermined

Change-Id: I57cffc68409c2e9b795b0c8732fecc9bbf33e113
2020-06-02 11:58:50 +00:00
Paul Duffin
6812c1b1ee Switch to standard naming scheme
Removes use of the special framework-modules naming scheme.

Bug: 155164730
Test: m java
Exempt-From-Owner-Approval: Build cleanup.
Change-Id: I3b78fcbcacc3df787e171d6eedeef1e51b087615
Merged-In: I0c31e2183353dfb5bd49f04f3455cb7b10be6866
(cherry picked from 8b864fb45ce79051437f13c2a19510718ea3b7aa)
2020-06-02 06:53:53 +00:00
Nucca Chen
4f0ab53a43 Merge changes from topic "tether_offload_data_limit" am: 4155d2a6ad am: ff06ea7122
Original change: undetermined

Change-Id: Id9ba87f230591ad969d9de4661e180ac1184f5e3
2020-06-02 00:13:51 +00:00
Hungming Chen
140042db6f Make tethering module to use netd_aidl_interface-unstable-java
Use unstable aidl for new api tetherOffload* and modified
parcel TetherStatsParcel in BpfCoordinator{, Test}.

Bug: 150736748
Test: m

Change-Id: I2d2cedf560319653f67f6b06f7abb0bf66eba91a
2020-05-29 20:24:02 +08:00
Paul Duffin
2dae272903 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
2020-05-28 13:14:52 +00:00
Paul Duffin
cbac8e0b63 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 Tethering InProcessTethering checkapi
Bug: 155164730
Merged-In: If5c115f482751f9f4b5f047e9e401a18e36799ef
Change-Id: Id1c2e848430c49a2da7402244814cd084f5da77c
2020-05-28 12:50:04 +01:00
Jooyung Han
595adc05e8 InProcessTethering: set min_sdk_version
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

InProcessTethering is a part of com.android.tethering.inprocess,
therefore min_sdk_version is set.

Exempt-From-Owner-Approval: CP from AOSP

Bug: 145796956
Bug: 150999716
Test: m
Merged-In: I655211e0b9aa4bd7cb3718b6f567f0aa1a0176a5
Change-Id: I655211e0b9aa4bd7cb3718b6f567f0aa1a0176a5
(cherry picked from commit ace605ef568fecfe148d2785f4681c9c858487aa)
2020-05-13 08:45:54 +00:00
Jooyung Han
5f9f31c18b Set min_sdk_version for updatable mainline modules
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Bug: 145796956
Bug: 150999716
Test: m
Merged-In: Ifaecb49a47a1f43edea3ea06e1cf704a177d1044
Change-Id: Ifaecb49a47a1f43edea3ea06e1cf704a177d1044
(cherry picked from commit 33aa294e96f13906f596e427b96652fe80cf199b)
2020-05-13 16:18:51 +09:00
Jooyung Han
482af2e2e8 InProcessTethering: set min_sdk_version
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

InProcessTethering is a part of com.android.tethering.inprocess,
therefore min_sdk_version is set.

Bug: 145796956
Bug: 150999716
Test: m
Change-Id: I655211e0b9aa4bd7cb3718b6f567f0aa1a0176a5
2020-05-11 13:18:29 +09:00
Treehugger Robot
bfd392c4c0 Merge "Override tethering module APK-in-APEX for Go variant" 2020-05-08 12:11:47 +00:00
Jooyung Han
50f4887299 Merge "Set min_sdk_version for updatable mainline modules" 2020-05-08 08:45:49 +00:00
Mark Chien
cca6aad882 Merge "Override tethering module APK-in-APEX for Go variant" into rvc-dev 2020-05-07 15:15:59 +00:00
Jeongik Cha
1aba7987de Use stable networkstack-aidl-interfaces
Test: m nothing
Bug: 133526962
Original-Change: https://android-review.googlesource.com/1301313
Merged-In: I507f40866d04db5ed3361831e01eaa4dfaf20bed
Change-Id: I507f40866d04db5ed3361831e01eaa4dfaf20bed
2020-05-07 11:48:44 +00:00
Jooyung Han
8182d8bd56 Set min_sdk_version for updatable mainline modules
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Bug: 145796956
Bug: 150999716
Test: m
Change-Id: Ifaecb49a47a1f43edea3ea06e1cf704a177d1044
2020-05-07 17:30:00 +09:00
markchien
dbaff66f45 Override tethering module APK-in-APEX for Go variant
Bug: 155604224
Test: build
Change-Id: I4147173b5f3668491ff9cb7f1f86715b036d6d4b
Merged-In: I4147173b5f3668491ff9cb7f1f86715b036d6d4b
2020-05-07 06:35:05 +00:00
markchien
9548c8580c Override tethering module APK-in-APEX for Go variant
Bug: 155604224
Test: build
Change-Id: I4147173b5f3668491ff9cb7f1f86715b036d6d4b
2020-05-07 14:21:49 +08:00
Jeongik Cha
0630f383af Use stable networkstack-aidl-interfaces
Test: m nothing
Bug: 133526962
Change-Id: I507f40866d04db5ed3361831e01eaa4dfaf20bed
2020-05-04 08:11:26 +00:00
Amit Mahajan
ee27d55295 DO NOT MERGE Remove references of telephony-stubs.
Since it's not used for now.

Test: TH
Bug: 153304048
Merged-in: I1812818c3d49463c3840a98212bbab58a110359a
Change-Id: I1812818c3d49463c3840a98212bbab58a110359a
2020-04-15 17:55:52 -07:00
Luke Huang
d20078112b Use the lastest frozen netd_aidl_interface in framework
Bug: 140541991
Test: build
Merged-In: I984969e09f8d5196945a7412c51bd8880223ad9e
Change-Id: I984969e09f8d5196945a7412c51bd8880223ad9e
2020-04-09 16:20:44 +00:00
Luke Huang
6ca4ec97d2 Use the lastest frozen netd_aidl_interface in framework
Bug: 140541991
Test: build
Change-Id: I984969e09f8d5196945a7412c51bd8880223ad9e
2020-04-07 08:35:42 +00:00
Anton Hansson
bbe4af1f08 Build tethering against the module SDK
Link against the stubs of other modules and the implementation
of the tethering module jar.

Bug: 146757305
Test: m Tethering
Change-Id: I7c93b60654e21a4a27d21cbf0c2a6cb21f813529
Merged-In: I7c93b60654e21a4a27d21cbf0c2a6cb21f813529
(cherry picked from commit aaeaa195b8)
2020-03-23 10:29:11 +00:00
Anton Hansson
aaeaa195b8 Build tethering against the module SDK
Link against the stubs of other modules and the implementation
of the tethering module jar.

Bug: 146757305
Test: m Tethering
Change-Id: I7c93b60654e21a4a27d21cbf0c2a6cb21f813529
2020-03-20 15:31:02 +00:00