Skip to content
Snippets Groups Projects
  1. May 26, 2023
  2. May 08, 2023
  3. Apr 19, 2023
    • Motomu Utsumi's avatar
      Move cronet to framework-connectivity · 73e2e87d
      Motomu Utsumi authored
      aosp/2384137 added cronet to framework-tethering.
      But framework-connectivity is a better place to put cronet since
      cronet does not work on R devices (b/270049141) and
      framework-tethering is R+, framework-connectivity is S+.
      
      Followup CLs will move some modules (e.g. CronetJavaPrejarjarDefaults)
      that use the branch dependent soong variables to framework/Android.bp
      
      Test: TH
      Bug: 278070640
      Change-Id: I6bc10116759fb9e083c02147908e53022dab740a
      73e2e87d
  4. Mar 27, 2023
    • Remi NGUYEN VAN's avatar
      Use current shims in service-connectivity · 02eee9aa
      Remi NGUYEN VAN authored
      Instead of NetworkStackApiStableShims, use NetworkStackApiCurrentShims
      as this is a development branch.
      
      Use java_defaults in the "merge conflicts expected" section, so that
      module release branches can use the same defaults, but set it to
      NetworkStackApiStableShims.
      
      The shims are removed from FrameworksNetIntegrationTests, as they are
      already available there through service-connectivity-pre-jarjar. Keeping
      them as a dependency would make FrameworksNetIntegrationTests use both
      Stable shims (directly) and Current shims
      (through service-connectivity-pre-jarjar).
      
      Bug: 266205506
      Test: m
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:921290b49d109360aae5dc39effaa3b0e691f65a)
      Merged-In: I88228152834a1c06830fb51e868fb8e3d8c47519
      
      Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519
      02eee9aa
    • Remi NGUYEN VAN's avatar
      Use stable shims in service-connectivity · 8ff46fc0
      Remi NGUYEN VAN authored
      Keep using NetworkStackApiStableShims as this is a module release
      branch.
      
      Use java_defaults in the "merge conflicts expected" section, so that
      module release branches can use the same defaults, but set it to
      NetworkStackApiStableShims.
      
      The shims are removed from FrameworksNetIntegrationTests, as they are
      already available there through service-connectivity-pre-jarjar. Keeping
      them as a dependency would make FrameworksNetIntegrationTests use both
      Stable shims (directly) and Current shims
      (through service-connectivity-pre-jarjar).
      
      Ignore-AOSP-First: this needs to be submitted separately in each branch,
                         with downstream branches first as there are merge
      		   conflicts in Tethering/apex/Android.bp that cannot be
      		   automerged.
      
      Bug: 266205506
      Test: m
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:921290b49d109360aae5dc39effaa3b0e691f65a)
      Merged-In: I88228152834a1c06830fb51e868fb8e3d8c47519
      
      Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519
      8ff46fc0
    • Remi NGUYEN VAN's avatar
      Use current shims in service-connectivity · 921290b4
      Remi NGUYEN VAN authored
      Instead of NetworkStackApiStableShims, use NetworkStackApiCurrentShims
      as this is a development branch.
      
      Use java_defaults in the "merge conflicts expected" section, so that
      module release branches can use the same defaults, but set it to
      NetworkStackApiStableShims.
      
      The shims are removed from FrameworksNetIntegrationTests, as they are
      already available there through service-connectivity-pre-jarjar. Keeping
      them as a dependency would make FrameworksNetIntegrationTests use both
      Stable shims (directly) and Current shims
      (through service-connectivity-pre-jarjar).
      
      Ignore-AOSP-First: this needs to be submitted separately in each branch,
                         with downstream branches first as there are merge
      		   conflicts in Tethering/apex/Android.bp that cannot be
      		   automerged.
      
      Bug: 266205506
      Test: m
      Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519
      921290b4
  5. Mar 23, 2023
  6. Mar 17, 2023
  7. Mar 14, 2023
  8. Mar 13, 2023
  9. Feb 09, 2023
    • Yuyang Huang's avatar
      Moves all compatibility flags to ConnectivityCompatChanges.java · 90a2cbdd
      Yuyang Huang authored
      ConnectivityCompatChanges.java becomes the centralized place for all the
      CompatChanges used in the Connectivity module. By putting all the
      CompatChanges here, we are able to manage them under a single
      platform_compat_config.
      
      Bug: 268440216
      Test: atest FrameworksNetTests
      Change-Id: I3e17af545718073d7d1c96e27298e7790563fd33
      90a2cbdd
  10. Jan 17, 2023
  11. Jan 16, 2023
    • Patrick Rohr's avatar
      cronet: disable cronet defaults in tm-mainline-prod · eca616bf
      Patrick Rohr authored
      Cronet is being released in U and therefore shouldn't become part of the
      tethering apex until then.
      
      The Merged-In line of this change references the change that originally
      introduced it to prevent it from automerging anywhere.
      
      Test: TH
      Merged-In: I5a15acfed68f47b4d59fa72da3dbbce2fd00ae63
      Change-Id: I2db8597adc8b4b340761fe4727fd7c74afaa4084
      eca616bf
    • Patrick Rohr's avatar
      cronet: introduce constant for apex_defaults · c65b4512
      Patrick Rohr authored
      Merging them as enabled, so they can be disabled on tm-mainline-prod.
      
      Test: TH
      Change-Id: I5a15acfed68f47b4d59fa72da3dbbce2fd00ae63
      c65b4512
  12. Dec 20, 2022
    • Remi NGUYEN VAN's avatar
      [DO NOT MERGE] Disable "next" targets in module release branch · 75b88c08
      Remi NGUYEN VAN authored
      The "next" targets are only used for development builds using
      unfinalized SDKs, and are not necessary in the module release
      branch.
      
      This should not be (auto)merged in development branches.
      
      Ignore-AOSP-First: module release branch-only change
      Change-Id: I8cb64d8bb86b781cd57d1a1a466c56185573fcc2
      Test: m
      75b88c08
  13. Dec 16, 2022
    • Igor Chernyshev's avatar
      Add CDM dependency in Tethering · 9dac660b
      Igor Chernyshev authored
      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
      9dac660b
  14. Nov 04, 2022
    • Remi NGUYEN VAN's avatar
      Add libconnectivity_native · fb70eba6
      Remi NGUYEN VAN authored
      The library provides an interface to interface with the
      ConnectivityNative service, and implement port blocking APIs.
      
      Bug: 179733303
      Test: atest connectivity_native_test
      Change-Id: Iad1c84b5eeab835aca14a2db72a900e099aa3c1c
      fb70eba6
  15. Oct 27, 2022
  16. Oct 12, 2022
    • Nada Hussein's avatar
      Use r launch defaults for dcla for com.android.tethering. · d44b2931
      Nada Hussein authored
      DCLA (Dynamic Common Library Apex) is a mechanism used by Mainline, which places shared c++ libraries into a separate apex in order to de-duplicate them, with the goal of reducing the overall size of a train.
      
      This change results in two packages being built:
      If the APEX_BUILD_FOR_PRE_S_DEVICES=1 is set, the apex will have min_sdk set to 30 as before, and this will deliver to Android 11.
      If the flag is not set, the second package will have min_sdk set to 31, and will deliver to Android 12 and beyond.
      
      If developers intend to build an apex for use in R as before, they must set the flag APEX_BUILD_FOR_PRE_S_DEVICES=1, which will set the min_sdk to 30 as before. If not set, the new default behavior will set the min_sdk to 31.
      
      This new variant will be post-processed and trimmed by Mainline infrastructure, and the resulting trimmed module can only be installed on S+ devices, requiring that we set the min_sdk to 31.
      
      Test: APEX_BUILD_FOR_PRE_S_DEVICES=1 m com.android.tethering & verify
            sdk_version = 30
      Test: m com.android.tethering & verify sdk_version = 31
      Bug: 247762791
      Change-Id: I2d6563867e3ca36f678fe0abadbe197946a82094
      d44b2931
  17. Sep 13, 2022
    • Paul Duffin's avatar
      Make the hiddenapi*-tiramisu.txt files part of framework-connectivity-t · c8164e49
      Paul Duffin authored
      Previously, the hiddenapi*-tiramisu.txt files that were created as part
      of the work for creating framework-connecvity-t were just added to the
      list of hidden API files on the bootclasspath_fragment. Unfortunately,
      that made it impossible to exclude those when generating an sdk
      snapshot for S which cannot include framework-connectivity-t.
      
      This change moves those files to be part of framework-connectivity-t
      instead of the bcpf so that they will only be used in an sdk snapshot
      when the library is part of the snapshot.
      
      Bug: 240406019
      Test: packages/modules/common/build/mainline_modules_sdks.sh
            # Ran the previous command with and without this change to make
            # sure that this change does not change the sdk snapshot
            # contents. A follow up change will exclude the
            # framework-connectivity-t library from the S sdk snapshot.
      Change-Id: Ib5c5c6046d96b911c8e9e5ac3729ce963f1b6907
      c8164e49
  18. Jul 27, 2022
    • Remi NGUYEN VAN's avatar
      Add back compat config for NSD · 348bbb02
      Remi NGUYEN VAN authored
      Add back compat config for RUN_NATIVE_NSD_ONLY_IF_LEGACY_APPS, which was
      lost when moving NsdManager to framework-connectivity-t.
      
      This causes NsdManager to start mdnsresponder again when used by apps
      with target SDK < 31.
      
      The change also changes the compat ID used, to make sure it does not
      conflict with the ID already in use in S and below, when the module is
      installed on such a platform. This is the only ChangeId used by
      framework-t.
      
      Also add a CtsNetTestCasesMaxTargetSdk30 test to verify that behavior.
      
      Bug: 235355681
      Test: atest CtsNetTestCasesMaxTargetSdk30
      Change-Id: I7ca6051d0a4ba5aff3e44bece2cbac22eb1be32d
      348bbb02
  19. Jul 21, 2022
    • Ken Chen's avatar
      Rename dscp_policy.o to dscpPolicy.o · 74ff3ee5
      Ken Chen authored
      Underscore character may cause bpf prog/map naming collision. For
      example, x.o with map y_z and x_y.o with map z both result in x_y_z
      prog/map name, which should be prevented during compile-time.
      
      aosp/2147825 will prohibit underscore character in bpf source name
      (source name derives the obj name). Existing bpf modules with underscore
      characters in source name need to be updated accordingly.
      
      Bug: 236706995
      Test: atest bpf_existence_test
      Test: adb root; adb shell ls -l sys/fs/bpf/net_shared | grep dscpPolicy
      Change-Id: Ibe98944d09d42bd11b78b5e9ae35ded48c70416d
      74ff3ee5
  20. Jul 20, 2022
    • Remi NGUYEN VAN's avatar
      Use jarjar rule generator for connectivity rules · e55a88d3
      Remi NGUYEN VAN authored
      (This rolls forward part of a previous change, now that jarjar was fixed
      to not get very slow when the number of rules increases).
      
      Autogenerate connectivity jarjar rules at build time, to avoid issues
      with forgotten jarjar rules or hard-to-diagnose errors introduced by
      incorrect rules.
      
      This change causes all classes in framework-connectivity(-t) and
      service-connectivity to be jarjared into android.net.connectivity, but
      still avoids jarjaring classes in com.android.server as before, to keep
      it small.
      For many classes this differs from the original jarjar rule.
      
      Notes on implementation:
      
       - connectivity-jarjar-rules now has a subset
         framework-connectivity-jarjar-rules containing only the rules
         necessary for framework-connectivity. This is necessary because
         framework-connectivity cannot depend on rules generated based on
         service-connectivity, as there would be a dependency cycle
         (service-connectivity depends on framework-connectivity); Soong even
         crashes with a stack overflow.
      
       - framework-wifi.stubs.module_lib is added to
         framework-connectivity-pre-jarjar as it is necessary to build it (it
         is already in impl_only_libs in the defaults).
         It is unclear why framework-connectivity-pre-jarjar could build
         before that (possibly because it was only used as "lib" ?)
      
       - Fix package-private visibility; for example NattSocketKeepalive,
         TcpSocketKeepalive are not API so should be jarjared, but are used
         by ConnectivityManager which is not jarjared, so they are not in the
         same package after the change. Package-private members in the
         former 2 need to be public to be accessible. Changes in this commit
         are all that is needed, as demonstrated by followup commits that move
         the classes to a different package without further changes, and that
         enforce that no class in an API package gets jarjared.
      
       - framework-connectivity-internal-test-defaults is separated from
         framework-connectivity-test-defaults, for unit tests that need to
         access internal jarjared classes. Such tests need to use the jarjar
         rules themselves too, so this is only appropriate for connectivity
         internal unit tests.
      
      Test: atest ConnectivityCoverageTests CtsNetTestCases
      Bug: 217129444
      Change-Id: Ib1bd939b71c0171d945fc01b96195d2f620ff13b
      e55a88d3
  21. Jul 18, 2022
    • Maciej Żenczykowski's avatar
      offload/test bpf: support InProcessTethering · ccce4a33
      Maciej Żenczykowski authored
      
      InProcessTethering runs as system_server (uid/gid AID_SYSTEM)
      instead of as the network_stack (uid/gid AID_NETWORK_STACK).
      
      Additionally only the network_stack has access to the default
      selinux context of /sys/fs/bpf/tethering, which is fs_bpf_tethering,
      so we need to use 'fs_bpf_net_shared' instead.
      
      Bug: 190523685
      Bug: 236925089
      Test: TreeHugger
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: Ibb6ae255dcd8a8e8049be112055f60c3b2cf7df0
      ccce4a33
  22. Jul 16, 2022
    • Maciej Żenczykowski's avatar
      enable btf for offload.o & test.o · 07d3013b
      Maciej Żenczykowski authored
      
      The objdump -x visible changes between old and new versions of the
      mainline shipped .o files are really very minimal: just the inclusion
      of a new .BTF section and changes/removals of some 'l' entries from
      the symbol table.  However, it turns out a change to symbol ordering
      is incompatible with BpfLoader <v0.10 which doesn't know to skip
      non-function symbols, and as such enabling btf requires a little
      bit of gymnastics.
      
      After:
        $ adbz shell ls -l /apex/com.android.tethering/etc/bpf/*.o
        -rw-r--r-- 1 system system 118352 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/offload.o
        -rw-r--r-- 1 system system 123424 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/offload@btf.o
        -rw-r--r-- 1 system system   2232 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/test.o
        -rw-r--r-- 1 system system   6376 1969-12-31 16:00 /apex/com.android.tethering/etc/bpf/test@btf.o
      
      $ adbz shell logcat -d | egrep offload.*[.]o
      07-15 13:10:43.358     0     0 D LibBpfLoader: Loading critical for tethering ELF object /apex/com.android.tethering/etc/bpf/offload.o with license Apache 2.0
      07-15 13:10:43.359     0     0 I LibBpfLoader: BpfLoader version 0x00019 ignoring ELF object /apex/com.android.tethering/etc/bpf/offload.o with max ver 0x00019
      07-15 13:10:43.359     0     0 I bpfloader: Loaded object: /apex/com.android.tethering/etc/bpf/offload.o
      07-15 13:10:43.374     0     0 D LibBpfLoader: Loading critical for tethering ELF object /apex/com.android.tethering/etc/bpf/offload@btf.o with license Apache 2.0
      07-15 13:10:43.375     0     0 I LibBpfLoader: BpfLoader version 0x00019 processing ELF object /apex/com.android.tethering/etc/bpf/offload@btf.o with ver [0x00019,0x10000)
      07-15 13:10:43.452     0     0 D LibBpfLoader: map_fd found at 0 is 6 in /apex/com.android.tethering/etc/bpf/offload@btf.o
      ...
      
      Test: TreeHugger
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: Id658818d1d42763358747523615b7918d312588e
      07d3013b
  23. Jul 08, 2022
    • Maciej Żenczykowski's avatar
      Tethering: add in-process vs out-of-process flag · 760d1ed0
      Maciej Żenczykowski authored
      
      This change results in the existence of either:
        /apex/com.android.tethering/etc/flag/out-of-process
        (Phones with mainline updatable Tethering in network_stack process)
      or
        /apex/com.android.tethering/etc/flag/in-process
        (Android Go with InProcessTethering in system_server process)
      
      These flags provide an easy way for the BpfLoader to
      detect the required selinux context for /sys/fs/bpf/tethering
      directory.
      
      Bug: 190523685
      Bug: 236925089
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: I8e66806d81893885a5ebe8a6dd4194c5b9dae219
      760d1ed0
  24. May 18, 2022
  25. May 16, 2022
    • Remi NGUYEN VAN's avatar
      Autogenerate connectivity jarjar rules · 7b92ff22
      Remi NGUYEN VAN authored
      Jarjar rules are hard to keep in sync with code, and hard to maintain
      manually as the distinction between what should and should not be
      jarjared is not always clear. This results in unsafe binaries that are
      manually maintained, and developer frustration when something fails due
      to incorrect jarjar rules.
      
      Autogenerate jarjar rules at build time instead. This is achieved by
      introducing a jarjar-rules-generator python-based library, which scans
      pre-jarjar intermediate artifacts, and outputs jarjar rules for every
      class to put it in a package specific to the module. The only exceptions
      are:
      
       - Classes that are API (module-lib API is the largest API surface of
         the module)
       - Classes that have unsupportedappusage symbols
       - Classes that are excluded manually (for example, because they have
         hardcoded external references, like for
         ConnectivityServiceInitializer in SystemServer).
      
      This change causes all classes in framework-connectivity(-t) and
      service-connectivity to be jarjared into android.net.connectivity, but
      still avoids jarjaring classes in com.android.server as before, to keep
      it small.
      For many classes this differs from the original jarjar rule.
      
      Notes on implementation:
      
       - connectivity-jarjar-rules now has a subset
         framework-connectivity-jarjar-rules containing only the rules
         necessary for framework-connectivity. This is necessary because
         framework-connectivity cannot depend on rules generated based on
         service-connectivity, as there would be a dependency cycle
         (service-connectivity depends on framework-connectivity); Soong even
         crashes with a stack overflow.
      
       - framework-wifi.stubs.module_lib is added to
         framework-connectivity-pre-jarjar as it is necessary to build it (it
         is already in impl_only_libs in the defaults).
         It is unclear why framework-connectivity-pre-jarjar could build
         before that (possibly because it was only used as "lib" ?)
      
       - Fix package-private visibility; for example NattSocketKeepalive,
         TcpSocketKeepalive are not API so should be jarjared, but are used
         by ConnectivityManager which is not jarjared, so they are not in the
         same package after the change. Package-private members in the
         former 2 need to be public to be accessible. Changes in this commit
         are all that is needed, as demonstrated by followup commits that move
         the classes to a different package without further changes, and that
         enforce that no class in an API package gets jarjared.
      
       - framework-connectivity-internal-test-defaults is separated from
         framework-connectivity-test-defaults, for unit tests that need to
         access internal jarjared classes. Such tests need to use the jarjar
         rules themselves too, so this is only appropriate for connectivity
         internal unit tests.
      
      Test: atest ConnectivityCoverageTests CtsNetTestCases
      Bug: 217129444
      Change-Id: Ied17c3955ea2fda130089265d02908937ad8af1e
      (cherry picked from commit 53eb35cd)
      Merged-In: Ied17c3955ea2fda130089265d02908937ad8af1e
      7b92ff22
  26. May 13, 2022
    • Remi NGUYEN VAN's avatar
      Autogenerate connectivity jarjar rules · 53eb35cd
      Remi NGUYEN VAN authored
      Jarjar rules are hard to keep in sync with code, and hard to maintain
      manually as the distinction between what should and should not be
      jarjared is not always clear. This results in unsafe binaries that are
      manually maintained, and developer frustration when something fails due
      to incorrect jarjar rules.
      
      Autogenerate jarjar rules at build time instead. This is achieved by
      introducing a jarjar-rules-generator python-based library, which scans
      pre-jarjar intermediate artifacts, and outputs jarjar rules for every
      class to put it in a package specific to the module. The only exceptions
      are:
      
       - Classes that are API (module-lib API is the largest API surface of
         the module)
       - Classes that have unsupportedappusage symbols
       - Classes that are excluded manually (for example, because they have
         hardcoded external references, like for
         ConnectivityServiceInitializer in SystemServer).
      
      This change causes all classes in framework-connectivity(-t) and
      service-connectivity to be jarjared into android.net.connectivity, but
      still avoids jarjaring classes in com.android.server as before, to keep
      it small.
      For many classes this differs from the original jarjar rule.
      
      Notes on implementation:
      
       - connectivity-jarjar-rules now has a subset
         framework-connectivity-jarjar-rules containing only the rules
         necessary for framework-connectivity. This is necessary because
         framework-connectivity cannot depend on rules generated based on
         service-connectivity, as there would be a dependency cycle
         (service-connectivity depends on framework-connectivity); Soong even
         crashes with a stack overflow.
      
       - framework-wifi.stubs.module_lib is added to
         framework-connectivity-pre-jarjar as it is necessary to build it (it
         is already in impl_only_libs in the defaults).
         It is unclear why framework-connectivity-pre-jarjar could build
         before that (possibly because it was only used as "lib" ?)
      
       - Fix package-private visibility; for example NattSocketKeepalive,
         TcpSocketKeepalive are not API so should be jarjared, but are used
         by ConnectivityManager which is not jarjared, so they are not in the
         same package after the change. Package-private members in the
         former 2 need to be public to be accessible. Changes in this commit
         are all that is needed, as demonstrated by followup commits that move
         the classes to a different package without further changes, and that
         enforce that no class in an API package gets jarjared.
      
       - framework-connectivity-internal-test-defaults is separated from
         framework-connectivity-test-defaults, for unit tests that need to
         access internal jarjared classes. Such tests need to use the jarjar
         rules themselves too, so this is only appropriate for connectivity
         internal unit tests.
      
      Test: atest ConnectivityCoverageTests CtsNetTestCases
      Bug: 217129444
      Change-Id: Ied17c3955ea2fda130089265d02908937ad8af1e
      53eb35cd
  27. May 09, 2022
  28. May 02, 2022
  29. Apr 12, 2022
Loading