Skip to content
Snippets Groups Projects
  1. 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
  2. Jul 19, 2022
  3. Jul 18, 2022
  4. Jul 16, 2022
    • Maciej Żenczykowski's avatar
      further bpf_existence_test code simplifications/clarifications · e9e77418
      Maciej Żenczykowski authored
      
      (mainly driven by the desire to make it clear this
      is about *current* mainline state and not at-T-launch state
      of things)
      
      Test: TreeHugger
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: I928f91704f78205ffe44611a3d3abe383c4e560b
      e9e77418
    • 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
    • Remi NGUYEN VAN's avatar
  5. Jul 15, 2022
  6. Jul 14, 2022
  7. Jul 13, 2022
    • Paul Duffin's avatar
      Dedup *fragments information common to apex and sdk · 1514c032
      Paul Duffin authored
      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
      1514c032
    • Motomu Utsumi's avatar
      Use java BpfMap in removeUidInterfaceRules · 599c4e5c
      Motomu Utsumi authored
      Bug: 217624062
      Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
      Change-Id: I253c75aaeabe138a4f9d57c226744f5766ef1006
      599c4e5c
    • Motomu Utsumi's avatar
      Use java BpfMap in BpfNetMaps#addUidInterfaceRules · 5f52f4f2
      Motomu Utsumi authored
      Bug: 217624062
      Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
      Change-Id: I8aeb4712c852167d553eb331f32d770582199b13
      5f52f4f2
    • Xiao Ma's avatar
      Make Tethering module depend on net-utils-device-common-ip. · c81c0669
      Xiao Ma authored
      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
      c81c0669
  8. Jul 12, 2022
Loading