Commit graph android_packages_modules_Co.../Tethering/Android.bp
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
Merge "Mark packages/modules/Connectivity apps in updatable apexes with updatable: true" into main
Colin Cross   authored and   Gerrit Code Review   commited 2024-10-03 18:02:04 +00:00
7f16a49fa5
Mark packages/modules/Connectivity apps in updatable apexes with updatable: true
Set updatable: true for apps that are embedded in updatable apexes.
This replaces the top down propagation that was automatically setting
the flag in order to unblock support for incremental Soong analysis.

Bug: 367784740
Test: builds
Flag: EXEMPT refactor
Change-Id: Icba5fd39077b309750224b3cd4c8c3a65c94de10

Colin Cross   commited 2024-10-01 16:13:41 -07:00
558f56bd10
Prefer framework-annotations-lib dependency
Rather than bundling a copy of the framework annotations, reference them
via framework-annotations-lib as a libs reference. This ensures the
target inherits any necessary keep rule configurations, and is the same
pattern used by other mainline modules.

Bug: 275175207
Test: m
Flag: EXEMPT refactor
Change-Id: I014aa79f4fec69aef062a2fb855a50f658380ac5

Jared Duke   commited 2024-09-27 18:41:54 +00:00
dff99282e8
Merge "Make java_sdk_library dependencies explicit" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-10 19:12:45 +00:00
430a8ad33c
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
Track tethering active sessions counts
This commit implements the necessary counters to bookkeep
max connection count, which will be used in follow-up changes
to monitor and upload active tethering session metrics.

The feature is disabled by default and will be gradually
rolled out.

Test: atest TetheringTests:com.android.networkstack.tethering.BpfCoordinatorTest
Bug: 354619988
Change-Id: Iaf251b0ec08bde95c1b12df022db2e03179309de

Junyu Lai   commited 2024-09-09 15:44:50 +08:00
06b81b6af3
Rename net-utils-tethering to net-utils-connectivity-apks.
CaptivePortalLogin module also require the static lib
net-utils-tethering, rename it to net-utils-connectivity-apks for more
usage scope.

Bug: 329361366
Test: TH
Change-Id: Id68255fec9b1586f445bbd7bf290df3403e4ca11

Xiao Ma   commited 2024-08-02 11:20:21 +09:00
6793fd0621
Refactor staticlibs
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.

- net-utils-framework-connectivity will be used by
  framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
  static liraries used by service-connectivity-pre-jarjar and Tethering
  respectively.

Bug: 350699020
Test: CI

Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68

Handa Wang   commited 2024-07-05 05:26:46 +00:00
9b0df36ea4
Use scopeguard from libbase_headers and delete the copy
A recent change makes libbase_headers available to the tethering apex.

Test: m
Change-Id: Id4f30f48bd65175e17c419230a8e7ebf5339d713

Patrick Rohr   commited 2024-05-22 10:50:55 -07:00
15754248e8
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
Merge "Remove strict_updatability_linting: true" into main
Cole Faust   authored and   Gerrit Code Review   commited 2024-02-02 18:21:10 +00:00
1042c175a0
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Remove strict_updatability_linting: true
strict_updatability_linting has been disabled for a while now, due to
an expansion in scope of the NewApi check. We're going to re-enable
it now, but doing so requires removing it from all modules that have
baselined NewApi issues.

Bug: 320698986
Test: Presubmits
Change-Id: Id6c9202c236f33ad89615e4d5fa5a6364147841a
Merged-In: Id6c9202c236f33ad89615e4d5fa5a6364147841a

Cole Faust   commited 2024-01-25 09:38:25 -08:00
ee56c432e0
Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.

This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.

Bug: 268261262
Test: Presubmits
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4ecdedda379e4e9040eb87b01dc3d8efb89be810)
Merged-In: I0393f24f101876abc458ca139eefdb279dcb2b03
Change-Id: I0393f24f101876abc458ca139eefdb279dcb2b03

Cole Faust   authored and   Android Build Cherrypicker Worker   commited 2024-01-25 02:41:58 +00:00
be30b3e96e
List baseline_filename on modules that are implititly using it
lintable modules currently pick up files named "lint-baseline.xml" to use as the
lint baseline implicitly. This is confusing because you could end up using the
baseline files in more modules than intended. Lint also has a feature where it
requests you remove unnecessary findings from the baseline file, so something
could be necessary for one module, but unnecessary for another that accidentally
picked up the baseline.

We're removing the implicit detection of the baseline file, which requires
all modules using it to list the baseline file explicitly.

Bug: 272769514
Test: Presubmits
Change-Id: If873a4ea20d73bb6268d83589c4fb3ebe54af664

Cole Faust   commited 2023-12-20 11:57:07 -08:00
a52ecf0c5c
Make NewApi to error in Tethering
Bug: 293971841
Test: TH
Change-Id: Iae92b171abe8a4620325bd7ce0f7f76912d6d1d8

Motomu Utsumi   commited 2023-11-15 08:57:30 +00:00
ac7c5723c3
Add a library for DNS resolver to read bpf maps
The library provides an init function and an API for DNS resolver to
query whether the application is allowed to send DNS query based on BPF
maps settings.

Bug: 288340533
Test: atest dns_helper_unit_test (with test CL)
Change-Id: Ibfb383bfb074da2104a25aa4f04ebc32b22d11da

Ken Chen   commited 2023-11-01 06:23:04 +08:00
ec0f7ac36f
[BR01.1] Support BpfNetMapsReader
A helper class to *read* java BpfMaps. This is designed to
provide direct bpf access in the caller process through
ConnectivityManager APIs.

The change also removes any statical link to
net-utils-device-common-struct from service-connectivity.
This is because net-utils-device-common-struct is already
included in framework-connectivity. Including it again in
service-connectivity would create a r8 build fail by circular
dependency.

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Bug: 297836825
Change-Id: I7a6d2eb816d0dc7343167bddd672806b199f44fe

Junyu Lai   commited 2023-10-23 20:11:02 +08:00
626045a601
Use new soong support to install privapp xml
This allows better overriding of it in the variants of this apex
that have a different package name.

Bug: 242509786
Test: build google tethering, diff before & after
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:91442c93fb8d7f67bf90faab0552428ff07f0452)
Merged-In: I84c53458686f70408ec759df854f5fcdee9cdaed
Change-Id: I84c53458686f70408ec759df854f5fcdee9cdaed

Anton Hansson   commited 2023-05-29 17:15:52 +00:00
1397a101ac
Stop Tethering requiring NetworkStack
It leads to complexity when Tethering is overridden, because the
required attribute must be duplicated for all the variants.

Require NetworkStack be explicitly installed instead.

Bug: 242509786
Test: m
Change-Id: Ideaecf88418901e2c86271166be24f6b7e498a20

Anton Hansson   commited 2023-05-29 10:08:08 +00:00
1525118302
remove inprocess tethering
It is just a constant source of bugs, with no real tests,
let's stop pretending this is a supported configuration.

The only tested configuration is out-of-process tethering
updatable apex.

Test: TreeHugger
Bug: 279942846
Change-Id: I4b659a3cd32b89a65549b56006b926a5ac755f7b

Maciej Żenczykowski   commited 2023-04-28 20:11:14 +00:00
7a03c187f5
Add libnetd_updatable to tethering-module-sdk
System libraries and binaries (e.g. netd) have a dependency on this.
Adding it to the sdk module allows an external snapshotting script
to generate prebuilts stubs of this library and commit them to
prebuilts/module_sdk. This allows minimal branch setup to build against
the apis of libnetd_updatable without checking out its source code.

Bug: 273723791
Test: m tethering-module-sdk
Change-Id: I1f235d86abba2c37ca7d750dea7071227e1346fe

Spandan Das   commited 2023-04-13 19:37:48 +00:00
b06f9d6b81
Add Tetheroffload AIDL interface support
Add the AIDL HAL service interface support and abstract the HIDL/AIDL
interface implementations to allow OffloadController to talk to both
interfaces.

Bug: b/205762647
Test: atest com.android.networkstack.tethering
      atest ConnectivityCoverageTests
      atest ConntrackSocketTest
Change-Id: If7634a298d03668ed70b328f1ad6ca0ac0fe170b

KH Shi   commited 2023-03-17 16:56:47 +08:00
3d5e65cb48
Add CDM dependency in Tethering
This change introduces a limited library for dependencies on
framework-connectivity from Tethering,
connectivity-internal-api-util, where all classes are annotated with
@RequiresApi(S) to ensure proper API checks are done before usage.

Bug: 245972418

Change-Id: I82bafd9063341adc71d07f0858e6d68283d081f0

Igor Chernyshev   commited 2022-12-16 17:55:53 +00:00
9dac660bf0
Merge "Remove usages of java_api_finder"
Cole Faust   authored and   Gerrit Code Review   commited 2022-12-02 19:31:31 +00:00
65b2ec8855
Remove usages of java_api_finder
This errorprone checker is no longer used.

Bug: 260268418
Test: Presubmits
Change-Id: I055bce5957ae05faef683e3d515332bd119fb720

Cole Faust   commited 2022-11-23 15:10:11 -08:00
417c1d9c3a
Add ConfigInfrastructure lib to Android.bp
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.

Test: m
bug: 253019048
Change-Id: I29f993342e1baf4e75b30c8d99de10bc087a582b

Hassan Ali   commited 2022-11-23 11:41:43 +00:00
c4f63fa973
[TetheringGoogle] Remove explicit targetSdkVersion
Going forward targetSdkVersion would be set by build system.
It would be by default set to 10000 before SDK finalization,
and updated to the new API level after finalization.

Effectively it would mean:
1. '10000' in aosp and internal master
2. Finalized number in development branches like "33" in "tm-dev"
3. As sdk hasn't been finalised in "udc-dev", it would be "10000"
which would be automatically updated to finalized version after sdk finalization.

Removing the target sdk version declaration from the blueprint and manifest files.
More details can be found here go/mainline-modules-target-sdk-version-fix

Bug: b/242296003
Test: croot; sdks=`find ./out -name 'TetheringGoogle.apk' | grep -v .intermediates`; echo $sdks; for sdk in $sdks;do aapt2 dump badging `echo $sdk` | grep targetSdkVersion:; done
1. outputs 33 in tm-mainline-prod
2. outputs 10000 in master

Change-Id: I2657901f066a5220ae0f807846b32b9c41afcce9

Harshit Mahajan   commited 2022-10-27 09:47:16 +00:00
e210c27140
Run R8 with necessary Tethering classpath classes
R8 emits "missing class" warnings when optimizing Tethering.apk
because Tethering packages the already built TetheringApiXLib, but does
not specify any classpath library, which are actually needed for R8.

This causes wrong optimizations, where R8 would sometimes strip out code
that it thinks is unused (because it considers it unreachable due to the
missing class, or it does not know the superclass of a callback and
thinks the overridden methods cannot be called).

Add the necessary classpath libraries to remove the warnings.

Bug: 226127213
Test: m
Change-Id: Icd639d2783a2adc21e05a3b44f276ad72ad1e2d3

Remi NGUYEN VAN   commited 2022-08-10 15:30:57 +09:00
37dc1e2b57
Merge "Dedup *fragments information common to apex and sdk"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-07-19 08:32:05 +00:00
a79c227372
Deprecate filegroup tethering-module-utils-srcs in tethering.
tethering-module-utils-srcs filegroup only contains NetdUtils.java
class, import this class from netd-client static lib instead.

Bug: 238960524
Test: m
Change-Id: I7547c3a3a13e564408cdf8e702f3438530763381

Xiao Ma   commited 2022-07-14 13:30:27 +09:00
59819aeb0e
Dedup *fragments information common to apex and sdk
Previously, both the sdk and apex had to specify the same *fragments
property to ensure that building a system image from a prebuilt
version of the module (both APEX and sdk snapshots) would work.

This change avoids the duplication by adding the apex to the sdk which
allows the sdk to automatically export any APIs and related information
provided by the APEX. At the moment that just includes information from
*fragments properties but may expand in future.

Bug: 232401814
Test: # Build snapshots with a fixed build number
      BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh
      # Remove api diff files as they contain file stamps of generated files so
      # differ every time they are generated.
      find out/dist/mainline-sdks -name \*txt | xargs rm
      # Save the snapshots away.
      mv out/dist/mainline-sdks before-changes
      # Apply this change.
      # Repeat the first two steps above and then run the following to verify
      # that this change had no effect on the generated snapshot contents.
      meld before-changes out/dist/mainline-sdks
Change-Id: Id98a645a2cdb20bc4bcdc18de565691f1ce7f799

Paul Duffin   commited 2022-07-13 13:07:46 +00:00
1514c032f5
Make Tethering module depend on net-utils-device-common-ip.
NetworkStack module utils are duplicated to net-utils-device-common-ip,
delete the module utils source code and use net-utils-device-common-ip
instead.

Bug: 235901424
Test: atest TetheringTests
Change-Id: I19fe72a92d6de1084963c2b3a38d094f8da2a91e

Xiao Ma   commited 2022-07-13 04:32:28 +00:00
c81c066958
Move struct {Clat*, Tether4*, TetherStats*} to connectivity module
Needed because these struct classes should not be exposed.
Only used for the connectivity module and its tests.

Bug: 234160319
Test: atest ConnectivityCoverageTests

The moved files are identical.

diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatIngress6Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatIngress6Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatIngress6Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/TetherStatsValue.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsValue.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Key.java
(no diff)

Change-Id: I4ce8045150bdbf04c63c5262c58a0ebcc30d395c

Hungming Chen   authored and   Nucca Chen   commited 2022-06-29 11:34:19 +00:00
01f2550ac4
Fix linker error with upstream llvm
https://reviews.llvm.org/rGd07ff995917 changed behaviour of lld and is
no longer accepting single dash `-error-limit`. Update to the new flag
format.

Test: presubmit
Change-Id: I7a78128c56157414411d085086091b9d25be0186

Yi Kong   commited 2022-06-21 19:45:01 +00:00
20a996e1e1
Merge "Remove NetworkPermissionConfig package"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-06-09 01:24:19 +00:00
2111cc0749
Remove NetworkPermissionConfig package
Move declaration of MAINLINE_NETWORK_STACK permission from the
NetworkPermissionConfig package to the NetworkStack package.

Bug: 223649084
Test: m

(cherry picked from f2bf0335cd)
Merged-In: I7d0565d366892f18dfc510ccbbdbf1eab6f1932a
Merged-In: I1bb172919db1368e1b0a6560d63dc9e35686f89e

Change-Id: I2f8ac1a31b053803bf1b46b4cfcfbf297b8ebec3

Motomu Utsumi   commited 2022-06-01 02:55:22 +00:00
ae27901118
Bump tethering target sdk to 33
Note: to avoid missing some dependeices change only happen in T+, below
testing verification is perform by internal branch.

Test: atest TetheringTests
      atest TetheringIntegrationTests
      atest CtsTetheringTest
      atest MtsTetheringLatestSdk
      manually change entitlement check recheck period to 1 min and
      monitor schedule alarm works.
      Dogfood this change personally 7 days, major use hotspot sharing network to notebook to work.
Bug: 232193147
Change-Id: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3

Mark Chien   commited 2022-05-31 03:31:18 +00:00
d25a1e05ae
Injecting tethering stats into statsd
Fill in downstream type, upstream type, error code and user type to NetworkTetheringReported.

Bug: 153942334
Test: m, flash and boot
Test: atest TetheringMetricsTest
Change-Id: I6ba7d9e512b1ada519f44f9f3a95667e4b0f03c0

Wayne Ma   commited 2022-05-09 19:35:53 +08:00
7ecded8248
Adding Tethering proto
Bug: 153942334
Test: m, flash and boot
Change-Id: I853d3a4dd914dd0c65a6c9e1749d8898da68540e

Wayne Ma   commited 2022-03-24 17:40:31 +08:00
71d66396d2
Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b

paulhu   commited 2022-03-01 09:44:21 +08:00
537f72061a
[MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c

Junyu Lai   commited 2022-02-28 03:24:19 +00:00
eb6f4bef96
Merge "Move permissions allowlist for Tethering"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-15 04:43:27 +00:00
a828eb711c
Move permissions allowlist for Tethering
The allowlist will now be in the apex instead.

Test: boots && check permissions.xml is bundled
Bug: 190375768

Change-Id: Ia7434cba54d2b51479e52323f22c7f454499991d

Andrei Onea   commited 2022-02-10 15:04:46 +00:00
52eac028fc
remove spurious headers
bpf_connectivity_headers already pulls in bpf_headers,
which already pulls in bpf_syscall_wrappers.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib22da8d433bd3187349f06f41ec064360c38982f

Maciej Żenczykowski   commited 2022-02-02 16:38:36 -08:00
2f7dac1bad
Remove libtcutils from dependencies as it is included in lib bpfjni
Test: builds && boots
Change-Id: Iacaed446655a606399188b8e5e4a5e98fefee121

Patrick Rohr   authored and   Maciej Żenczykowski   commited 2022-02-02 19:40:12 +00:00
8dfcb14be3
Merge "Conditionally disable TetheringApiCurrentLib"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-28 05:21:22 +00:00
2be7b1d5fb
Conditionally disable TetheringApiCurrentLib
The "current" targets are only necessary in branches that can use
non-stable APIs, and can fail to build otherwise.

Apply ConnectivityNextEnableDefaults so they are disabled on such
branches. Also deprecate NetworkStackNextEnableDefaults, so
ConnectivityNextEnableDefaults is used everywhere.

Bug: 190249673
Test: m
Change-Id: I1b152f3cc22f1bed6444d280f0066e480980e949

Remi NGUYEN VAN   commited 2022-01-27 18:49:19 +09:00
f826bce37a
Adding bt dependency
Bug: 206121418
Test: Compile
Merged-In: I92f3971ba1bb7e873166482f7051dcd2b9df5bf2
Change-Id: I92f3971ba1bb7e873166482f7051dcd2b9df5bf2

Roopa Sattiraju   authored and   Rahul Sabnis   commited 2022-01-25 20:27:30 -08:00
27acf0b677