Skip to content
Snippets Groups Projects
  1. Jan 26, 2024
    • Handa Wang's avatar
      Move the Thread proguard flags to ConnectivityService's proguard.flags · cca941a2
      Handa Wang authored
      We needed this proguard flag because
      ThreadNetworkService#onLocalNetworkInfoChanged will otherwise be
      stripped. We need to keep the method to ensure the border routing
      feature works.
      
      Initially we put the flag in thread/service/proguard.flags. However,
      this seems not working on udc-mainline-prod branch. After moving it to
      Connectivity/service/proguard.flags, it works as desired.
      
      Bug: 313539492
      
      Change-Id: I33cb0602095a617dbb1cfe3d9002f9c68e93cccf
      cca941a2
  2. Feb 14, 2023
    • Mark's avatar
      Allow jarjar com.android.server* · 53e71c3f
      Mark authored
      Jarjar com.android.server* and adjust the test by jarjar
      FrameworksNetTestsLib to make sure the test cases still can access
      package sope fields. Don't auto-jarjar non-connectivity module tests
      in FrameworksNetTests because some non-connectivity module test cases
      rely on service.core and service.net. The reason why not auto-jarjar
      whole ConnectivityCoverageTests because tethering doesn't adopt
      auto-jarjar-gen yet. The coverage test must jarjar the same as module so
      that test coverage can calculate correctly.
      
      Remove com.android.server* from proguard becasue it already be covered
      by android.net* after jarjar'ed.
      
      Move MetricsTestUtil to non connectivity module test group because it
      only be used for IpConnectivityEventBuilderTest which is non connectivity
      module test. Only jarjar the util without jarjar the caller make the test
      failure.
      
      Bug: 248001529
      Test: atest ConnectivityCoverageTests FrameworksNetTests
      
      Change-Id: I8439341ef4c03f29697fdf34557ea8ef2825d691
      53e71c3f
  3. Oct 13, 2022
    • Chalard Jean's avatar
      Keep primitive members used by MessageUtils. · 88edc35d
      Chalard Jean authored
      This includes in particular {Full,Network}Score.POLICY_* members
      which were removed recently.
      
      Before :
        Policies : 55&62&63
      After :
        Policies : EVER_EVALUATED&EVER_VALIDATED&IS_VALIDATED
      
      This patch also unifies the directives under Tethering/ for
      simplicity.
      
      Test: adb logcat & dumpsys connectivity & dumpsys tethering
      Change-Id: I3d231fbaaebe233b2633da8bb880b5ad1613a32f
      88edc35d
  4. Sep 27, 2022
  5. 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
  6. Jun 23, 2022
    • Chun Zhang's avatar
      Fix pro-guard rules for service-nearby · 19379732
      Chun Zhang authored
      (clean cherry-pick of downstream change)
      
      Test: build and check classes in service-connectivity.jar.
      Bug: 217115866
      Merged-In: I9f7db4509bf8fe736f5d9fc08b164a20b2274aa8
      Change-Id: Ia97b7ab645e3425780b335c699b57a6dc7589f2a
      19379732
  7. Jun 09, 2022
    • Chun Zhang's avatar
      Fix pro-guard rules for service-nearby · 00717123
      Chun Zhang authored
      Test: build and check classes in service-connectivity.jar.
      Bug: 217115866
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      Change-Id: I9f7db4509bf8fe736f5d9fc08b164a20b2274aa8
      Merged-In: Ifd73882c804d3c8a998cd4b9a263fdecbc0f98f7
      00717123
    • Chen Wang's avatar
      Nearby CHRE/Mainline integration for Fast Pair. · 600d1f5c
      Chen Wang authored
      See go/fp-chre for details. This change has been verified on device with
      mock BLE event to support Fast Pair fitler update, device discovery, and
      screen on notification to CHRE.
      
      Test: unit tests and on device tests.
      
      Fix: 232286342
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      
      Change-Id: Ifd73882c804d3c8a998cd4b9a263fdecbc0f98f7
      600d1f5c
  8. May 18, 2022
  9. 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
  10. 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
  11. May 11, 2022
    • Remi NGUYEN VAN's avatar
      Enable optimizer on service-connectivity · c6f8fb0c
      Remi NGUYEN VAN authored
      The optimizer has been enabled in downstream branches (including those
      used for upcoming module releases) for a few months. This brings aosp in
      line with them.
      
      This is a cherry-pick of change:
      I3be9422a431a5b5bc1478960ce332a89377bd632
      
      where proguard.flags have been replaced with the most up-to-date version
      used in downstream branches.
      
      Test: m
      Merged-In: I3be9422a431a5b5bc1478960ce332a89377bd632
      Change-Id: I55455eb58d3fdc4dbf3ea81961d5c7756fea0046
      c6f8fb0c
  12. May 09, 2022
    • Chun Zhang's avatar
      Add jarjar rules for service-nearby. · ea54e5af
      Chun Zhang authored
      Test: build and check classes in service-connectivity.jar.
      Bug: 217115866
      Change-Id: Ibf8d3ee5274a709479b9ab7f0af2b3e0a7e7fa7b
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      ea54e5af
  13. Feb 11, 2022
    • Eric Lin's avatar
      Nearby: Turn off proguard optimization of proto classes. · 3d255c11
      Eric Lin authored
      Add a proguard rule to prevent proguard from stripping out
      fast-pair-lite-protos classes/fields.
      
      Fix: 218607668
      Test: atest CtsNearbyFastPairTestCases and manual steps in b/218607668#comment2
      Ignore-AOSP-First: Nearby is not yet in AOSP. This introduces minimal
                         unavoidable merge conflicts until it is merged there.
      Change-Id: I947c9e3b6ebc232e230782f6345c5cb6893138e6
      3d255c11
  14. Feb 01, 2022
    • Remi NGUYEN VAN's avatar
      Add android.net to proguard flags · 2aeb454f
      Remi NGUYEN VAN authored
      Keep classes in android.net, as a followup change will have
      some utility classes in that package in service-connectivity.
      
      Ideally only "entry point" classes would be listed in the flags,
      and the optimizer would figure out what is unreachable and
      can be stripped out; but to be safe for now, list all classes.
      
      Ignore-AOSP-First: Proguard rules not yet cherry-picked
      Bug: 204830222
      Change-Id: I45954f3bd23e84bacfd0f94875e10687e3e9cbc9
      Test: m
      2aeb454f
  15. Jan 26, 2022
    • Remi NGUYEN VAN's avatar
      Add nearby to tethering apex · 51935fc2
      Remi NGUYEN VAN authored
      Nearby will be merged together with the tethering/connectivity APEX, so
      that module maintenance efforts can be reduced, and the two codebases
      can evolve the interfaces that they expose to each other over time.
      
      Bug: 189355156
      Test: m
      Ignore-AOSP-First: Nearby is not yet in AOSP. This introduces minimal
                         unavoidable merge conflicts until it is merged there.
      Change-Id: If4b40689a257d2806f895cd2dded97fc699adc5f
      51935fc2
    • Remi NGUYEN VAN's avatar
      Enable proguard on service-connectivity · 47fce471
      Remi NGUYEN VAN authored
      The current proguard rules keep all classes currently in the jar, so
      this does not strip any classes, but it applies optimizations on the
      code.
      Enabling proguard will be useful when adding service-nearby to the jar.
      
      Bug: 189355156
      Test: m service-connectivity; check list of classes in jar unchanged
      Change-Id: I3be9422a431a5b5bc1478960ce332a89377bd632
      47fce471
Loading